2

For the last couple of days ive been trying to import the git project https://github.com/spacecowboy/NoNonsense-FilePicker into my app which i am developing in android studio. Unfortunately Im unable to do this because of the following error when i try to start the filePicker Activity from within my program:

12-29 20:24:41.451 18856-18856/no.trappsoft.passitory E/AndroidRuntime: FATAL EXCEPTION: main
                                                                    Process: no.trappsoft.passitory, PID: 18856
                                                                    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/nononsenseapps/filepicker/FilePickerActivity;
                                                                        at no.trappsoft.passitory.EditKeys$1.onClick(EditKeys.java:116)
                                                                        at android.view.View.performClick(View.java:5254)
                                                                        at android.widget.TextView.performClick(TextView.java:10557)
                                                                        at android.view.View$PerformClick.run(View.java:21203)
                                                                        at android.os.Handler.handleCallback(Handler.java:739)
                                                                        at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                        at android.os.Looper.loop(Looper.java:145)
                                                                        at android.app.ActivityThread.main(ActivityThread.java:6897)
                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                        at java.lang.reflect.Method.invoke(Method.java:372)
                                                                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
                                                                     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.nononsenseapps.filepicker.FilePickerActivity" on path: DexPathList[[zip file "/data/app/no.trappsoft.passitory-1/base.apk"],nativeLibraryDirectories=[/data/app/no.trappsoft.passitory-1/lib/arm, /vendor/lib, /system/lib]]
                                                                        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
                                                                        at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
                                                                        at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
                                                                        at no.trappsoft.passitory.EditKeys$1.onClick(EditKeys.java:116) 
                                                                        at android.view.View.performClick(View.java:5254) 
                                                                        at android.widget.TextView.performClick(TextView.java:10557) 
                                                                        at android.view.View$PerformClick.run(View.java:21203) 
                                                                        at android.os.Handler.handleCallback(Handler.java:739) 
                                                                        at android.os.Handler.dispatchMessage(Handler.java:95) 
                                                                        at android.os.Looper.loop(Looper.java:145) 
                                                                        at android.app.ActivityThread.main(ActivityThread.java:6897) 
                                                                        at java.lang.reflect.Method.invoke(Native Method) 
                                                                        at java.lang.reflect.Method.invoke(Method.java:372) 
                                                                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) 
                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199) 
                                                                        Suppressed: java.lang.NoClassDefFoundError: com.nononsenseapps.filepicker.FilePickerActivity
                                                                        at dalvik.system.DexFile.defineClassNative(Native Method)
                                                                        at dalvik.system.DexFile.defineClass(DexFile.java:226)
                                                                        at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)
                                                                        at dalvik.system.DexPathList.findClass(DexPathList.java:321)
                                                                        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
                                                                                ... 14 more
                                                                        Suppressed: java.lang.ClassNotFoundException: com.nononsenseapps.filepicker.FilePickerActivity
                                                                        at java.lang.Class.classForName(Native Method)
                                                                        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
                                                                        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
                                                                        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
                                                                                ... 13 more
                                                                     Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

I am incapable of solving this error. Seemingly the path to the imported filpicker library is wrong, but afaik the path is correct.

My gradle file is as follows

apply plugin: 'com.android.application'
apply plugin: 'android'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

configurations{
    all*.exclude module: 'support-v4'
}
defaultConfig {
    applicationId "no.trappsoft.passitory"
    minSdkVersion 19
    targetSdkVersion 21
    multiDexEnabled=true
}
repositories {
    jcenter()
}
buildTypes {
    release {
        minifyEnabled false
        //proguardFiles getDefaultProguardFile('proguard-android.txt'),     
'proguard-rules.txt'
    }
}
}


dependencies {
compile files('libs/android-support-v13.jar')
compile files('libs/sqlcipher-javadoc.jar')
compile files('libs/sqlcipher.jar')
compile 'com.github.clans:fab:1.6.2'
compile 'com.madgag.spongycastle:core:1.53.0.0'
compile 'com.madgag.spongycastle:prov:1.53.0.0'
compile 'com.madgag.spongycastle:pkix:1.53.0.0'
compile 'com.madgag.spongycastle:pg:1.53.0.0'
compile 'com.nononsenseapps:filepicker:2.4.2'

}

I had to add the multiDexEnabled line and configurations section to be able to compile the app with the filepicker project included. Withouth these the build process would break with other errors.

The file where the code actually breaks is on the following line in my EditKeys Activity:

Intent i = new Intent(EditKeys.this,FilePickerActivity.class);

My manifest file contains the following activity definition for the filePicker Activity:

<activity
        android:name="com.nononsenseapps.filepicker.FilePickerActivity"
        android:label="@string/app_name"
        android:theme="@style/FilePickerTheme">
        <intent-filter>
            <action android:name="android.intent.action.GET_CONTENT" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

Here is a screenshot of the external libraries and their location: FilePicker Path Problem

I am currently at a loss of what to do. T Any and all help greatly appriciated.

KennethJohansen
  • 579
  • 1
  • 4
  • 7

0 Answers0