我将android-studio 3.0从canary 5更新为canary 6,然后突然我的应用程序在KitKat(API 19)上发生崩溃,下面是stacktrace.
Main2Activity.java:10行是我的活动onCreate()方法的第一行.
07-11 13:00:39.523 8913-8913/dcpl.com.myapplication E/AndroIDRuntime: FATAL EXCEPTION: main Process: dcpl.com.myapplication, PID: 8913 java.lang.RuntimeException: Unable to start activity ComponentInfo{dcpl.com.myapplication/dcpl.com.myapplication.Main2Activity}: androID.content.res.Resources$NotFoundException: Resource ID #0x7f070058 at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2318) at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2396) at androID.app.ActivityThread.access0(ActivityThread.java:139) at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1293) at androID.os.Handler.dispatchMessage(Handler.java:102) at androID.os.Looper.loop(Looper.java:149) at androID.app.ActivityThread.main(ActivityThread.java:5257) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:817) at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:633) at dalvik.system.NativeStart.main(Native Method) Caused by: androID.content.res.Resources$NotFoundException: Resource ID #0x7f070058 at androID.content.res.Resources.getValue(Resources.java:1173) at androID.support.v7.Widget.AppCompatDrawableManager.loadDrawableFromDelegates(AppCompatDrawableManager.java:332) at androID.support.v7.Widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:197) at androID.support.v7.Widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:190) at androID.support.v7.Widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:711) at androID.support.v7.Widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:195) at androID.support.v7.Widget.TintTypedArray.getDrawableIfKNown(TintTypedArray.java:81) at androID.support.v7.app.AppCompatDelegateImplBase.<init>(AppCompatDelegateImplBase.java:131) at androID.support.v7.app.AppCompatDelegateImplV9.<init>(AppCompatDelegateImplV9.java:155) at androID.support.v7.app.AppCompatDelegateImplV11.<init>(AppCompatDelegateImplV11.java:31) at androID.support.v7.app.AppCompatDelegateImplV14.<init>(AppCompatDelegateImplV14.java:55) at androID.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:205) at androID.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:185) at androID.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:519) at androID.support.v7.app.AppCompatActivity.setContentVIEw(AppCompatActivity.java:140) at dcpl.com.myapplication.Main2Activity.onCreate(Main2Activity.java:10) at androID.app.Activity.performCreate(Activity.java:5411) at androID.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) at androID.app.ActivityThread.performlaunchActivity(ActivityThread.java:2270) at androID.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2396) at androID.app.ActivityThread.access0(ActivityThread.java:139) at androID.app.ActivityThread$H.handleMessage(ActivityThread.java:1293) at androID.os.Handler.dispatchMessage(Handler.java:102) at androID.os.Looper.loop(Looper.java:149) at androID.app.ActivityThread.main(ActivityThread.java:5257) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.androID.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:817) at com.androID.internal.os.ZygoteInit.main(ZygoteInit.java:633) at dalvik.system.NativeStart.main(Native Method)
我该如何解决?
解决方法:
似乎这个问题与Aapt 2有关.
放
androID.enableAapt2 = FALSE
在您的gradle.propertIEs文件中,它为我修复了问题.
总结以上是内存溢出为你收集整理的Android Studio 3.0:canary 6:启动活动中的android.content.res.Resources $NotFoundException全部内容,希望文章能够帮你解决Android Studio 3.0:canary 6:启动活动中的android.content.res.Resources $NotFoundException所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)