:app:transformclassesandresourceswithproguardforrelease

368yc8dk  于 2021-07-09  发布在  Java
关注(0)|答案(1)|浏览(385)

我是proguard的新手,不知道如何解决我的问题。这似乎很容易,但我不知道如何解决它。
proguard.parseexception:在“;”之前需要java类型第51行
下面显示错误:任务“”的执行失败:app:transformclassesandresourceswithproguardforrelease'
这是我的第51行:

-keep class rx.schedulers.Schedulers { public static ; }

proguard-rules.pro:


# Vungle

-dontwarn com.vungle.**
-dontnote com.vungle.**
-keep class com.vungle.**{ *; }
-keep class javax.inject.*

# GreenRobot

-dontwarn de.greenrobot.event.util.**

# RxJava

-dontwarn rx.internal.util.unsafe.**
-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 ;
}

-keep class rx.schedulers.Schedulers { public static ; }
-keep class rx.schedulers.ImmediateScheduler { public ; }
-keep class rx.schedulers.TestScheduler { public ; }
-keep class rx.schedulers.Schedulers { public static**test(); }

# MOAT

-dontwarn com.moat.**
-keep class com.moat.**{
   public protected private *;
}

-keep class com.tapjoy.**{ *; }
-keep class com.moat.**{ *; }
-keepattributes JavascriptInterface
-keepattributes *Annotation*
-keep class * extends java.util.ListResourceBundle {
protected Object[][] getContents();
}
-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
public static final***NULL;
}
-keepnames @com.google.android.gms.common.annotation.KeepName class *
-keepclassmembernames class * {
@com.google.android.gms.common.annotation.KeepName *;
}
-keepnames class * implements android.os.Parcelable {
public static final**CREATOR;
}
-keep class com.google.android.gms.ads.identifier.**{ *; }
-dontwarn com.tapjoy.**

-keep public class com.google.gson
-keep class Gson**
-keepclassmembers class Gson**{
    *;
}
-keepattributes Signature, *Annotation*
-keep class com.nativex.**{
    *;
}

-keepattributes SourceFile,LineNumberTable
-keep class com.parse.*{ *; }
-dontwarn com.parse.**
-dontwarn com.squareup.picasso.**
-keepclasseswithmembernames class * {
    native <methods>;
}

这个答案解决了我的问题:
使用

-keep class rx.schedulers.Schedulers {public static <methods>;}

代替

-keep class rx.schedulers.Schedulers { public static ; }

但现在又出现了一个新的问题。
例外情况: Exception while processing task java.io.IOException: Please correct the above warnings first. 这是我的警告:

Warning: there were 1 unresolved references to classes or interfaces. You may need to add missing library jars or update their versions. If your code works fine without the missing classes, you can suppress the warnings with '-dontwarn' options.

在大名单之上 Note: ..... 我能怎么办?

vojdkbi0

vojdkbi01#

使用

-keep class rx.schedulers.Schedulers {
    public static <methods>;
}

代替

-keep class rx.schedulers.Schedulers { public static ; }

相关问题