proguard - AppCompat does not support the current theme features after proguard/minify

前端 未结 1 1866
南笙
南笙 2021-01-11 11:45

I\'ve updated support libs to v23.0.0 from v22.2.1, after building app (with minifyEnabled true) i have \"AppCompat does not support the current theme features\" exception:<

相关标签:
1条回答
  • 2021-01-11 11:54

    The error message may be misleading. Look out for Proguard warnings like this one:

    Warning: org.acra.ErrorReporter: can't find referenced method 'void setLatestEventInfo(android.content.Context,java.lang.CharSequence,java.lang.CharSequence,android.app.PendingIntent)' in library class android.app.Notification
    Warning: there were 1 unresolved references to library class members.
             You probably need to update the library versions.
             (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
    Exception while processing task 
    java.io.IOException: Please correct the above warnings first.
        at proguard.Initializer.execute(Initializer.java:473)
        at proguard.ProGuard.initialize(ProGuard.java:233)
        at proguard.ProGuard.execute(ProGuard.java:98)
        at proguard.gradle.ProGuardTask.proguard(ProGuardTask.java:1074)
        at com.android.build.gradle.tasks.AndroidProGuardTask.doMinification(AndroidProGuardTask.java:139)
        at com.android.build.gradle.tasks.AndroidProGuardTask$1.run(AndroidProGuardTask.java:115)
        at com.android.builder.tasks.Job.runTask(Job.java:48)
        at com.android.build.gradle.tasks.SimpleWorkQueue$EmptyThreadContext.runTask(SimpleWorkQueue.java:41)
        at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:227)
        at java.lang.Thread.run(Thread.java:745)
    

    Although there was an error the build will succeed if there is a classes.jar file from a previous build, a clean build will fail as expected.

    In my case fixing the Proguard warning also removed the AppCompat exception.

    0 讨论(0)
提交回复
热议问题