Rav*_*ers 5 error-handling android gradle libraries androidx
我正在尝试在我的应用程序上实施 Google 登录。
它工作正常,但是当我尝试登录时,我的 logcat 出现以下错误:
2018-10-04 14:55:14.784 16313-16313/? I/AppCompatDelegate:无法实例化自定义视图 inflater android.support.v7.app.AppCompatViewInflater。回到默认状态。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) 在 android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:772) 在 android.view. (LayoutInflater.java:
我正在使用新的 AndroidX 库,并且实现了以下依赖项:
implementation 'androidx.appcompat:appcompat:1.0.0'
Run Code Online (Sandbox Code Playgroud)
我还更改了gradle.properties以让 Android 知道我正在使用新的 AndroidX 库:
# Default properties
org.gradle.jvmargs=-Xmx1536m
# Android X properties
android.useAndroidX=true
android.enableJetifier=true
Run Code Online (Sandbox Code Playgroud)
通过修改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'
}
Run Code Online (Sandbox Code Playgroud)
我不认为上面来自 logcat 的堆栈跟踪是您面临的实际问题,因为问题是信息(I)类型而不是错误。我认为您可能还遗漏了一些其他错误。尝试使用adb -d logcat -s <ClassNameWhichCanThrowError>查看实际错误或深入 logcat 查找 E/ClassNameWhichCanThrowError 类型的任何错误
| 归档时间: |
|
| 查看次数: |
1612 次 |
| 最近记录: |