Estoy portando mi código C/C++ en un juego de Android usando el NDK, pero estoy teniendo problemas para comenzar.¿Cómo puedo solucionar esta excepción fatal?
He descargado el NDK-r5b de developer.android.com y he instalado Cygwin.
Ni siquiera puedo ejecutar el programa Hello-jni
incluido en las muestras de NDK.
cuando corro:
$ cd /cygdrive/c/android/android-ndk-r5b/samples/hello-jni
$ ndk-build
Obtengo un ERROR: You are using a non-Cygwin compatible Make program
.
Intenté instalar GNUMake 3.81 pero el problema persiste.
Me trataron de ejecutar el programa HELLO-JNI
muestra en el NDK través de Eclipse IDE. Hay una fuerza de cerca la AVD Android, y Logcat estaba mostrando una excepción de la siguiente manera:
04-08 12:32:11.609: ERROR/AndroidRuntime(274): FATAL EXCEPTION: main
04-08 12:32:11.609: ERROR/AndroidRuntime(274):
java.lang.ExceptionInInitializerError
04-08 12:32:11.609: ERROR/AndroidRuntime(274): at
java.lang.Class.newInstanceImpl(Native Method)
04-08 12:32:11.609: ERROR/AndroidRuntime(274): at
java.lang.Class.newInstance(Class.java:1429)
04-08 12:32:11.609: ERROR/AndroidRuntime(274): at
android.app.Instrumentation.newActivity(Instrumentation.java:1021)
04-08 12:32:11.609: ERROR/AndroidRuntime(274): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2577)
04-08 12:32:11.609: ERROR/AndroidRuntime(274): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2679)
04-08 12:32:11.609: ERROR/AndroidRuntime(274): at
android.app.ActivityThread.access$2300(ActivityThread.java:125)
04-08 12:32:11.609: ERROR/AndroidRuntime(274): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
04-08 12:32:11.609: ERROR/AndroidRuntime(274): at
android.os.Handler.dispatchMessage(Handler.java:99)
04-08 12:32:11.609: ERROR/AndroidRuntime(274): at
android.os.Looper.loop(Looper.java:123)
04-08 12:32:11.609: ERROR/AndroidRuntime(274): at
android.app.ActivityThread.main(ActivityThread.java:4627)
04-08 12:32:11.609: ERROR/AndroidRuntime(274): at
java.lang.reflect.Method.invokeNative(Native Method)
04-08 12:32:11.609: ERROR/AndroidRuntime(274): at
java.lang.reflect.Method.invoke(Method.java:521)
04-08 12:32:11.609: ERROR/AndroidRuntime(274): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-08 12:32:11.609: ERROR/AndroidRuntime(274): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-08 12:32:11.609: ERROR/AndroidRuntime(274): at
dalvik.system.NativeStart.main(Native Method)
04-08 12:32:11.609: ERROR/AndroidRuntime(274): Caused by:
java.lang.UnsatisfiedLinkError: Library hello-jni not found
04-08 12:32:11.609: ERROR/AndroidRuntime(274): at
java.lang.Runtime.loadLibrary(Runtime.java:461)
04-08 12:32:11.609: ERROR/AndroidRuntime(274): at
java.lang.System.loadLibrary(System.java:557)
04-08 12:32:11.609: ERROR/AndroidRuntime(274): at
com.example.hellojni.HelloJni.<clinit>(HelloJni.java:67)
04-08 12:32:11.609: ERROR/AndroidRuntime(274): ... 15 more
04-08 12:32:11.678: WARN/ActivityManager(59): Force finishing
activity com.example.hellojni/.HelloJni
04-08 12:32:12.340: WARN/ActivityManager(59): Activity pause timeout
for HistoryRecord{44f925c8 com.example.hellojni/.HelloJni}
Como puedo hacer este trabajo?