Closed Hasiy closed 2 months ago
The model is OnePlus 7T , compileSdkVersion = 33
@Hasiy
Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
主题需要使用Appcompat的theme,因为CrashActivity是集成的AppcompatActivity。
主题是Appcompat的
@Hasiy 那试试本项目的demo能不能跑起来吧,看和你项目的哪里配置有啥区别。
manifest里加了这个正常了
<activity android:name="com.simple.spiderman.CrashActivity" android:theme="@style/Theme.AppCompat.Light.NoActionBar" />
E FATAL EXCEPTION: main Process: com..qys, PID: 5402 java.lang.RuntimeException: Unable to start activity ComponentInfo{com..qys/com.simple.spiderman.CrashActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3780) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3942) at java.lang.reflect.Method.invoke(Native Method) at com.sangfor.sdk.sandbox.Sangfor_a.Sangfor_d.Sangfor_a.Sangfor_b(Proguard:1) at com.sangfor.sdk.sandbox.masterslave.MasterSlaveModeManager$Sangfor_a.Sangfor_b(Proguard:3) at com.sangfor.sdk.sandbox.Sangfor_a.Sangfor_b$Sangfor_b.invoke(Proguard:7) at android.app.ClientTransactionHandler_Proxy.handleLaunchActivity(Unknown Source:22) at java.lang.reflect.Method.invoke(Native Method) at com.sangfor.sdk.sandbox.Sangfor_a.Sangfor_b$Sangfor_b.invoke(Proguard:10) at android.app.ClientTransactionHandler_Proxy.handleLaunchActivity(Unknown Source:22) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:109) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2345) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:233) at android.os.Looper.loop(Looper.java:344) at android.app.ActivityThread.main(ActivityThread.java:8212) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1034) Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:926) at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:889) at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:772) at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:197) at com.simple.spiderman.CrashActivity.onCreate(CrashActivity.java:54) at android.app.Activity.performCreate(Activity.java:8129) at android.app.Activity.performCreate(Activity.java:8109) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1344) at java.lang.reflect.Method.invoke(Native Method) at com.sangfor.sdk.sandbox.Sangfor_a.Sangfor_b$Sangfor_b.invoke(Proguard:10) at android.app.Instrumentation_Proxy.callActivityOnCreate(Unknown Source:20) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3749) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3942) at java.lang.reflect.Method.invoke(Native Method) at com.sangfor.sdk.sandbox.Sangfor_a.Sangfor_d.Sangfor_a.Sangfor_b(Proguard:1) at com.sangfor.sdk.sandbox.masterslave.MasterSlaveModeManager$Sangfor_a.Sangfor_b(Proguard:3) at com.sangfor.sdk.sandbox.Sangfor_a.Sangfor_b$Sangfor_b.invoke(Proguard:7) at android.app.ClientTransactionHandler_Proxy.handleLaunchActivity(Unknown Source:22) at java.lang.reflect.Method.invoke(Native Method) at com.sangfor.sdk.sandbox.Sangfor_a.Sangfor_b$Sangfor_b.invoke(Proguard:10) at android.app.ClientTransactionHandler_Proxy.handleLaunchActivity(Unknown Source:22) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:109) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2345) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:233) at android.os.Looper.loop(Looper.java:344) at android.app.ActivityThread.main(ActivityThread.java:8212) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1034) 2024-09-05 14:13:21.511 5402-5402 CrashReport com..qys E Java Crash Happen cause by main(2)