Proguard会在应用加载时导致AppCompat崩溃

时间:2015-10-16 19:53:26

标签: android proguard android-appcompat android-proguard appcompat-v7-r23

我有一个没有Proguard工作的android项目(当minifiy设置为false时),当minify设置为true时,应用程序在加载时崩溃。

我无法弄清楚Proguard正在破坏应用程序的哪个组件,  混淆的堆栈跟踪在下面,希望它可以帮助。

请注意,我的应用使用了一个继承Theme.Appcompat.Light.NoActionBar的主题,并且在未启用proguard的情况下一切正常。所以这个例外可能会产生误导。

FATAL EXCEPTION: main
Process: com.myapp, PID: 23077
 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp/com.myapp.activities.LoginActivity}:
     java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
     at android.app.ActivityThread.access$800(ActivityThread.java:144)
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
     at android.os.Handler.dispatchMessage(Handler.java:102)
     at android.os.Looper.loop(Looper.java:135)
     at android.app.ActivityThread.main(ActivityThread.java:5221)
     at java.lang.reflect.Method.invoke(Native Method)
     at java.lang.reflect.Method.invoke(Method.java:372)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
  Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
     at android.support.v7.app.t.a(Unknown Source)
     at android.support.v7.app.AppCompatDelegateImplV7.a(Unknown Source)
     at android.support.v7.app.q.onCreate(Unknown Source)
     at com.myapp.activities.LoginActivity.onCreate(Unknown Source)
     at android.app.Activity.performCreate(Activity.java:5933)
     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360) 
     at android.app.ActivityThread.access$800(ActivityThread.java:144) 
     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278) 
     at android.os.Handler.dispatchMessage(Handler.java:102) 
     at android.os.Looper.loop(Looper.java:135) 
     at android.app.ActivityThread.main(ActivityThread.java:5221) 
     at java.lang.reflect.Method.invoke(Native Method) 
     at java.lang.reflect.Method.invoke(Method.java:372) 
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) 
     at com.android.internal.os.ZygoteIn

it.main(ZygoteInit.java:694)

知道发生了什么事吗?关于如何追踪问题原因的任何提示?

0 个答案:

没有答案