Cli on Dalvikvm Fails on Jni Lib

CLI on DalvikVM fails on JNI lib

Good question! I had to dig a bit to figure this out.

There are a slew of JNI methods in libandroid_runtime.so that don't get bound by default, when you're using the dalvikvm command. Unfortunately, you can't just do a System.loadLibrary("android_runtime"), because this doesn't actually bind all the native methods.

However, after some digging, it turns out there is an internal, non-public, not guaranteed to be there class called com.android.internal.util.WithFramework, whose purpose is to load libandroid_runtime.so and bind all its JNI methods.

To use it, just throw com.android.internal.util.WithFramework in front of your class name, on the dalvikvm command, like so:

dalvikvm -cp /some/path/classes.dex com.android.internal.util.WithFramework my.example.cls "This is an argument"

(Note: This only works on pre-M devices, due to the WithFramework class being removed in M - thanks for the heads up @JaredRummler)

Firebase for Unity sample app crashes with: Could not find class 'com.google.android.gms.common.api.PendingResult'

It looks like you're missing the Play Services Base AAR which contains PendingResult, which may mean you're missing other Android dependencies for the SDK as well.

You should see an AAR like the following in your Assets folder in your project when you select Android as the target platform:
* Assets/Plugins/Android/play-services-base-10.0.1.aar

This contains the PendingResult class...

$ unzip Plugins/Android/play-services-base-10.0.1.aar classes.jar
Archive: Plugins/Android/play-services-base-10.0.1.aar
inflating: classes.jar
$ unzip -l classes.jar | grep /PendingResult\.class
1762 11-22-16 22:25 com/google/android/gms/common/api/PendingResult.class

There could be a couple of things that may be wrong in your project:

  • You have the Android Resolver disabled (enable it via the Assets -> Play Services Resolver -> Android Resolver -> Settings menu item)
  • You have a mismatched mix of Android AARs in your project.
    Delete all .aars under Assets/Plugins/Android/ and allow the Android Resolver to pull the latest set.

NativeVTK has stopped

It is an issue in that version of VTK with some OpenGL ES 2.0 devices. You can switch to ES 3.0 and the issue should go away. I have also created a topic to fix the issue for ES 2.0 moving forward here

https://gitlab.kitware.com/vtk/vtk/merge_requests/855



Related Topics



Leave a reply



Submit