gpt4 book ai didi

android - 无法实例化自定义 View 充气器 android.support.v7.app.AppCompatViewInflater

转载 作者:行者123 更新时间:2023-12-03 02:45:51 24 4
gpt4 key购买 nike

我正在尝试在我的应用程序上实现 Google 登录。

它工作正常,但是当我尝试登录时,我的 logcat 上出现以下错误:

2018-10-04 14:55:14.784 16313-16313/? I/AppCompatDelegate: Failed to instantiate custom view inflater android.support.v7.app.AppCompatViewInflater. Falling back to default. java.lang.ClassNotFoundException: android.support.v7.app.AppCompatViewInflater at java.lang.Class.classForName(Native Method) at java.lang.Class.forName(Class.java:453) at java.lang.Class.forName(Class.java:378) at android.support.v7.app.AppCompatDelegateImpl.a(:com.google.android.gms@13280019@13.2.80 (040400-211705629):1) at android.support.v7.app.AppCompatDelegateImpl.onCreateView(:com.google.android.gms@13280019@13.2.80 (040400-211705629):1) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:772) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730) at android.view.LayoutInflater.inflate(LayoutInflater.java:492) at android.view.LayoutInflater.inflate(LayoutInflater.java:423) at android.view.LayoutInflater.inflate(LayoutInflater.java:374) at com.android.internal.policy.DecorView.onResourcesLoaded(DecorView.java:1933) at com.android.internal.policy.PhoneWindow.generateLayout(PhoneWindow.java:2586) at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:2659) at com.android.internal.policy.PhoneWindow.getDecorView(PhoneWindow.java:2067) at android.app.ActivityTransitionState.setEnterActivityOptions(ActivityTransitionState.java:160) at android.app.Activity.performCreate(Activity.java:7016) at android.app.Activity.performCreate(Activity.java:7000) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856) at android.app.ActivityThread.-wrap11(Unknown Source:0) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6494) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.app.AppCompatViewInflater" on path: DexPathList[[zip file "/system/framework/com.android.media.remotedisplay.jar", zip file "/system/framework/com.android.location.provider.jar", zip file "/data/app/com.google.android.gms-mJ0x6f9TEv9BnQUq-xGhTw==/base.apk"],nativeLibraryDirectories=[/data/app/com.google.android.gms-mJ0x6f9TEv9BnQUq-xGhTw==/lib/arm64, /data/app/com.google.android.gms-mJ0x6f9TEv9BnQUq-xGhTw==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125) at java.lang.ClassLoader.loadClass(ClassLoader.java:379) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at java.lang.Class.classForName(Native Method)  at java.lang.Class.forName(Class.java:453)  at java.lang.Class.forName(Class.java:378)  at android.support.v7.app.AppCompatDelegateImpl.a(:com.google.android.gms@13280019@13.2.80 (040400-211705629):1)  at android.support.v7.app.AppCompatDelegateImpl.onCreateView(:com.google.android.gms@13280019@13.2.80 (040400-211705629):1)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:772)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)  at android.view.LayoutInflater.inflate(LayoutInflater.java:492)  at android.view.LayoutInflater.inflate(LayoutInflater.java:423)  at android.view.LayoutInflater.inflate(LayoutInflater.java:374)  at com.android.internal.policy.DecorView.onResourcesLoaded(DecorView.java:1933)  at com.android.internal.policy.PhoneWindow.generateLayout(PhoneWindow.java:2586)  at com.android.internal.policy.PhoneWindow.installDecor(PhoneWindow.java:2659)  at com.android.internal.policy.PhoneWindow.getDecorView(PhoneWindow.java:2067)  at android.app.ActivityTransitionState.setEnterActivityOptions(ActivityTransitionState.java:160)  at android.app.Activity.performCreate(Activity.java:7016)  at android.app.Activity.performCreate(Activity.java:7000)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)  at android.app.ActivityThread.-wrap11(Unknown Source:0)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:164)  at android.app.ActivityThread.main(ActivityThread.java:6494)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 



我正在使用新的 AndroidX 库,并且实现了以下依赖项:
implementation 'androidx.appcompat:appcompat:1.0.0'

我还更改了 gradle.properties 让 Android 知道我正在使用新的 AndroidX 库:
# Default properties
org.gradle.jvmargs=-Xmx1536m

# Android X properties
android.useAndroidX=true
android.enableJetifier=true

通过修改 gradle.properties 所有其他依赖项都应该使用新的 AndroidX 库对吗?为什么要尝试使用旧的 V7 库?我应该如何解决这个问题?

编辑

这是我的毕业典礼:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'

defaultConfig {
applicationId 'my.package.name'

versionName '1.0.0'
versionCode 1

minSdkVersion 16
targetSdkVersion 28

multiDexEnabled true
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'

implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.multidex:multidex:2.0.0'

implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.2.71'
}

最佳答案

我不认为来自 logcat 的上述堆栈跟踪是您面临的实际问题,因为问题是信息(I)类型而不是错误。我认为您可能还缺少其他一些错误。尝试使用adb -d logcat -s <ClassNameWhichCanThrowError>查看实际错误或深入挖掘 logcat 以了解 E/ClassNameWhichCanThrowError 类型的任何错误

关于android - 无法实例化自定义 View 充气器 android.support.v7.app.AppCompatViewInflater,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52650046/

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