dji-sdk / Mobile-UXSDK-Beta-Android

Mobile Android UXSDK Beta
MIT License
96 stars 55 forks source link

ClassNotFoundException: Didn't find class "dji.log.DJILog" #72

Open vancuong0429 opened 1 year ago

vancuong0429 commented 1 year ago

I have created custom UXKeys, When I run with proguard, It crashes when calling UXKeys.addNewKeyClass(CustomKeys::class.java) My code in application:

override fun onCreate() {
        super.onCreate()
        GlobalPreferencesManager.initialize(AppGlobalPreferences(this))
        UXKeys.addNewKeyClass(CustomKeys::class.java)
  }

I set up multiDexEnabled, My version:

implementation ('com.dji:dji-sdk:4.16.1')
compileOnly ('com.dji:dji-sdk-provided:4.16.1')
implementation 'com.github.dji-sdk:Mobile-UXSDK-Beta-Android:v0.5.1'

My log error: Fatal Exception: java.lang.NoClassDefFoundError: Failed resolution of: Ldji/log/DJILog; at dji.ux.beta.core.communication.UXKeys.initializeKeyValueTypes(UXKeys.java:67) at dji.ux.beta.core.communication.UXKeys.addNewKeyClass(UXKeys.java:79) at com.abc.djidrone.MyApplication.onCreate(MyApplication.kt:88) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1126) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6097) at android.app.ActivityThread.-wrap1(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1791) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:7000) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)