Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.ClassNotFoundException: Didn't find class "androidx.appcompat.R$drawable" on path: DexPathList[[zip file " #6557

Closed
aymeekouakou opened this issue Jul 5, 2019 · 10 comments

Comments

@aymeekouakou
Copy link

Goal

Use Realm on my project

Project work fine without realm integration.

Actual Results

2019-07-05 16:01:56.240 2532-2532/app.duna.dunaxpay E/AndroidRuntime: FATAL EXCEPTION: main Process: app.duna.dunaxpay, PID: 2532 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:315) at androidx.appcompat.app.AppCompatDelegateImpl.<init>(AppCompatDelegateImpl.java:265) 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:7242) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3055) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3251) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1948) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7045) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965) Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.appcompat.R$drawable" on path: DexPathList[[zip file "/data/app/app.duna.dunaxpay-J7wI7w2xgDbhzmNVJIVCWQ==/base.apk"],nativeLibraryDirectories=[/data/app/app.duna.dunaxpay-J7wI7w2xgDbhzmNVJIVCWQ==/lib/arm64, /data/app/app.duna.dunaxpay-J7wI7w2xgDbhzmNVJIVCWQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134) 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:315)  at androidx.appcompat.app.AppCompatDelegateImpl.<init>(AppCompatDelegateImpl.java:265)  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:7242)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3055)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3251)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1948)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loop(Looper.java:214)  at android.app.ActivityThread.main(ActivityThread.java:7045)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965) 

Steps & Code to Reproduce

https://realm.io/docs/java/latest#installation

Version of Realm and tooling

Realm version(s): 5.12.0
Realm Sync feature enabled: No
Android Studio version: Android Studio 3.6 Canary 4
Android Build Tools version: 29.0.0
Gradle version: 5.4.1
Which Android version and device(s): minSdkVersion 22

Build #AI-191.7479.19.36.5679705, built on June 21, 2019
JRE: 1.8.0_202-release-1483-b03 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

@beeline09
Copy link

I have exactly the same problem. How did you solve it?

@willnwalker
Copy link

I have this problem as well. Not sure what's causing it, currently I'm trying to check through my dependencies to see if anything is conflicting.

@beeline09
Copy link

I have this problem as well. Not sure what's causing it, currently I'm trying to check through my dependencies to see if anything is conflicting.

I think my problem was constraintlayout, but I was tired of experimenting, so I returned to SQLite

@aymeekouakou
Copy link
Author

I have this problem as well. Not sure what's causing it, currently I'm trying to check through my dependencies to see if anything is conflicting.

I think my problem was constraintlayout, but I was tired of experimenting, so I returned to SQLite

I thank that's the best alternative... returning to SQLite... Pfffff...
Is Realm compatible to multiDex ??

@Zhuinden
Copy link
Contributor

Is Realm compatible to multiDex ??

Should be, but you should invoke Multidex.install before you call Realm.init

@willnwalker
Copy link

willnwalker commented Jul 25, 2019

I seem to have found the issue. While Multidex was enabled, it had nothing to do with my issue. I was using an Alpha version of the Android Gradle Plugin, which broke my build. I simply downgraded it to the latest stable version (3.4.2). After that, my project built successfully.

@cmelchior
Copy link
Contributor

It is probably related the same as #6531
It is due to a change in the 3.6.0 plugin.

I'll close this as a duplicate of that.

@AAChartModel
Copy link

AAChartModel commented Apr 13, 2020

I solved this problem by migrating Realm-Java version from 5.8.0 to 6.1.0 😊

@zeeshanz
Copy link

zeeshanz commented Jul 24, 2020

July 2020 - I faced the same problem when updating one of my app to api 29, i.e. compileSdkVersion 29 and androidx libraries. What worked for me was also to update the Realm. My working module level build.gradle looks like this:

    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.1'
        classpath "io.realm:realm-gradle-plugin:6.0.2"
    }

And gradle-wrapper.properties file:

distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

My Java is at 1.8, i.e. in project level build.gradle:

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

@ishaileshmishra
Copy link

ishaileshmishra commented Feb 3, 2021

  • Do the only thing, update your realm classpath

classpath 'io.realm:realm-gradle-plugin:6.1.0'

from build.gradle

compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

rohitkaradkar added a commit to rohitkaradkar/Cosmos that referenced this issue Apr 10, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants