Start a new topic
Solved

Error debbuging flutter example in android

Hello Wikitude team,


I have downloaded the flutter example app from the source: https://github.com/Wikitude/wikitude-flutter-plugin-examples.

When I debug in an Android device the app crashes. I can't see any message of error. It happens with virtual and phisical android device.


I followed the steps in the GitHub source to make this project work but nothing, in iOS virtual device it works. I also tried with flutter v1.12.13+hotfix.7 and is the same.

 

Details:

- Wikitude SDK Flutter v8.10.0

- Flutter v1.9.1+hotfix.6

- Virtual device: Google Pixel 2 API 28

- Phisical device: Huawei P20, Android 9


Here is a video: flutter error


I hope you to help me


Thanks,

Cesar.


mp4

Hi Cesar,


I would need more information about this crash, because we cannot reproduce it. 


Do you have Android Studio downloaded? If that is the case, please open it and look at the error messages that comes from the logcat. The debug console from VSCode shows everything that comes from the .dart code, but it usually misses the Android native parts, that's why i am asking for that.


Thank you,


Aitor.

Thank you for your response Aitor,


The logcat shows:


 --------- beginning of crash

2020-02-04 10:59:37.744 27576-27576/? E/AndroidRuntime: FATAL EXCEPTION: main

 Process: com.wikitude.fluttersamples, PID: 27576

 java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.wikitude.fluttersamples-BcLFGghyi6WHZ0gsadY6Xg==/base.apk"],nativeLibraryDirectories=[/data/app/com.wikitude.fluttersamples-BcLFGghyi6WHZ0gsadY6Xg==/lib/arm, /data/app/com.wikitude.fluttersamples-BcLFGghyi6WHZ0gsadY6Xg==/base.apk!/lib/armeabi-v7a, /system/lib, /product/lib]]] couldn't find "libflutter.so"

 at java.lang.Runtime.loadLibrary0(Runtime.java:1012)

 at java.lang.System.loadLibrary(System.java:1672)

 at io.flutter.view.FlutterMain.startInitialization(FlutterMain.java:138)

 at io.flutter.view.FlutterMain.startInitialization(FlutterMain.java:110)

 at io.flutter.app.FlutterApplication.onCreate(FlutterApplication.java:22)

 at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1162)

 at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6717)

 at android.app.ActivityThread.access$2000(ActivityThread.java:273)

 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2020)

 at android.os.Handler.dispatchMessage(Handler.java:112)

 at android.os.Looper.loop(Looper.java:216)

 at android.app.ActivityThread.main(ActivityThread.java:7625)

 at java.lang.reflect.Method.invoke(Native Method)

 at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)

 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)



I modified the ndk section located in build.gradle:app with this:

ndk {

 abiFilters 'armeabi-v7a', 'x86', 'x86_64', 'armeabi', 'mips', 'mips64', 'arm64-v8a'

}


works in phisical android device.



In emulator still crashes:


2020-02-04 11:38:19.777 5812-5812/com.wikitude.fluttersamples E/AndroidRuntime: FATAL EXCEPTION: main

    Process: com.wikitude.fluttersamples, PID: 5812

    java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.wikitude.fluttersamples-zDLJ6Op37DyrRudg7R7zbw==/base.apk"],nativeLibraryDirectories=[/data/app/com.wikitude.fluttersamples-zDLJ6Op37DyrRudg7R7zbw==/lib/x86, /data/app/com.wikitude.fluttersamples-zDLJ6Op37DyrRudg7R7zbw==/base.apk!/lib/x86, /system/lib]]] couldn't find "libarchitect.so"

        at java.lang.Runtime.loadLibrary0(Runtime.java:1012)

        at java.lang.System.loadLibrary(System.java:1669)

        at com.wikitude.architect.ArchitectView.<clinit>(ProGuard:159)

        at com.wikitude.architect.ArchitectView.getPermissionManager(ProGuard:1252)

        at com.wikitude.wikitude_plugin.WikitudePlugin.<init>(WikitudePlugin.java:33)

        at com.wikitude.wikitude_plugin.WikitudePlugin.registerWith(WikitudePlugin.java:39)

        at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:17)

        at com.wikitude.fluttersamples.MainActivity.onCreate(MainActivity.java:11)

        at android.app.Activity.performCreate(Activity.java:7136)

        at android.app.Activity.performCreate(Activity.java:7127)

        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)

        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)

        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)

        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)

        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)

        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)

        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)

        at android.os.Handler.dispatchMessage(Handler.java:106)

        at android.os.Looper.loop(Looper.java:193)

        at android.app.ActivityThread.main(ActivityThread.java:6669)

        at java.lang.reflect.Method.invoke(Native Method)

        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)

        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Hi again,


In emulator it will crash since we don't provide an x86 version of the SDK and the current emulator just supports architecture.


For now, use a physical device to test it until we have a better solution for the emulation part.


Thank you,


Aitor Font.

Login or Signup to post a comment