Small Sample项目打包后在ZTE上闪退,提示缺少Theme
- [x] 我已阅读并理解 贡献指南,严格遵循其约定。
错误报告
你做了什么?
使用Sample项目打包成apk,在中兴天机7手机上运行
你期望的结果是什么?
正常运行,不会闪退
实际结果是什么?
启动页后直接闪退,提示缺少主题 ava.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2669) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2730) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1481) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:179) at android.app.ActivityThread.main(ActivityThread.java:6152) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776) Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImplV9.java:355) at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:324) at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:285) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:143) at net.wequick.example.small.app.main.MainActivity.onCreate(MainActivity.java:66) at android.app.Activity.performCreate(Activity.java:6728) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119) at net.wequick.small.ApkBundleLauncher$InstrumentationWrapper.callActivityOnCreate(ApkBundleLauncher.java:334) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2622) ... 9 more Force finishing activity net.wequick.example.small/net.wequick.small.A
Small环境
Compile-time
gradle-small plugin : 1.3.0-alpha1 (maven)
small aar : 1.3.0-alpha1 (maven)
small binding aar : 1.1.0 (maven)
gradle core : 3.3
android plugin : 2.3.3
OS : Mac OS X 10.12 (x86_64)
Bundles
| type | name | PP | sdk | aapt | support | file | size |
|---|---|---|---|---|---|---|---|
| host | app | 25 | 25.0.2 | ||||
| stub | app+stub | 25 | 25.0.2 | 25.1.0 | |||
| app | app.main | 0x77 | 25 | 25.0.2 | 25.1.0 | *.main.apk | 11.7 KB |
| app | app.mine | 0x16 | 25 | 25.0.2 | *.mine.apk | 47.4 KB | |
| app | app.ok-if-stub | 0x6a | 25 | 25.0.2 | *.appok_if_stub.apk | 19.7 KB | |
| app | app.detail | 0x67 | 25 | 25.0.2 | 25.1.0 | *.detail.apk | 11 KB |
| app | app.home | 0x70 | 25 | 25.0.2 | *.home.apk | 14.7 KB | |
| lib | lib.analytics | 0x76 | 25 | 25.0.2 | *.analytics.apk | 126.6 KB | |
| lib | lib.utils | 0x73 | 25 | 25.0.2 | 25.1.0 | *.utils.apk | 6.9 KB |
| lib | lib.style | 0x79 | 25 | 25.0.2 | 25.1.0 | *.style.apk | 8.7 KB |
| web | web.about | 25 | 25.0.2 | 25.1.0 | *.about.apk | 24.3 KB |
Runtime
Device : ZTE A2017
SDK : Android 7.1
ABI : armeabi-v7a

中兴V0840遇到同样问题,上图为日志截图。
@729286938 Android插件化之资源加载 https://ivonhoe.github.io/2018/03/14/small-bug-555-fix/ 中兴手机的问题可以参照这篇