Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android NDK tuorial: immediate crash after start #125

Open
pvoid opened this issue Oct 21, 2019 · 2 comments
Open

Android NDK tuorial: immediate crash after start #125

pvoid opened this issue Oct 21, 2019 · 2 comments

Comments

@pvoid
Copy link

pvoid commented Oct 21, 2019

Ubuntu :19.04
Bazel : 1.1.0
SDK API :29
NDK : 20

Binary is built with --fat_apk_cpu=armeabi-v7a,arm64-v8a flag. Both so files are in place, but both of them don't have the native method from native-lib.cpp

FATAL EXCEPTION: main
Process: com.example.android.bazel, PID: 30069
AndroidRuntime: java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String com.example.android.bazel.MainActivity.stringFromJNI() (tried Java_com_example_android_bazel_MainActivity_stringFromJNI and Java_com_example_android_bazel_MainActivity_stringFromJNI__)
 	at com.example.android.bazel.MainActivity.stringFromJNI(Native Method)
 	at com.example.android.bazel.MainActivity.onCreate(MainActivity.java:20)
 	at android.app.Activity.performCreate(Activity.java:7802)
 	at android.app.Activity.performCreate(Activity.java:7791)
 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1306)
 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
 	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
 	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
 	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
 	at android.os.Handler.dispatchMessage(Handler.java:107)
 	at android.os.Looper.loop(Looper.java:214)
 	at android.app.ActivityThread.main(ActivityThread.java:7356)
 	at java.lang.reflect.Method.invoke(Native Method)
 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
@leadorzf
Copy link

also have the problem

@yingshaoxo
Copy link

yingshaoxo commented Apr 9, 2020

I also got the same problem when I try to run this example (I'm using Google Pixel 2 XL):

https://github.com/bazelbuild/examples/tree/master/android/ndk

bazel mobile-install //app/src/main:app --start_app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants