캐시 무효화, 프로젝트 정리, 앱 재설치를 이미 시도했습니다. 데이터 바인딩을 사용하지 않습니다.
Realm 플러그인을 사용하고 있습니다 io.realm:realm-gradle-plugin:5.3.1
관련 정보는 다음과 같습니다 build.gradle
.
compileSdkVersion 29
buildToolsVersion 29.0.3
implementation "androidx.appcompat:appcompat:1.1.0"
안드로이드 Gradle 플러그인 : 3.6.0
Gradle : 5.6.4
이것은 로그입니다.
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/appcompat/R$drawable;
at androidx.appcompat.widget.AppCompatDrawableManager$1.<init>(AppCompatDrawableManager.java:63)
at androidx.appcompat.widget.AppCompatDrawableManager.preload(AppCompatDrawableManager.java:57)
at androidx.appcompat.app.AppCompatDelegateImpl.<init>(AppCompatDelegateImpl.java:328)
at androidx.appcompat.app.AppCompatDelegateImpl.<init>(AppCompatDelegateImpl.java:278)
at androidx.appcompat.app.AppCompatDelegate.create(AppCompatDelegate.java:221)
at androidx.appcompat.app.AppCompatActivity.getDelegate(AppCompatActivity.java:543)
at androidx.appcompat.app.AppCompatActivity.attachBaseContext(AppCompatActivity.java:98)
at android.app.Activity.attach(Activity.java:6909)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2759)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2904)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1596)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6600)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:772)
Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.appcompat.R$drawable" on path: DexPathList[[zip file "/data/app/com.develop-dkwyyr2-QVmFBqzVHNDZtQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.develop-dkwyyr2-QVmFBqzVHNDZtQ==/lib/arm64, /data/app/com.develop-dkwyyr2-QVmFBqzVHNDZtQ==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at androidx.appcompat.widget.AppCompatDrawableManager$1.<init>(AppCompatDrawableManager.java:63)
at androidx.appcompat.widget.AppCompatDrawableManager.preload(AppCompatDrawableManager.java:57)
at androidx.appcompat.app.AppCompatDelegateImpl.<init>(AppCompatDelegateImpl.java:328)
at androidx.appcompat.app.AppCompatDelegateImpl.<init>(AppCompatDelegateImpl.java:278)
at androidx.appcompat.app.AppCompatDelegate.create(AppCompatDelegate.java:221)
at androidx.appcompat.app.AppCompatActivity.getDelegate(AppCompatActivity.java:543)
at androidx.appcompat.app.AppCompatActivity.attachBaseContext(AppCompatActivity.java:98)
at android.app.Activity.attach(Activity.java:6909)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2759)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2904)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1596)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6600)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:772)
답변
프로젝트에서 Realm을 사용하고 있습니까? 이 문제를 발견했기 때문에 Realm 종속성을 최신 안정 버전으로 업그레이드하여 동일한 문제가 발생하여 문제를 해결했습니다 .
build.gradle (Project)에서 :
dependencies {
classpath 'io.realm:realm-gradle-plugin:6.0.2'
}
그 후, 나는 프로젝트를 청소하고 재건했다.