【问题标题】:My android app is working properly in debug mode in android studio but not working when i install from google playstore我的 android 应用程序在 android studio 的调试模式下正常工作,但当我从 google playstore 安装时无法正常工作
【发布时间】:2018-03-20 13:14:15
【问题描述】:

有人可以在 proguard-rules.pro 中帮助我吗,昨天我从 google playstore 下载时,我的应用程序运行良好。但是当我使用 proguard-rules 更新我的应用程序时,我的应用程序在我从 Google Play 商店下载时崩溃。但是当我在调试模式下从 android studio 运行时运行完美。

我目前已经更新了我的 proguard-rules.pro

    -keep class com.squareup.okhttp.** { *; }
    -keep class retrofit.** { *; }
    -keep interface com.squareup.okhttp.** { *; }

    -dontwarn com.squareup.okhttp.** 
    -dontwarn okio.**
    -dontwarn retrofit.**
    -dontwarn rx.**
    -dontwarn okio.**
    -dontwarn retrofit2.**
    -keepclasseswithmembers class * {
    @retrofit.http.* <methods>;
    }

我的 gradle 文件中有这么多库

compile "com.android.support:support-v4:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:appcompat-v7:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:recyclerview-v7:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:cardview-v7:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:design:$SUPPORT_LIBRARY_VERSION"
compile "com.android.support:support-annotations:$SUPPORT_LIBRARY_VERSION"

compile "com.squareup.retrofit2:retrofit:$RETROFIT_VERSION"
compile "com.squareup.retrofit2:converter-gson:$RETROFIT_VERSION"
compile "com.squareup.retrofit2:adapter-rxjava:$RETROFIT_VERSION"
compile "com.squareup.okhttp3:okhttp:$OKHTTP_VERSION"
compile "com.squareup.okhttp3:logging-interceptor:$OKHTTP_VERSION"

compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.3.0'
compile 'com.jakewharton.timber:timber:4.1.1'

compile "com.jakewharton:butterknife:$BUTTERKNIFE_VERSION"
annotationProcessor "com.jakewharton:butterknife-compiler:$BUTTERKNIFE_VERSION"

compile "com.google.dagger:dagger:$DAGGER_VERSION"
annotationProcessor "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
provided 'javax.annotation:jsr250-api:1.0'
compile 'javax.inject:javax.inject:1'

implementation("com.mikepenz:materialdrawer:6.0.6@aar") {
    transitive = true
}

compile 'com.github.javiersantos:AppUpdater:2.0.2'
compile 'com.thoughtbot:expandablerecyclerview:1.0'

implementation 'com.github.bumptech.glide:glide:4.3.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.3.1'

compile 'com.onesignal:OneSignal:[3.7.1, 3.99.99]'

compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.5@aar'
compile('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
    transitive = true;
}

但是我遇到了一个错误,我真的不知道发生了什么

java.lang.IllegalStateException: 
at f.d.c.g.run (Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
at java.util.concurrent.FutureTask.run (FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run (ScheduledThreadPoolExecutor.java:272)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:607)
at java.lang.Thread.run (Thread.java:762)
Caused by: java.lang.InternalError: 
at f.d.e.b.y.a (Unknown Source)
at f.d.e.b.r.<clinit> (Unknown Source)
at f.d.a.n$a.<init> (Unknown Source)
at f.d.a.n.a (Unknown Source)
at f.d.a.n.a (Unknown Source)
at f.d.a.f.a (Unknown Source)
at f.d.a.f.a (Unknown Source)
at f.e.a (Unknown Source)
at f.d.a.p$a.a (Unknown Source)
at f.d.c.a$b$1.a (Unknown Source)
Caused by: java.lang.NoSuchFieldException: 
at java.lang.Class.getDeclaredField (Native Method)

我的 gradle(应用程序)

    minSdkVersion 16
    targetSdkVersion 26
    versionCode 9
    versionName "1.6"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    javaCompileOptions {
        annotationProcessorOptions {
            includeCompileClasspath false
        }
    }

}
buildTypes {
    release {
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

【问题讨论】:

  • 你应该使用retrace,或者将你的映射文件上传到控制台,这样你就可以去混淆你的stacktrace。
  • 如何获取或生成映射文件?

标签: android google-play proguard


【解决方案1】:

a.b.c.d.e.f.. 很难找到错误

默认情况下,在AndroidStudio 3 中,当您构建发布的应用程序时,有一个映射文件可以帮助任何分析服务(如FirebaseAnalysisCrashlytic)检测错误所在并为您提供尽可能多的上下文和详细信息尽可能在发生运行时异常时。

将位于build/outputs/mapping/release/mapping.txt 的映射文件上传到您的Google Play Console 中的Proguard Deobfuscation。然后再次跟踪错误。

【讨论】:

  • 我上传了文件,但仍然无法以可读格式崩溃。
  • 我需要等待吗?上传文件后。
  • 上传和执行文件需要一些时间。请检查右上角的栏。
  • 旧日志不会被反混淆。您必须使用 proguard gui 自己完成。你可以在你的 Android SDK 中找到它
  • 当然。您需要跟踪新日志并等待相同的错误以查看发生了什么。 (IllegalStateException->InternalError->NoSuchFieldException)
猜你喜欢
  • 2021-09-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-05-21
  • 2021-05-22
  • 2018-02-05
  • 1970-01-01
  • 2014-12-10
相关资源
最近更新 更多