It's been a week now and we're unable to build the apk file for our andorid project.
(到现在已经一周了,我们无法为我们的andorid项目构建apk文件。)
The error that we're getting is related to the proguard(see the attached errors): (我们得到的错误与proguard有关(请参阅随附的错误):)
Warning:there were 416 unresolved references to classes or interfaces.
(警告:有416个未解决的对类或接口的引用。)
Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForDebug'.
(错误:任务':app:transformClassesAndResourcesWithProguardForDebug'的执行失败。)
java.io.IOException: Please correct the above warnings first. (java.io.IOException:请首先更正以上警告。)
The project used to build before one of our recent commits.
(该项目曾经在我们最近提交的项目之一之前构建。)
So, when we checkout to that commit it works! (因此,当我们签出该提交时,它就起作用了!)
We've tried everything available, related to this, on the stackoverflow/internet but nothing works! (我们已经在stackoverflow / internet上尝试了与此相关的所有可用方法,但是没有任何效果!)
and the worst part is that it builds but just on one of our computers and we're unable to figure out why it doesn't work on other computers with the same version of the Android Studio. (最糟糕的是它只能在我们的一台计算机上构建,而我们无法弄清楚为什么它不能在其他具有相同Android Studio版本的计算机上运行。)
We even tried to suppress the warnings by using :
(我们甚至尝试使用以下命令禁止显示警告:)
-dontwarn
(唐顿)
-keep class
(-保持课程)
So, in this case the build was successful but the app crashes.
(因此,在这种情况下,构建成功,但应用程序崩溃。)
Versions of the different components used :
(使用的不同组件的版本:)
Android Studio - 2.1.2
(Android Studio-2.1.2)
Proguard - 5.2.1
(Proguard-5.2.1)
buildToolsVersion 23.0.2
(buildToolsVersion 23.0.2)
Proguard errors
(Proguard错误)
These are the proguard rules that we're using for our project :
(这些是我们用于项目的proguard规则:)
-dontwarn com.github.siyamed.shapeimageview.path.parser.SvgToPath
-dontwarn com.google.android.gms.internal.zzhu
-dontwarn com.squareup.okhttp.**
-keep class com.opentok.** { *; }
-keep class org.webrtc.** { *; }
-keepattributes SourceFile,LineNumberTable
-keepattributes *Annotation*
-keep class org.acra.** { *; }
-keepclassmembers class com.paytm.pgsdk.PaytmWebView$PaytmJavaScriptInterface {
public *;
}
##MoEngage proguard rules, src : http://docs.moengage.com/docs/android-configuring-proguard
-dontwarn com.google.android.gms.location.**
-dontwarn com.google.android.gms.gcm.**
-dontwarn com.google.android.gms.iid.**
-dontwarn okio.**
-keep class com.google.android.gms.gcm.** { *; }
-keep class com.google.android.gms.iid.** { *; }
-keep class com.google.android.gms.location.** { *; }
-keep class com.facebook.drawee.**{*;}
-dontwarn com.facebook.drawee.*
-keep class com.moe.pushlibrary.activities.** { *; }
-keep class com.moe.pushlibrary.internal.MoEService
-keep class com.moe.pushlibrary.GeofenceIntentService
-keep class com.moe.pushlibrary.InstallReceiver
-keep class com.moengage.push.MoEPushWorker
-keep class com.moe.pushlibrary.PushGcmBroadcastReceiver
-keep class com.moe.pushlibrary.providers.MoEProvider
-keep class com.moengage.receiver.MoEInstanceIDListener
-keep class com.moengage.worker.MoEGCMListenerService
-keep class com.moe.pushlibrary.models.** { *;}
-keep class com.moe.pushlibrary.internal.GeoTask
-keep class com.moengage.locationlibrarynew.LocationHandlerImpl
-dontwarn com.moengage.locationlibrarynew.LocationHandlerImpl
-dontwarn com.moe.pushlibrary.internal.GeoTask
-dontwarn com.moengage.receiver.*
-dontwarn com.moengage.worker.*
-dontwarn com.moengage.*
-keep class com.delight.** { *; }
## for rx java
-dontwarn sun.misc.**
-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
long producerIndex;
long consumerIndex;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
rx.internal.util.atomic.LinkedQueueNode producerNode;
}
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
rx.internal.util.atomic.LinkedQueueNode consumerNode;
}
ask by Ashish Ranjan translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…