Blackberry - Runtime for Android Apps error

644 views Asked by At

I am trying to repackage an Android app to BlackBerry using the Runtime for Android Apps Eclipse plugin but I'm getting an error:

class: nativeLib.NativeLib uses Native access

Does anyone have any idea of how to fix that?

If any additional information is necessary, please let me know.

Thanks!

3

There are 3 answers

0
jeka On BEST ANSWER

Screenshot of Eclipse Preferences screen

In Eclipse-Preferences-BlackBerry-BlackBerry Plug-in For Android uncheck the "Enable APK verifier" option

0
leandrocastelli On

Open the Window Menu -> Preferences -> Android -> Build

Uncheck the option "Force error when external jars contain native libraries"

0
Leejjon On

The above solution fixes the problem with Eclipse displaying errors, but you still can't run it directly from Eclipse. (or at least I've tried to run it with the simulator, and that doesn't work, I'm assuming it's because you're simply hiding the errors rather than solving them)

I've managed to evade this problem by building it with the command line tools.

Download the commandline tools here (2.0.1 beta at this moment): https://developer.blackberry.com/android/tools/

Run: blackberry-apkpackager C:\path\to\your\apk\test-android.apk -os 10.2.1

This creates a .bar file you can run on the simulator or your actual BlackBerry device. If you don't add the "-os 10.2.1", you get the same error your Eclipse displays. With that argument your .bar can only be ran on 10.2.1 (which is good, because then it won't complain about the native stuff).