Android App Bundle在Android应用中引入了资源未找到崩溃 [英] Android App Bundle introduces Resource Not found crash in Android app

查看:255
本文介绍了Android App Bundle在Android应用中引入了资源未找到崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过使用Android新的Android应用程序包,我在我的2个谷歌游戏商店应用程序中找到了资源未发现崩溃: -

By using android new Android App Bundle i have found Resource Not Found Crashes in 2 of my google play store apps :-

这是来自fabric的stacktrace应用程序: -

Here is the stacktrace from fabric for one of the app:-

Unable to start activity ComponentInfo{/com.Lastyear.MainActivity}: android.content.res.Resources$NotFoundException: File res/drawable/abc_item_background_holo_dark.xml from drawable resource ID #0x7f08002c
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2377)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2429)
       at android.app.ActivityThread.access$800(ActivityThread.java:151)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1342)
       at android.os.Handler.dispatchMessage(Handler.java:110)
       at android.os.Looper.loop(Looper.java:193)
       at android.app.ActivityThread.main(ActivityThread.java:5363)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:515)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:828)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:644)
       at dalvik.system.NativeStart.main(NativeStart.java)

build.gradle依赖关系: -

build.gradle Dependencies :-

 dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.squareup.picasso:picasso:2.5.2'

implementation 'com.android.support:palette-v7:27.1.1'
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.android.support:design:27.1.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.github.hotchemi:android-rate:1.0.1'
implementation 'com.hannesdorfmann.smoothprogressbar:library:1.0.0'
implementation 'com.android.support:palette-v7:27.1.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.muddzdev:styleabletoast:1.0.9'
implementation 'com.github.GrenderG:Toasty:1.2.5'
implementation 'com.hannesdorfmann.smoothprogressbar:library:1.0.0'

implementation 'com.wang.avi:library:2.1.3'
implementation 'com.github.medyo:fancybuttons:1.8.4'
implementation 'com.irozon.sneaker:sneaker:1.0.1'
implementation 'com.sdsmdg.tastytoast:tastytoast:0.1.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'


implementation 'com.getkeepsafe.taptargetview:taptargetview:1.11.0'


implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
    transitive = true;
}


implementation 'petrov.kristiyan:colorpicker-library:1.1.8'}

仅在Android 4操作系统上发生了一件事,而不是在新版本的Android上。我发现其他应用程序遇到的资源问题是资源未找到在使用Android应用程序包之前。库或代码中是否存在问题,或者是因为Android应用包的测试版?

One more thing it is happening only on Android 4 operating system not on new versions of Android .What i have found that other app is having the same problem of Resource Not Found which was not existing before using android app bundle . Is there some problem in library or code or it is because of beta version of Android app bundle ?

我还发现了因为崩溃导致的资源抽取: -

I have also found the resource drawable due to which it crashes:-

我认为这个问题也与此相关: -
错误膨胀类android.support.design.widget.NavigationView在Android App Bundle中添加SwitchCompat后

I think this Question is Also Related to this:- Error inflating class android.support.design.widget.NavigationView after adding SwitchCompat in Android App Bundle

推荐答案

这几乎可以肯定是用户共享(侧载)应用程序P2P共享程序,或将APK上传到网络,然后其他用户从网上下载和安装。

This is almost certainly users sharing (sideloading) the app, either via P2P sharing programs, or uploading the APK to the web then other users downloading and installing from the web.

人们习惯于处理非Android App Bundle应用程序只需转移和共享主APK。但是你的App捆绑应用程序有很多拆分APK用于资源等事情,这就是节省大小的方式。您可以在帮助页面上阅读有关此过程的所有信息。如果用户在未安装正确拆分APK的情况下安装主APK,则在应用首次尝试加载资源时会发生未找到资源崩溃。

People used to dealing with non Android App Bundle apps just transfer and share the main APK. But your App bundle app has lots of "split APKs" for things like the resources, that is how the size saving happens. You can read all about this process on the help page. If a user installs the main APK without installing the right split APKs, then a "Resources Not found" crash will occur the first time the app tries to load a resource.

如果您想支持用户侧载您的应用程序而只支持主APK,您可以尝试检测此情况并向用户显示一条消息(不使用任何资源),并显示请从Google Play安装。或者你可以决定你不会支持以这种方式共享APK的用户。

If you want to support users sideloading your app and just the main APK you could try to detect this situation and display a message to the user (without using any resources) that says "Please install from Google Play". Or you could just decide you aren't going to support users who share APKs in this way.

我怀疑从长远来看网站和P2P共享程序会变得更好正确地分享这样的APK,所以我不会花太多时间担心它。

I suspect in the long run the websites and P2P sharing programs will get better at sharing such APKs properly, so I wouldn't spend too long worrying about it.

如果你在较低的Android版本上看到这种情况发生得更频繁,那么这不是可能是由于较低的Android版本中的错误。相反,可能是因为在用户通常P2P共享应用程序的国家(例如印度),用户也更有可能使用旧版手机。

If you see this happening far more frequently on lower Android versions, this isn't probably due to a bug in lower Android versions. Instead, it is probably because in countries where users commonly P2P share apps (eg India) users also are far more likely to be on older version phones.

这篇关于Android App Bundle在Android应用中引入了资源未找到崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆