CreativeSDK / phonegap-plugin-csdk-image-editor

A PhoneGap plugin for the Creative SDK Image Editor.
Apache License 2.0
35 stars 15 forks source link

App crash on API 19 #24

Closed macdonst closed 7 years ago

macdonst commented 7 years ago

We have been experiencing an issue with API Level 19 on our Beta (using new CSDK ImageEditor) on API Level 19 (4.4.x), where it doesn't include all the files in the build.

E/AndroidRuntime( 6574): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.genericapp.app/com.genericapp.app.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.genericapp.app.MainActivity" on path: DexPathList[[zip file "/data/app/com.genericapp.app-71.apk"],nativeLibraryDirectories=[/data/app-lib/com.genericapp.app-71, /vendor/lib, /system/lib]]

We have determine this is due to the following line:

public class AdobeAuthCredentialsApp extends Application implements IAdobeAuthClientCredentials {

On API Level 19, it appears that MultiDex is not available when extending the regular Application, so we needed to change it to the following:

public class AdobeAuthCredentialsApp extends MultiDexApplication implements IAdobeAuthClientCredentials {

And everything appeared to work on my device (4.4.x and latest 7.0) without any crashes at the start.

I also had to add the following the defaultConfig in the gradle file, but Im not sure if this is required.

multiDexEnabled true
macdonst commented 7 years ago

Closing as I opened on the wrong repo.