gpt4 book ai didi

android - 未找到 Kitkat 及以下版本的可绘制 abc_vector_test 资源异常

转载 作者:行者123 更新时间:2023-11-29 19:11:23 24 4
gpt4 key购买 nike

这是我在 Kitkat 或以下版本上运行我的应用程序时的堆栈跟踪

FATAL EXCEPTION: main Process: com.threesixteen.app, PID: 1504 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.threesixteen.app/com.threesixteen.app.ui.activities.SplashActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x7f080058 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233) at android.app.ActivityThread.access$800(ActivityThread.java:135) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5001) 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:785) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) at dalvik.system.NativeStart.main(Native Method) Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f080058 at android.content.res.Resources.getValue(Resources.java:1123) 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.(AppCompatDelegateImplBase.java:131) at android.support.v7.app.AppCompatDelegateImplV9.(AppCompatDelegateImplV9.java:155) at android.support.v7.app.AppCompatDelegateImplV11.(AppCompatDelegateImplV11.java:31) at android.support.v7.app.AppCompatDelegateImplV14.(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.onCreate(AppCompatActivity.java:71) at com.threesixteen.app.ui.activities.BaseActivity.onCreate(BaseActivity.java:97) at com.threesixteen.app.ui.activities.SplashActivity.onCreate(SplashActivity.java:55) at android.app.Activity.performCreate(Activity.java:5231) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)  at android.app.ActivityThread.access$800(ActivityThread.java:135)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:136)  at android.app.ActivityThread.main(ActivityThread.java:5001)  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:785)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)  at dalvik.system.NativeStart.main(Native Method) 

这是我的 gradle 文件。

buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}

repositories {
jcenter()
}

dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
maven { url "https://raw.githubusercontent.com/smilefam/SendBird-SDK-Android/master/" }
}

android {
compileSdkVersion 25
buildToolsVersion "26.0.0"
defaultConfig {
resConfigs "en"
applicationId "com.threesixteen.app"
minSdkVersion 16
targetSdkVersion 25
versionCode 115
multiDexEnabled true
versionName "1.6.6.5-Debug"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
debug {
minifyEnabled false
debuggable true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
minifyEnabled false
debuggable true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
////////////////
////////////////////////////
//////////////////////////////
compile 'com.squareup.okhttp3:okhttp:3.8.0'
compile('com.twitter.sdk.android:twitter:3.0.0@aar') {
transitive = true// Contains Picasso
}
compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
transitive = true
}
compile('io.branch.sdk.android:library:2.+') {
exclude module: 'answers-shim'
}
compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.android.support:design:25.4.0'
compile 'com.google.android.gms:play-services-location:11.0.2'
compile 'com.google.android.gms:play-services-gcm:11.0.2'
compile 'com.google.android.gms:play-services-auth:11.0.2'
compile 'com.android.support:multidex:1.0.2'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.facebook.android:facebook-android-sdk:4.24.0'
compile 'com.facebook.android:account-kit-sdk:4.20.0'
compile 'com.sendbird.sdk:sendbird-android-sdk:3.0.28'
compile 'com.clevertap.android:clevertap-android-sdk:3.1.2'
compile 'com.kbeanie:image-chooser-library:1.6.0@aar'
compile 'com.isseiaoki:simplecropview:1.1.4'
compile 'com.wang.avi:library:2.1.3'
compile 'com.pkmmte.view:circularimageview:1.1'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.6.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.airbnb.android:epoxy:2.2.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

我也将这行代码放在 Activity 的开始

AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);

我也提到了这个问题,其中的问题与我的相似。 Resource not found Exception for vector drawables

问题是否与我正在使用的任何库有关?资源 ID #0x7f080058 引用 abc_vector_testR 文件中绘制。当我点击查看这个可绘制对象的源代码时,它位于 AppCompat 库中并且具有私有(private)访问权限

请建议我一些方法来摆脱这个错误。提前致谢。

最佳答案

这是一个 known issue使用 Android Studio Canary 6、alpha6 Gradle 插件和 AAPT2。切换回 aapt、alpha5,或使用 Android Studio 3.0 Canary 7 ,它解决了这个问题。

关于android - 未找到 Kitkat 及以下版本的可绘制 abc_vector_test 资源异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45205388/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com