Android-DirectoryChooser: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/gu/option/Option;

When using compile 'net.rdrei.android.dirchooser:library:3.2@aar', I get the following error:

04-09 22:50:20.638 11862 11862 E AndroidRuntime: Process: <>, PID: 11862
04-09 22:50:20.638 11862 11862 E AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/gu/option/Option;
04-09 22:50:20.638 11862 11862 E AndroidRuntime:    at net.rdrei.android.dirchooser.DirectoryChooserFragment.<init>(DirectoryChooserFragment.java:61)
04-09 22:50:20.638 11862 11862 E AndroidRuntime:    at net.rdrei.android.dirchooser.DirectoryChooserFragment.newInstance(DirectoryChooserFragment.java:91)
04-09 22:50:20.638 11862 11862 E AndroidRuntime:    at net.rdrei.android.dirchooser.DirectoryChooserActivity.onCreate(DirectoryChooserActivity.java:38)
04-09 22:50:20.638 11862 11862 E AndroidRuntime:    at android.app.Activity.performCreate(Activity.java:6570)
04-09 22:50:20.638 11862 11862 E AndroidRuntime:    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
04-09 22:50:20.638 11862 11862 E AndroidRuntime:    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2534)
04-09 22:50:20.638 11862 11862 E AndroidRuntime:    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2641)
04-09 22:50:20.638 11862 11862 E AndroidRuntime:    at android.app.ActivityThread.-wrap12(ActivityThread.java)
04-09 22:50:20.638 11862 11862 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1398)
04-09 22:50:20.638 11862 11862 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:102)
04-09 22:50:20.638 11862 11862 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:148)
04-09 22:50:20.638 11862 11862 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:5849)
04-09 22:50:20.638 11862 11862 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
04-09 22:50:20.638 11862 11862 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:763)
04-09 22:50:20.638 11862 11862 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:653)
04-09 22:50:20.638 11862 11862 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.gu.option.Option" on path: DexPathList[[zip file "/data/app/<>-2/base.apk"],nativeLibraryDirectories=[/data/app/<>-2/lib/arm, /system/lib, /vendor/lib]]
04-09 22:50:20.638 11862 11862 E AndroidRuntime:    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:94)
04-09 22:50:20.638 11862 11862 E AndroidRuntime:    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
04-09 22:50:20.638 11862 11862 E AndroidRuntime:    at java.lang.ClassLoader.loadClass(ClassLoader.java:311)
04-09 22:50:20.638 11862 11862 E AndroidRuntime:    ... 15 more
04-09 22:50:20.641 23023 23744 W ActivityManager:   Force finishing activity <>/net.rdrei.android.dirchooser.DirectoryChooserActivity

I have to use compile 'net.rdrei.android.dirchooser:library:3.2 instead.

About this issue

  • Original URL
  • State: open
  • Created 8 years ago
  • Reactions: 3
  • Comments: 18 (4 by maintainers)

Most upvoted comments

I am too experiencing this issue. Seems like this issue has repeated, follow this answer in an older issue to resolve this issue -

https://github.com/passy/Android-DirectoryChooser/issues/65#issuecomment-202602924

Just make sure that you are adding repository URL to your top level gradle file’s “allprojects” part.

Copying the comment @rohannexialabs referred to:

repositories {
    maven { url 'http://guardian.github.com/maven/repo-releases' }
}

dependencies {
    compile 'com.gu:option:1.3'
    compile 'net.rdrei.android.dirchooser:library:3.2@aar'
}

This fixed it for me.

Why rely on this then? Can you use either another library or no library?

On Jul 26, 2017 10:22 AM, “Pascal Hartig” notifications@github.com wrote:

No update from my end. Until the guardian decides to publish this library elsewhere or someone ports this to another compatible library we’ll probably be stuck with the manual declaration.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/passy/Android-DirectoryChooser/issues/86#issuecomment-318123504, or mute the thread https://github.com/notifications/unsubscribe-auth/ABqMSLq_k7E2qmtQU5vBEC_hULxw3MANks5sR3XsgaJpZM4IDxzi .