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

dji class not found: java.lang.ClassNotFoundException: dji.event3.sharelib.DJIEventBusIndex #2

Open
happyriver2018 opened this issue Sep 20, 2018 · 0 comments

Comments

@happyriver2018
Copy link

Is this issue about bugs or crash issues of the Sample Code?

Yep, then please delete this template and provide the following infos for us to help investigate the issue:

  • Description of the issue: classes not found
  • Steps to reproduce the bug or crash issues(It would be great if you can provide this): compile and run
  • Crash logs: see below
  • DJI Android SDK version you are using: gradle file attached
  • DJI Product you are using (Like Phantom 4, Mavic Pro, etc)
  • Android system version you are using (Like Android 6.0.1, Android 5.1.1, etc): android 5.0.1
  • Android device you are using (Like Samsung Galaxy Note 5, Nexus 5, etc): htc one m7
  • Android Studio version you are using (Like Android Studio 2.2, etc): 3.1.4

Here is the Gradle file:

apply plugin: 'com.android.application'

android {
compileSdkVersion 27

defaultConfig {

    ndk {
        abiFilters 'armeabi-v7a'
    }

    applicationId "com.dji.activationDemo"
    minSdkVersion 18
    targetSdkVersion 27
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}


buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

packagingOptions {
    exclude 'META-INF/rxjava.properties'
}

packagingOptions{
    doNotStrip "*/*/libdjivideo.so"
    doNotStrip "*/*/libSDKRelativeJNI.so"
    doNotStrip "*/*/libFlyForbid.so"
    doNotStrip "*/*/libduml_vision_bokeh.so"
    doNotStrip "*/*/libyuv2.so"
    doNotStrip "*/*/libGroudStation.so"
    doNotStrip "*/*/libFRCorkscrew.so"
    doNotStrip "*/*/libUpgradeVerify.so"
    doNotStrip "*/*/libFR.so"
}

}

ext {
supportLibVersion = '27.1.1' // variable that can be referenced to keep support libs consistent
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "com.android.support:support-v4:${supportLibVersion}"
implementation "com.android.support:recyclerview-v7:${supportLibVersion}"
implementation "com.android.support:appcompat-v7:${supportLibVersion}"
implementation "com.android.support:design:${supportLibVersion}"

implementation 'com.android.support:multidex:1.0.3'
implementation ('com.dji:dji-sdk:4.6')
compileOnly ('com.dji:dji-sdk-provided:4.6')

implementation 'com.android.support.constraint:constraint-layout:1.1.3'

}

Here is the manifest file: (note the following:

<!-- DJI SDK need permission -->
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />

<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-feature
    android:name="android.hardware.usb.host"
    android:required="false" />
<uses-feature
    android:name="android.future.usb.accessory"
    android:required="true" />

<!-- SDK requirement permission end -->
<application
    android:name=".MApplication"
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

    <!-- DJI SDK -->
    <uses-library android:name="com.android.future.usb.accessory" />

    <meta-data
        android:name="com.dji.sdk.API_KEY"
        android:value="179757b189600a319aefbc0c" />

    <activity
        android:name="dji.sdk.sdkmanager.DJIAoaControllerActivity"
        android:theme="@android:style/Theme.Translucent">
        <intent-filter>
            <action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" />
        </intent-filter>

        <meta-data
            android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"
            android:resource="@xml/accessory_filter" />
    </activity>

    <service android:name="dji.sdk.sdkmanager.DJIGlobalService"></service>
    <!-- DJI SDK -->

    <activity android:name=".ConnectionActivity"
        android:configChanges="orientation"
        android:screenOrientation="portrait">

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name=".MainActivity"
        android:screenOrientation="portrait" />

</application>

Here is the run log:

E/DJISDKManager: can't find DJIEventBusIndex Class in SharedLib module
java.lang.ClassNotFoundException: dji.event3.sharelib.DJIEventBusIndex
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:308)
at java.lang.Class.forName(Class.java:272)
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source)
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source)
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.ClassNotFoundException: Didn't find class "dji.event3.sharelib.DJIEventBusIndex" on path: DexPathList[[zip file "/system/framework/com.android.future.usb.accessory.jar", zip file "/data/app/com.dji.activationDemo-1/base.apk", zip file "/data/data/com.dji.activationDemo/.cache_sdk/sdkclasses.jar"],nativeLibraryDirectories=[/data/app/com.dji.activationDemo-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 java.lang.Class.classForName(Native Method) 
at java.lang.Class.forName(Class.java:308) 
at java.lang.Class.forName(Class.java:272) 
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source) 
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source) 
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source) 
at java.lang.Thread.run(Thread.java:818) 
Suppressed: java.lang.ClassNotFoundException: dji.event3.sharelib.DJIEventBusIndex
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)
... 8 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
can't find DJIEventBusIndex Class in MidWare module
java.lang.ClassNotFoundException: dji.event3.midware.DJIEventBusIndex
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:308)
at java.lang.Class.forName(Class.java:272)
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source)
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source)
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.ClassNotFoundException: Didn't find class "dji.event3.midware.DJIEventBusIndex" on path: DexPathList[[zip file "/system/framework/com.android.future.usb.accessory.jar", zip file "/data/app/com.dji.activationDemo-1/base.apk", zip file "/data/data/com.dji.activationDemo/.cache_sdk/sdkclasses.jar"],nativeLibraryDirectories=[/data/app/com.dji.activationDemo-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 java.lang.Class.classForName(Native Method) 
at java.lang.Class.forName(Class.java:308) 
at java.lang.Class.forName(Class.java:272) 
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source) 
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source) 
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source) 
at java.lang.Thread.run(Thread.java:818) 
Suppressed: java.lang.ClassNotFoundException: dji.event3.midware.DJIEventBusIndex
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)
... 8 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
can't find DJIEventBusIndex Class in FlyForbid module
java.lang.ClassNotFoundException: dji.event3.flyforbid.DJIEventBusIndex
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:308)
at java.lang.Class.forName(Class.java:272)
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source)
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source)
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.ClassNotFoundException: Didn't find class "dji.event3.flyforbid.DJIEventBusIndex" on path: DexPathList[[zip file "/system/framework/com.android.future.usb.accessory.jar", zip file "/data/app/com.dji.activationDemo-1/base.apk", zip file "/data/data/com.dji.activationDemo/.cache_sdk/sdkclasses.jar"],nativeLibraryDirectories=[/data/app/com.dji.activationDemo-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 java.lang.Class.classForName(Native Method) 
at java.lang.Class.forName(Class.java:308) 
at java.lang.Class.forName(Class.java:272) 
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source) 
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source) 
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source) 
at java.lang.Thread.run(Thread.java:818) 
Suppressed: java.lang.ClassNotFoundException: dji.event3.flyforbid.DJIEventBusIndex
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)
... 8 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
can't find DJIEventBusIndex Class in service module
java.lang.ClassNotFoundException: dji.event3.service.DJIEventBusIndex
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:308)
at java.lang.Class.forName(Class.java:272)
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source)
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source)
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.ClassNotFoundException: Didn't find class "dji.event3.service.DJIEventBusIndex" on path: DexPathList[[zip file "/system/framework/com.android.future.usb.accessory.jar", zip file "/data/app/com.dji.activationDemo-1/base.apk", zip file "/data/data/com.dji.activationDemo/.cache_sdk/sdkclasses.jar"],nativeLibraryDirectories=[/data/app/com.dji.activationDemo-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 java.lang.Class.classForName(Native Method) 
at java.lang.Class.forName(Class.java:308) 
at java.lang.Class.forName(Class.java:272) 
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source) 
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source) 
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source) 
at java.lang.Thread.run(Thread.java:818) 
Suppressed: java.lang.ClassNotFoundException: dji.event3.service.DJIEventBusIndex
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)
... 8 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
can't find DJIEventBusIndex Class in FrLib module
java.lang.ClassNotFoundException: com.dji.frlib.DJIEventBusIndex
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:308)
at java.lang.Class.forName(Class.java:272)
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source)
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source)
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.dji.frlib.DJIEventBusIndex" on path: DexPathList[[zip file "/system/framework/com.android.future.usb.accessory.jar", zip file "/data/app/com.dji.activationDemo-1/base.apk", zip file "/data/data/com.dji.activationDemo/.cache_sdk/sdkclasses.jar"],nativeLibraryDirectories=[/data/app/com.dji.activationDemo-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 java.lang.Class.classForName(Native Method) 
at java.lang.Class.forName(Class.java:308) 
at java.lang.Class.forName(Class.java:272) 
at dji.sdk.sdkmanager.DJISDKManager.initSDKManager(Unknown Source) 
at dji.sdk.sdkmanager.DJISDKManager.access$1100(Unknown Source) 
at dji.sdk.sdkmanager.DJISDKManager$5.run(Unknown Source) 
at java.lang.Thread.run(Thread.java:818) 
Suppressed: java.lang.ClassNotFoundException: com.dji.frlib.DJIEventBusIndex
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)
... 8 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant