Closed zohaib1313 closed 1 year ago
这是来自QQ邮箱的自动回复邮件。 您好,您的邮件我已收到。
Agent comment from yating.liao in Zendesk ticket #89501:
I think you can try the latest version of MSDK V4. Here is the repository address and release notes.:https://github.com/dji-sdk/Mobile-SDK-Android/tree/sdk_releases/4.17-alpha
We have made this version compatible with Android 13.
°°°
@dji-dev it still gives the same error.
Agent comment from yating.liao in Zendesk ticket #89501:
Based on the configuration file you provided, the targetSdkVersion is set to 31, which corresponds to Android 12. Have you made any modifications to this information?
If you have made modifications but are still experiencing the same issue, could you provide us with a minimal project that reproduces this problem reliably?
°°°
I have tested with targetSdkVersion to 33 , but the class not found exception is there still, i have tried upgrading the dji mobile sdk also, but no luck.
I am trying to use this sdk in flutter application where i have created own custom plugin, which works fine below android 13.
Agent comment from yating.liao in Zendesk ticket #89501:
We have not tested with Flutter, but we have tested the samples of MSDK 5.5 or 4.17-a1 on an Android 13 device and did not encounter the same issue. Would you experience the same problem when running the sample on the same device?
°°°
No , native app works but in flutter it doesnot load ,ndk libraries on android 13 only. i.e Helper.install does not work on andorid13 flutter.
Hey @zohaib1313 I'm also working on it per the issue you opened on the DJI Flutter Package project: https://github.com/DragonX-cloud/dji_flutter_plugin/issues/22
Trying the Alpha version.
Hey @zohaib1313
Alpha version didn’t resolve it. it’s something else. I’ll update soon.
Hey @zohaib1313
I got it to work on Android 13.
I'll post a new branch on the dji_flutter_plugin
repo soon so you may test too.
Hey @zohaib1313 I've posted my update with details here: https://github.com/DragonX-cloud/dji_flutter_plugin/issues/22
Hey @dji-dev Please note I could only get it to run with targetSdk 31. But with 33 it doesn't work (I'm referring specifically to the "Register" functionality as a start):
DJISDKManager.getInstance().registerApp(djiPluginContext, object: SDKManagerCallback {
...
})
Note: I'm using the 4.17-a1
SDK version.
You can find an example project in the DJI Flutter Plugin repo: https://github.com/DragonX-cloud/dji_flutter_plugin
The specific Android Example project is here: https://github.com/DragonX-cloud/dji_flutter_plugin/tree/main/example/android
Agent comment from yating.liao in Zendesk ticket #89501:
It seems like the issue has been resolved, is that correct?
°°°
Hi @dji-dev Actually, it is not :)
Although we can target SDK 31 - we need to be able to compile with the latest stable of Android SDK which is 33.
Agent comment from yating.liao in Zendesk ticket #89501:
Actually, the sample of 4.17-a1 runs fine when the targetSDKVersion is set to 33. Have you identified the possible cause of this issue?
°°°
@dji-dev @orenagiv issue is related to ndk libraries not being load in Android13+ when using as a plugin for flutter, i figured out if I call Helper.install which actually loads ndk libraries in Flutter activity then it gives class not found exception, but if I call this method in FlutterApplication then it works fine.(have tested a flight too).
This will work:
class MyClass : FlutterApplication() { override fun onCreate() { super.onCreate() MultiDex.install(this) com.secneo.sdk.Helper.install(this) } }
Thanks @zohaib1313 ! Did you use the latest Flutter Plugin version? And also updated the targetSdk to 33 in both the build.gradle of the Example App as well as the plugin itself?
If you can create a pull request with your changes on the Flutter plugin - that would be great! 🙂
Agent comment from yating.liao in Zendesk ticket #89501:
com.secneo.sdk.Helper.install(this) is indeed the key to using MSDK. Thank you for the information provided by zohaib1313.
°°°
<<PlatformException(java.lang.NoClassDefFoundError: Failed resolution of: Ldji/sdk/sdkmanager/DJISDKManager$SDKManagerCallback;, NoClassDefFoundError, Cause: java.lang.ClassNotFoundException>>
I am facing issue in flutter application where , i have integrated dji mobile sdk "[sdk_releases/4.16.4]".
same code works on all devices from android version 9 to android version 12, but in android 13 facing class not found exception. also using the same progurad rule file as in sample app.
??????????????????????????? below is my build.gradle file ???????????????????????????
group 'com.agrilift.dji.dji_agrilift_plugin' version "1.0-SNAPSHOT" buildscript { ext.kotlin_version = "1.7.0" repositories { google() mavenCentral() }
}
rootProject.allprojects { repositories { google() mavenCentral() } }
apply plugin: "com.android.library" apply plugin: "kotlin-android" apply plugin: "kotlinx-serialization"
android { compileSdkVersion 31 useLibrary "org.apache.http.legacy"
}
dependencies { implementation('com.dji:dji-sdk:4.16.4', { /**
Both will greatly reducing the size of the APK. */ exclude module: 'library-anti-distortion' // exclude module: 'fly-safe-database' }) compileOnly 'com.dji:dji-sdk-provided:4.16.4'
implementation 'androidx.appcompat:appcompat:1.4.1' implementation 'com.google.android.material:material:1.6.0' implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.0" implementation "androidx.annotation:annotation:1.5.0"
// Kotlin Coroutines implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.2"
// Ktx implementation "androidx.activity:activity-ktx:1.6.1" implementation "androidx.core:core-ktx:1.9.0" implementation "androidx.fragment:fragment-ktx:1.5.4" implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.5.1" implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1" implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.5.1" implementation "androidx.lifecycle:lifecycle-process:2.5.1"
// Lifecycle, LiveData, ViewModel implementation "androidx.recyclerview:recyclerview:1.2.1" implementation "androidx.lifecycle:lifecycle-extensions:2.2.0" implementation "androidx.lifecycle:lifecycle-common-java8:2.5.1"
// ButterKnife implementation "com.jakewharton:butterknife:10.0.0" annotationProcessor "com.jakewharton:butterknife-compiler:10.0.0"
// Testing androidTestImplementation "androidx.test.ext:junit:1.1.4" androidTestImplementation "androidx.test.espresso:espresso-core:3.5.0"
implementation "com.squareup:otto:1.3.8" }
///////stack trace/////
2023-08-21 20:27:15.666 30773-30847 flutter com.agriliftuser.app I Interceptor: PlatformException(java.lang.NoClassDefFoundError: Failed resolution of: Ldji/sdk/sdkmanager/DJISDKManager$SDKManagerCallback;, NoClassDefFoundError, Cause: java.lang.ClassNotFoundException: Didn't find class "dji.sdk.sdkmanager.DJISDKManager$SDKManagerCallback" on path: DexPathList[[zip file "/data/app/
nPwV3_GUw5_n2PYIfH_f1Q==/com.agriliftuser.app-l-SqInxdycJbNMVoUtqjsg==/base.apk"],nativeLibraryDirectories=[/data/app/nPwV3_GUw5_n2PYIfH_f1Q==/com.agriliftuser.app-l-SqInxdycJbNMVoUtqjsg==/lib/arm64, /data/app/~~nPwV3_GUw5_n2PYIfH_f1Q==/com.agriliftuser.app-l-SqInxdycJbNMVoUtqjsg==/base.apk!/lib/arm64-v8a, /system/lib64, /system/system_ext/lib64]], Stacktrace: java.lang.NoClassDefFoundError: Failed resolution of: Ldji/sdk/sdkmanager/DJISDKManager$SDKManagerCallback; 2023-08-21 20:27:15.666 30773-30847 flutter com.agriliftuser.app I Interceptor: at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:39) 2023-08-21 20:27:15.666 30773-30847 flutter com.agriliftuser.app I Interceptor: at java.lang.reflect.Method.invoke(Native Method) 2023-08-21 20:27:15.666 30773-30847 flutter com.agriliftuser.app I Interceptor: at io.flutter.embedding.engine.plugins.util.GeneratedPluginRegister.registerGeneratedPlugins(GeneratedPluginRegister.java:80) 2023-08-21 20:27:15.666 30773-30847 flutter com.agriliftuser.app I Interceptor: at io.flutter.embedding.android.FlutterActivity.configureFlutterEngine(FlutterActivity.java:1133) 2023-08-21 20:27:15.666 30773-30847 flutter com.agriliftuser.app I Interceptor: at com.agriliftuser.app.MainActivity.configureFlutterEngine(MainActivity.kt:26) 2023-08-21 20:27:15.666 30773-30847 flutter com.agriliftuser.app I Interceptor: at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(FlutterActivityAndFragmentDelegate.java:206) 2023-08-21 20:27:15.666 30773-30847 flutter com.agriliftuser.app I Interceptor: at io.flutter.embedding.android.FlutterActivity.onCreate(FlutterActivity.java:495) 2023-08-21 20:27:15.666 30773-30847 flutter com.agriliftuser.app I Interceptor: at android.app.Activity.performCreate(Activity.java:8591) 2023-08-21 20:27:15.666 30773-30847 flutter com.agriliftuser.app I Interceptor: at android.app.Activity.performCreate(Activity.java:8570) 2023-08-21 20:27:15.666 30773-30847 flutter com.agriliftuser.app I Interceptor: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1384) 2023-08-21 20:27:15.666 30773-30847 flutter com.agriliftuser.app I Interceptor: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4150) 2023-08-21 20:27:15.666 30773-30847 flutter com.agriliftuser.app I Interceptor: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4325) 2023-08-21 20:27:15.667 30773-30847 flutter com.agriliftuser.app I Interceptor: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101) 2023-08-21 20:27:15.667 30773-30847 flutter com.agriliftuser.app I Interceptor: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) 2023-08-21 20:27:15.667 30773-30847 flutter com.agriliftuser.app I Interceptor: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) 2023-08-21 20:27:15.667 30773-30847 flutter com.agriliftuser.app I Interceptor: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2574) 2023-08-21 20:27:15.667 30773-30847 flutter com.agriliftuser.app I Interceptor: at android.os.Handler.dispatchMessage(Handler.java:106) 2023-08-21 20:27:15.667 30773-30847 flutter com.agriliftuser.app I Interceptor: at android.os.Looper.loopOnce(Looper.java:226) 2023-08-21 20:27:15.667 30773-30847 flutter com.agriliftuser.app I Interceptor: at android.os.Looper.loop(Looper.java:313) 2023-08-21 20:27:15.667 30773-30847 flutter com.agriliftuser.app I Interceptor: at android.app.ActivityThread.main(ActivityThread.java:8757) 2023-08-21 20:27:15.667 30773-30847 flutter com.agriliftuser.app I Interceptor: at java.lang.reflect.Method.invoke(Native Method) 2023-08-21 20:27:15.667 30773-30847 flutter com.agriliftuser.app I Interceptor: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571) 2023-08-21 20:27:15.667 30773-30847 flutter com.agriliftuser.app I Interceptor: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067) 2023-08-21 20:27:15.667 30773-30847 flutter com.agriliftuser.app I Interceptor: Caused by: java.lang.ClassNotFoundException: Didn't find class "dji.sdk.sdkmanager.DJISDKManager$SDKManagerCallback" on path: DexPathList[[zip file "/data/app/nPwV3_GUw5_n2PYIfH_f1Q==/com.agriliftuser.app-l-SqInxdycJbNMVoUtqjsg==/base.apk"],nativeLibraryDirectories=[/data/app/nPwV3_GUw5_n2PYIfH_f1Q==/com.agriliftuser.app-l-SqInxdycJbNMVoUtqjsg==/lib/arm64, /data/app/~~nPwV3_GUw5_n2PYIfH_f1Q==/com.agriliftuser.app-l-SqInxdycJbNMVoUtqjsg==/base.apk!/lib/arm64-v8a, /system/lib64, /system/system_ext/lib64]] 2023-08-21 20:27:15.667 30773-30847 flutter com.agriliftuser.app I Interceptor: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259) 2023-08-21 20:27:15.667 30773-30847 flutter com.agriliftuser.app I Interceptor: at java.lang.ClassLoader.loadClass(ClassLoader.java:379) 2023-08-21 20:27:15.667 30773-30847 flutter com.agriliftuser.app I Interceptor: at java.lang.ClassLoader.loadClass(ClassLoader.java:312)