Tap-Payments / gosellSDK-Flutter

Flutter plugin for goSellSDK
MIT License
10 stars 26 forks source link

Crashes application in release mode on Android and iOS #11

Closed aseef17 closed 2 years ago

aseef17 commented 4 years ago

Android

The SDK, when added to the Flutter project, works fine for Android on debug mode but crases the application on release mode. Following are the logs

E/FlutterLoader(20477): Flutter initialization failed.
E/FlutterLoader(20477): java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.yalladev.boilerplate-mXJG7VZCgf6MRmguV2Fo6g==/base.apk"],nativeLibraryDirectories=[/data/app/com.yalladev.boilerplate-mXJG7VZCgf6MRmguV2Fo6g==/lib/arm, /data/app/com.yalladev.boilerplate-mXJG7VZCgf6MRmguV2Fo6g==/base.apk!/lib/armeabi-v7a, /system/lib]]] couldn't find "libflutter.so"
E/FlutterLoader(20477):     at java.util.concurrent.FutureTask.report(FutureTask.java:123)
E/FlutterLoader(20477):     at java.util.concurrent.FutureTask.get(FutureTask.java:193)
E/FlutterLoader(20477):     at io.flutter.embedding.engine.loader.FlutterLoader.ensureInitializationComplete(FlutterLoader.java:193)
E/FlutterLoader(20477):     at io.flutter.embedding.engine.FlutterEngine.<init>(FlutterEngine.java:284)
E/FlutterLoader(20477):     at io.flutter.embedding.engine.FlutterEngine.<init>(FlutterEngine.java:190)
E/FlutterLoader(20477):     at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.setupFlutterEngine(FlutterActivityAndFragmentDelegate.java:233)
E/FlutterLoader(20477):     at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(FlutterActivityAndFragmentDelegate.java:153)
E/FlutterLoader(20477):     at io.flutter.embedding.android.FlutterActivity.onCreate(FlutterActivity.java:411)
E/FlutterLoader(20477):     at android.app.Activity.performCreate(Activity.java:7136)
E/FlutterLoader(20477):     at android.app.Activity.performCreate(Activity.java:7127)
E/FlutterLoader(20477):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
E/FlutterLoader(20477):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
E/FlutterLoader(20477):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
E/FlutterLoader(20477):     at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
E/FlutterLoader(20477):     at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
E/FlutterLoader(20477):     at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
E/FlutterLoader(20477):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
E/FlutterLoader(20477):     at android.os.Handler.dispatchMessage(Handler.java:106)
E/FlutterLoader(20477):     at android.os.Looper.loop(Looper.java:193)
E/FlutterLoader(20477):     at android.app.ActivityThread.main(ActivityThread.java:6669)
E/FlutterLoader(20477):     at java.lang.reflect.Method.invoke(Native Method)
E/FlutterLoader(20477):     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/FlutterLoader(20477):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
E/FlutterLoader(20477): Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.yalladev.boilerplate-mXJG7VZCgf6MRmguV2Fo6g==/base.apk"],nativeLibraryDirectories=[/data/app/com.yalladev.boilerplate-mXJG7VZCgf6MRmguV2Fo6g==/lib/arm, /data/app/com.yalladev.boilerplate-mXJG7VZCgf6MRmguV2Fo6g==/base.apk!/lib/armeabi-v7a, /system/lib]]] couldn't find "libflutter.so"
E/FlutterLoader(20477):     at java.lang.Runtime.loadLibrary0(Runtime.java:1012)
E/FlutterLoader(20477):     at java.lang.System.loadLibrary(System.java:1669)
E/FlutterLoader(20477):     at io.flutter.embedding.engine.loader.FlutterLoader$1.call(FlutterLoader.java:145)
E/FlutterLoader(20477):     at io.flutter.embedding.engine.loader.FlutterLoader$1.call(FlutterLoader.java:140)
E/FlutterLoader(20477):     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/FlutterLoader(20477):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/FlutterLoader(20477):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/FlutterLoader(20477):     at java.lang.Thread.run(Thread.java:764)
E/AndroidRuntime(20477): FATAL EXCEPTION: main
E/AndroidRuntime(20477): Process: com.yalladev.boilerplate, PID: 20477
E/AndroidRuntime(20477): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.yalladev.boilerplate/com.yalladev.boilerplate.MainActivity}: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.yalladev.boilerplate-mXJG7VZCgf6MRmguV2Fo6g==/base.apk"],nativeLibraryDirectories=[/data/app/com.yalladev.boilerplate-mXJG7VZCgf6MRmguV2Fo6g==/lib/arm, /data/app/com.yalladev.boilerplate-mXJG7VZCgf6MRmguV2Fo6g==/base.apk!/lib/armeabi-v7a, /system/lib]]] couldn't find "libflutter.so"
E/AndroidRuntime(20477):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
E/AndroidRuntime(20477):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
E/AndroidRuntime(20477):    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
E/AndroidRuntime(20477):    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
E/AndroidRuntime(20477):    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
E/AndroidRuntime(20477):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
E/AndroidRuntime(20477):    at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(20477):    at android.os.Looper.loop(Looper.java:193)
E/AndroidRuntime(20477):    at android.app.ActivityThread.main(ActivityThread.java:6669)
E/AndroidRuntime(20477):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(20477):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/AndroidRuntime(20477):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
E/AndroidRuntime(20477): Caused by: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.yalladev.boilerplate-mXJG7VZCgf6MRmguV2Fo6g==/base.apk"],nativeLibraryDirectories=[/data/app/com.yalladev.boilerplate-mXJG7VZCgf6MRmguV2Fo6g==/lib/arm, /data/app/com.yalladev.boilerplate-mXJG7VZCgf6MRmguV2Fo6g==/base.apk!/lib/armeabi-v7a, /system/lib]]] couldn't find "libflutter.so"
E/AndroidRuntime(20477):    at io.flutter.embedding.engine.loader.FlutterLoader.ensureInitializationComplete(FlutterLoader.java:258)
E/AndroidRuntime(20477):    at io.flutter.embedding.engine.FlutterEngine.<init>(FlutterEngine.java:284)
E/AndroidRuntime(20477):    at io.flutter.embedding.engine.FlutterEngine.<init>(FlutterEngine.java:190)
E/AndroidRuntime(20477):    at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.setupFlutterEngine(FlutterActivityAndFragmentDelegate.java:233)
E/AndroidRuntime(20477):    at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(FlutterActivityAndFragmentDelegate.java:153)
E/AndroidRuntime(20477):    at io.flutter.embedding.android.FlutterActivity.onCreate(FlutterActivity.java:411)
E/AndroidRuntime(20477):    at android.app.Activity.performCreate(Activity.java:7136)
E/AndroidRuntime(20477):    at android.app.Activity.performCreate(Activity.java:7127)
E/AndroidRuntime(20477):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
E/AndroidRuntime(20477):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
E/AndroidRuntime(20477):    ... 11 more
E/AndroidRuntime(20477): Caused by: java.util.concurrent.ExecutionException: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.yalladev.boilerplate-mXJG7VZCgf6MRmguV2Fo6g==/base.apk"],nativeLibraryDirectories=[/data/app/com.yalladev.boilerplate-mXJG7VZCgf6MRmguV2Fo6g==/lib/arm, /data/app/com.yalladev.boilerplate-mXJG7VZCgf6MRmguV2Fo6g==/base.apk!/lib/armeabi-v7a, /system/lib]]] couldn't find "libflutter.so"
E/AndroidRuntime(20477):    at java.util.concurrent.FutureTask.report(FutureTask.java:123)
E/AndroidRuntime(20477):    at java.util.concurrent.FutureTask.get(FutureTask.java:193)
E/AndroidRuntime(20477):    at io.flutter.embedding.engine.loader.FlutterLoader.ensureInitializationComplete(FlutterLoader.java:193)
E/AndroidRuntime(20477):    ... 20 more
E/AndroidRuntime(20477): Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.yalladev.boilerplate-mXJG7VZCgf6MRmguV2Fo6g==/base.apk"],nativeLibraryDirectories=[/data/app/com.yalladev.boilerplate-mXJG7VZCgf6MRmguV2Fo6g==/lib/arm, /data/app/com.yalladev.boilerplate-mXJG7VZCgf6MRmguV2Fo6g==/base.apk!/lib/armeabi-v7a, /system/lib]]] couldn't find "libflutter.so"
E/AndroidRuntime(20477):    at java.lang.Runtime.loadLibrary0(Runtime.java:1012)
E/AndroidRuntime(20477):    at java.lang.System.loadLibrary(System.java:1669)
E/AndroidRuntime(20477):    at io.flutter.embedding.engine.loader.FlutterLoader$1.call(FlutterLoader.java:145)
E/AndroidRuntime(20477):    at io.flutter.embedding.engine.loader.FlutterLoader$1.call(FlutterLoader.java:140)
E/AndroidRuntime(20477):    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/AndroidRuntime(20477):    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/AndroidRuntime(20477):    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/AndroidRuntime(20477):    at java.lang.Thread.run(Thread.java:764)

Building the APK or running the application in release mode after removing the go_sell_sdk_flutter dependency works completely fine. This is reproducible on Flutter versions 1.17.5 and up (1.17.5, 1.20.0, 1.20.1 and 1.20.2).

iOS

The application builds and works in release mode but crashes as soon as i call GoSellSdkFlutter.sessionConfigurations method, the application crashes and throws the following error

Could not cast value of type 'NSNull' (0x7fff87b2c390) to 'NSString' (0x7fff87beba38).
Lost connection to device.
Exited (sigterm)

I followed the code given in the example project:- https://github.com/Tap-Payments/gosellSDK-Flutter/blob/master/example/lib/main.dart

In regards to the iOS project, i suspect that it has something to do with the variables not being initialised in the swift code

Screenshot 2020-08-16 at 4 36 02 PM

But I'm not really sure. Please fix these issues as the application doesn't work on either iOS (in both release and debug) or Android (release). This is stopping us from releasing our application

aseef17 commented 4 years ago

The issue relies at JSONSerialization for iOS. Please fix this asap

Screenshot 2020-08-23 at 6 55 43 PM
HaithamSheshtawy commented 4 years ago

for iOS issue : check v 1.3.1

kareemTap commented 3 years ago

@aseef17

For Android Release: You need to update 3 things at your end before trying to release the app

  1. Add abiFilters filters to it’s app.gradle file as below to support all kinds of emulators and devices

    ndk {
       abiFilters "armeabi-v7a"
    }
  2. Add signinconfiguration to it’s gradle file for release

    signingConfigs {
        release {
            storeFile file(RELEASE_STORE_FILE)
            storePassword RELEASE_STORE_PASSWORD
            keyAlias RELEASE_KEY_ALIAS
            keyPassword RELEASE_KEY_PASSWORD
            // Optional, specify signing versions used
            v1SigningEnabled true
            v2SigningEnabled true
        }
    }
    buildTypes {
        release {
            signingConfig signingConfigs.release
        }
    }
  3. In gradle.properties file

    org.gradle.jvmargs=-Xmx1536M
    android.useAndroidX=true
    android.enableJetifier=true
    android.useDeprecatedNdk=true
    RELEASE_STORE_FILE=YOUR_STORE_FILE_PATH(replace this)
    RELEASE_STORE_PASSWORD=password
    RELEASE_KEY_ALIAS=key0
    RELEASE_KEY_PASSWORD=password