I am combining OpenCV with tess-two to make an Android OCR application. It worked perfectly well with OpenCV4Android + custom JNI OpenCV libraries, until I started importing tess-two library. It compiles but does not install:
[2015-08-02 14:43:02 - OpenCV Tutorial 2 - Mixed Processing] Installation failed due to invalid APK file!
[2015-08-02 14:43:02 - OpenCV Tutorial 2 - Mixed Processing] Please check logcat output for more details.
[2015-08-02 14:43:02 - OpenCV Tutorial 2 - Mixed Processing] Launch canceled!
Other posts suggest it's library and reference errors. Indeed, it can install again when I remove ..\tess-two in Properties->Android->Library. Also the tess-two library is compiled correctly, because I sueccesfully compiled and an example project.
And here is the logcat.
08-02 14:46:07.775: D/AndroidRuntime(14699): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
08-02 14:46:07.775: D/AndroidRuntime(14699): CheckJNI is OFF
08-02 14:46:07.785: D/dalvikvm(14699): Trying to load lib libjavacore.so 0x0
08-02 14:46:07.795: D/dalvikvm(14699): Added shared lib libjavacore.so 0x0
08-02 14:46:07.805: D/dalvikvm(14699): Trying to load lib libnativehelper.so 0x0
08-02 14:46:07.805: D/dalvikvm(14699): Added shared lib libnativehelper.so 0x0
08-02 14:46:07.835: E/cutils-trace(14699): Error opening trace file: No such file or directory (2)
08-02 14:46:08.005: D/AndroidRuntime(14699): Calling main entry com.android.commands.pm.Pm
08-02 14:46:08.015: D/zipro(9906): Zip: EOCD not found, /data/local/tmp/OpenCV Tutorial 2 - Mixed Processing.apk is not zip
08-02 14:46:08.015: D/asset(9906): failed to open Zip archive '/data/local/tmp/OpenCV Tutorial 2 - Mixed Processing.apk'
08-02 14:46:08.015: W/PackageParser(9906): Unable to read AndroidManifest.xml of /data/local/tmp/OpenCV Tutorial 2 - Mixed Processing.apk
08-02 14:46:08.015: W/PackageParser(9906): java.io.FileNotFoundException: AndroidManifest.xml
08-02 14:46:08.015: W/PackageParser(9906): at android.content.res.AssetManager.openXmlAssetNative(Native Method)
08-02 14:46:08.015: W/PackageParser(9906): at android.content.res.AssetManager.openXmlBlockAsset(AssetManager.java:522)
08-02 14:46:08.015: W/PackageParser(9906): at android.content.res.AssetManager.openXmlResourceParser(AssetManager.java:478)
08-02 14:46:08.015: W/PackageParser(9906): at android.content.pm.PackageParser.parsePackageLite(PackageParser.java:787)
08-02 14:46:08.015: W/PackageParser(9906): at com.android.defcontainer.DefaultContainerService$1.getMinimalPackageInfo(DefaultContainerService.java:174)
08-02 14:46:08.015: W/PackageParser(9906): at com.android.internal.app.IMediaContainerService$Stub.onTransact(IMediaContainerService.java:110)
08-02 14:46:08.015: W/PackageParser(9906): at android.os.Binder.execTransact(Binder.java:388)
08-02 14:46:08.015: W/PackageParser(9906): at dalvik.system.NativeStart.run(Native Method)
08-02 14:46:08.015: W/DefContainer(9906): Failed to parse package
08-02 14:46:08.025: W/ActivityManager(455): No content provider found for permission revoke: file:///data/local/tmp/OpenCV Tutorial 2 - Mixed Processing.apk
I added
<uses-sdk android:minSdkVersion="11"
android:targetSdkVersion="15"/>
to AndroidManifest.xml in both the project and the tess-two library. Everything worked.
Related
Its on an HTC Aria, running 2.2 (API 8)
https://en.wikipedia.org/wiki/HTC_Aria
The aria is an armv6 device that supports opengles 2
If you open up the latest Android Studio (im working on windows 7), then import the HelloGL2 sample, then simply try to run it on the above device, it will fail as soon as it tries to make a call into the native library.
Here is the log:
01-06 11:14:08.467 12771-12813/com.android.gl2jni D/dalvikvm: Trying to load lib /data/data/com.android.gl2jni/lib/libgl2jni.so 0x44c165d0
01-06 11:14:08.467 12771-12813/com.android.gl2jni I/dalvikvm: Unable to dlopen(/data/data/com.android.gl2jni/lib/libgl2jni.so): Cannot load library: link_image[1995]: failed to link libgl2jni.so
01-06 11:14:08.477 12771-12813/com.android.gl2jni W/dalvikvm: Exception Ljava/lang/UnsatisfiedLinkError; thrown during Lcom/android/gl2jni/GL2JNILib;.<clinit>
01-06 11:14:08.497 12771-12813/com.android.gl2jni W/dalvikvm: threadid=8: thread exiting with uncaught exception (group=0x40028a00)
01-06 11:14:08.517 95-121/? I/ActivityManager: Displayed activity com.android.gl2jni/.GL2JNIActivity: 9823 ms (total 2027818 ms)
01-06 11:14:08.567 12771-12813/com.android.gl2jni E/AndroidRuntime: FATAL EXCEPTION: GLThread 9
java.lang.ExceptionInInitializerError
at com.android.gl2jni.GL2JNIView$Renderer.onSurfaceChanged(GL2JNIView.java:332)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1327)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
Caused by: java.lang.UnsatisfiedLinkError: Library gl2jni not found
at java.lang.Runtime.loadLibrary(Runtime.java:461)
at java.lang.System.loadLibrary(System.java:557)
at com.android.gl2jni.GL2JNILib.<clinit>(GL2JNILib.java:24)
at com.android.gl2jni.GL2JNIView$Renderer.onSurfaceChanged(GL2JNIView.java:332)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1327)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
01-06 11:14:08.607 95-164/? W/ActivityManager: Force finishing activity com.android.gl2jni/.GL2JNIActivity
This sample works on the 3 other devices i've tried (Galaxy s5, Galaxy J1, Nexus s)
The line: 'Unable to dlopen(/data/data/com.android.gl2jni/lib/libgl2jni.so): Cannot load library: link_image[1995]: failed to link libgl2jni.so' is probably key. I tried loading the library explicitly using system.loadlibrary, but the same problem happens on that call.
I think it might be something to do with the processor being armv6?
The sample is configured to do 'armeabi' though.
I am trying to run my Android application but I'm getting this error:
05-26 17:06:30.362: D/AndroidRuntime(8981):
Calling main entry com.android.commands.pm.Pm
05-26 17:08:46.372: D/AndroidRuntime(9000): >>>>>>
AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
05-26 17:08:46.372: D/AndroidRuntime(9000): CheckJNI is OFF
05-26 17:08:46.372: D/dalvikvm(9000): Trying to load lib libjavacore.so 0x0
05-26 17:08:46.422: D/dalvikvm(9000): Added shared lib libjavacore.so 0x0
05-26 17:08:46.422: D/dalvikvm(9000):
Trying to load lib libnativehelper.so 0x0
05-26 17:08:46.422: D/dalvikvm(9000):
Added shared lib libnativehelper.so 0x0
05-26 17:08:46.422: D/dalvikvm(9000):
No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
05-26 17:08:46.442: D/dalvikvm(9000):
Note: class Landroid/app/ ActivityManagerNative ;
has 179 unimplemented (abstract) methods
05-26 17:08:46.522: E/memtrack(9000):
Couldn't load memtrack module (No such file or directory)
05-26 17:08:46.522: E/android.os.Debug(9000):
failed to load memtrack module: - 2
05-26 17:08:46.552: D/AndroidRuntime(9000):
Calling main entry com.android.commands.pm.Pm
What can be the issue?
i can suggest you something, kill adb ,restart eclips and run emullator again.
else go for new updates, go to help->check for updates. if found new updates install it.
I have add a print log statement in JNI_OnLoad, but I found that it is not being called. Here is my JNI_OnLoad method.
extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved) {
__android_log_print(ANDROID_LOG_INFO, __FUNCTION__, "onLoad");
// some init code
}
Do I need to declare JNI_OnLoad in a specific file or declare sth in Android.MK tells system where to find the JNI_OnLoad method? Now I just put to one of the many .cpp files.
compiled .so lib is attached. I try to dump the so file, and I am sure the JNI_OnLoad method is exported.
https://docs.google.com/file/d/0B089WeEZXTb3ZjZiQllaYThuUUk/edit
Actually, I am trying to port a library from android source (libcorejava.so). To avoid class path conflict, I already change the class path.
And here is the file that declares JNI_OnLoad:
https://android.googlesource.com/platform/libcore/+/master/luni/src/main/native/Register.cpp
I already change the signature to the above one in order to match the standard signature
EDIT:
I found that android source does not load it by System.loadLibrary! It says libcorejava is used to implement System.loadLibrary, so we cannot use System.loadLibrary to load it. But in my case, it should not be a problem as I only need part of the function (ICU related).
https://android.googlesource.com/platform/dalvik/+/master/vm/Init.cpp
// Most JNI libraries can just use System.loadLibrary, but you can't
// if you're the library that implements System.loadLibrary!
loadJniLibrary("javacore");
loadJniLibrary("nativehelper");
EDIT 2:
It turns out that it is because the name conflict of the library!
But it seems that libjavacore requires other library. Does there any tool that can list out what the dependency I am missing?
java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1286]: XXX
EDIT 3:
TextClock is a new api for displaying time. It only exists in 4.2+ api up. I am trying to backport it so that older sdk can uses it. It depends on a ICU library which resides in libjavacore. So I modify the Android.mk file to make sure the libjavacore only include the icu related source file and the final compiled so file is being included in my apk.
TextClock:
http://developer.android.com/reference/android/widget/TextClock.html
It now works in the phone which originally support TextClock, but doesn't work in old devices. Here is the exception log. I think it is because libjavacore is the wrapper of ICU library. Apart from the wrapper, I still need to port the ICU library. But I am going to give up as the size of ICU library is quite large and seems doesn't worth for it...
12-13 14:07:54.859: E/AndroidRuntime(2091): java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1306]: 36 cannot locate '_ZN6icu_516Locale14createFromNameEPKc'...
12-13 14:07:54.859: E/AndroidRuntime(2091): at java.lang.Runtime.loadLibrary(Runtime.java:370)
12-13 14:07:54.859: E/AndroidRuntime(2091): at java.lang.System.loadLibrary(System.java:535)
12-13 14:07:54.859: E/AndroidRuntime(2091): at com.example.time.MainActivity.onCreate(MainActivity.java:20)
12-13 14:07:54.859: E/AndroidRuntime(2091): at android.app.Activity.performCreate(Activity.java:5008)
12-13 14:07:54.859: E/AndroidRuntime(2091): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
12-13 14:07:54.859: E/AndroidRuntime(2091): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
12-13 14:07:54.859: E/AndroidRuntime(2091): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
12-13 14:07:54.859: E/AndroidRuntime(2091): at android.app.ActivityThread.access$600(ActivityThread.java:130)
12-13 14:07:54.859: E/AndroidRuntime(2091): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
12-13 14:07:54.859: E/AndroidRuntime(2091): at android.os.Handler.dispatchMessage(Handler.java:99)
12-13 14:07:54.859: E/AndroidRuntime(2091): at android.os.Looper.loop(Looper.java:137)
12-13 14:07:54.859: E/AndroidRuntime(2091): at android.app.ActivityThread.main(ActivityThread.java:4745)
12-13 14:07:54.859: E/AndroidRuntime(2091): at java.lang.reflect.Method.invokeNative(Native Method)
12-13 14:07:54.859: E/AndroidRuntime(2091): at java.lang.reflect.Method.invoke(Method.java:511)
12-13 14:07:54.859: E/AndroidRuntime(2091): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
12-13 14:07:54.859: E/AndroidRuntime(2091): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
12-13 14:07:54.859: E/AndroidRuntime(2091): at dalvik.system.NativeStart.main(Native Method)
You can dump the symbols in your .so file using readelf in your toolchains folder. Check to see that JNI_OnLoad is exported. The -s (symbols) command and the name of the .so file in your libs folder should do it.
In older releases of Android, the library was linked directly into the VM (libdvm.so linked against libnativehelper.so which linked against libjavacore.a). In recent releases this changed to always load the library at start time, using the internal native library load mechanism, so JNI_OnLoad will be called if present.
If I run adb shell dalvikvm Foo (where "Foo" doesn't exist), I see this in logcat:
D dalvikvm: Trying to load lib libjavacore.so 0x0
D dalvikvm: Added shared lib libjavacore.so 0x0
D dalvikvm: Trying to load lib libnativehelper.so 0x0
D dalvikvm: Added shared lib libnativehelper.so 0x0
D dalvikvm: No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
So it loaded libjavacore.so and apparently found and ran JNI_OnLoad (no news is good news). It loaded libnativehelper.so and didn't find a JNI_OnLoad, so it logged a message to tell you so in case you were expecting otherwise.
If you replace the libjavacore.so in /system/lib (on a rooted device), and run the dalvikvm command, you should see your message in the log file, mixed in with messages like I've shown above. If you restart the system, you should see your message during zygote startup, and not again unless something runs a Dalvik-based command (like am).
Okay before you flag this as a duplicate I have tried the following
No implementation found for native
No implementation found for native Stitch
No Implementation found for native in ndk
No implementation found for native Lcom/jp/algi/
Android NDK C++ JNI (no implementation found for native...)
Android NDK: No implementation found for native xxxxxx
here is my MainActivity.java
public class MainActivity extends Activity {
static {
System.loadLibrary("physfs");
System.loadLibrary("jpeg");
System.loadLibrary("tiff");
System.loadLibrary("mng");
System.loadLibrary("png");
System.loadLibrary("jasper");
System.loadLibrary("lcms");
System.loadLibrary("devil");
System.loadLibrary("mylib");
}
public static native void convert();
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
convert();
}
}
the c file
#include "com_myproject_MainActivity.h"
#include <string.h>
#include <jni.h>
#include <stdio.h>
#include <stdlib.h>
JNIEXPORT void JNICALL Java_com_myproject_MainActivity_convert
(JNIEnv *, jclass){
.....
}
the javah generated header snippet
#define com_myproject_MainActivity_DEFAULT_KEYS_SHORTCUT 2L
#undef com_myproject_MainActivity_DEFAULT_KEYS_SEARCH_LOCAL
#define com_myproject_MainActivity_DEFAULT_KEYS_SEARCH_LOCAL 3L
#undef com_myproject_MainActivity_DEFAULT_KEYS_SEARCH_GLOBAL
#define com_myproject_MainActivity_DEFAULT_KEYS_SEARCH_GLOBAL 4L
/*
* Class: com_myproject_MainActivity
* Method: convert
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_myproject_MainActivity_convert
(JNIEnv *, jclass);
#ifdef __cplusplus
}
#endif
#endif
the portion of the android.mk file that sources the C file
#mylib
include $(CLEAR_VARS)
LOCAL_MODULE := libmylib
LOCAL_CFLAGS := -g -Dlinux -DFT2_BUILD_LIBRARY=1 -DPHYSFS_NO_CDROM_SUPPORT=1 -DAL_ALEXT_PROTOTYPES=1 -DHAVE_GCC_DESTRUCTOR=1 -DOPT_GENERIC -DREAL_IS_FLOAT
LOCAL_CPPFLAGS := ${LOCAL_CFLAGS}
LOCAL_C_INCLUDES := \
${DEVIL_SRC_PATH}include \
${DEVIL_SRC_PATH}src-IL/include \
${JASPER_SRC_PATH}src/libjasper/include \
${PNG_SRC_PATH} \
${MNG_SRC_PATH} \
${JPEG_SRC_PATH} \
${LCMS_SRC_PATH}include/ \
${TIFF_SRC_PATH}libtiff/ \
LOCAL_SRC_FILES := com_myproject_MainActivity.c
include $(BUILD_SHARED_LIBRARY)
I have tried the C file as .cpp and used extern "C" in all possible ways no result.
I have also deleted the bin,out,libs and obj folders several times and freshly built.
The code compiles and .so files are made.
But I can't run it this is the log
> 08-02 01:59:07.268: E/Trace(1569): error opening trace file: No such
> file or directory (2) 08-02 01:59:07.268: D/dalvikvm(1569): Trying to
> load lib /data/data/com.myproject/lib/libphysfs.so 0xb63c3518 08-02
> 01:59:07.268: D/dalvikvm(1569): Added shared lib
> /data/data/com.myproject/lib/libphysfs.so 0xb63c3518 08-02
> 01:59:07.268: D/dalvikvm(1569): No JNI_OnLoad found in
> /data/data/com.myproject/lib/libphysfs.so 0xb63c3518, skipping init
> 08-02 01:59:07.268: D/dalvikvm(1569): Trying to load lib
> /data/data/com.myproject/lib/libjpeg.so 0xb63c3518 08-02 01:59:07.268:
> D/dalvikvm(1569): Added shared lib
> /data/data/com.myproject/lib/libjpeg.so 0xb63c3518 08-02 01:59:07.268:
> D/dalvikvm(1569): No JNI_OnLoad found in
> /data/data/com.myproject/lib/libjpeg.so 0xb63c3518, skipping init
> 08-02 01:59:07.268: D/dalvikvm(1569): Trying to load lib
> /data/data/com.myproject/lib/libtiff.so 0xb63c3518 08-02 01:59:07.268:
> D/dalvikvm(1569): Added shared lib
> /data/data/com.myproject/lib/libtiff.so 0xb63c3518 08-02 01:59:07.268:
> D/dalvikvm(1569): No JNI_OnLoad found in
> /data/data/com.myproject/lib/libtiff.so 0xb63c3518, skipping init
> 08-02 01:59:07.268: D/dalvikvm(1569): Trying to load lib
> /data/data/com.myproject/lib/libmng.so 0xb63c3518 08-02 01:59:07.268:
> D/dalvikvm(1569): Added shared lib
> /data/data/com.myproject/lib/libmng.so 0xb63c3518 08-02 01:59:07.268:
> D/dalvikvm(1569): No JNI_OnLoad found in
> /data/data/com.myproject/lib/libmng.so 0xb63c3518, skipping init 08-02
> 01:59:07.268: D/dalvikvm(1569): Trying to load lib
> /data/data/com.myproject/lib/libpng.so 0xb63c3518 08-02 01:59:07.268:
> D/dalvikvm(1569): Added shared lib
> /data/data/com.myproject/lib/libpng.so 0xb63c3518 08-02 01:59:07.268:
> D/dalvikvm(1569): No JNI_OnLoad found in
> /data/data/com.myproject/lib/libpng.so 0xb63c3518, skipping init 08-02
> 01:59:07.268: D/dalvikvm(1569): Trying to load lib
> /data/data/com.myproject/lib/libjasper.so 0xb63c3518 08-02
> 01:59:07.268: D/dalvikvm(1569): Added shared lib
> /data/data/com.myproject/lib/libjasper.so 0xb63c3518 08-02
> 01:59:07.268: D/dalvikvm(1569): No JNI_OnLoad found in
> /data/data/com.myproject/lib/libjasper.so 0xb63c3518, skipping init
> 08-02 01:59:07.268: D/dalvikvm(1569): Trying to load lib
> /data/data/com.myproject/lib/liblcms.so 0xb63c3518 08-02 01:59:07.268:
> D/dalvikvm(1569): Added shared lib
> /data/data/com.myproject/lib/liblcms.so 0xb63c3518 08-02 01:59:07.268:
> D/dalvikvm(1569): No JNI_OnLoad found in
> /data/data/com.myproject/lib/liblcms.so 0xb63c3518, skipping init
> 08-02 01:59:07.268: D/dalvikvm(1569): Trying to load lib
> /data/data/com.myproject/lib/libdevil.so 0xb63c3518 08-02
> 01:59:07.268: D/dalvikvm(1569): Added shared lib
> /data/data/com.myproject/lib/libdevil.so 0xb63c3518 08-02
> 01:59:07.268: D/dalvikvm(1569): No JNI_OnLoad found in
> /data/data/com.myproject/lib/libdevil.so 0xb63c3518, skipping init
> 08-02 01:59:07.268: D/dalvikvm(1569): Trying to load lib
> /data/data/com.myproject/lib/libmylib.so 0xb63c3518 08-02
> 01:59:07.268: D/dalvikvm(1569): Added shared lib
> /data/data/com.myproject/lib/libmylib.so 0xb63c3518 08-02
> 01:59:07.268: D/dalvikvm(1569): No JNI_OnLoad found in
> /data/data/com.myproject/lib/libmylib.so 0xb63c3518, skipping init
> 08-02 01:59:07.288: W/dalvikvm(1569): No implementation found for
> native Lcom/myproject/MainActivity;.convert:()V 08-02 01:59:07.288:
> D/AndroidRuntime(1569): Shutting down VM 08-02 01:59:07.288:
> W/dalvikvm(1569): threadid=1: thread exiting with uncaught exception
> (group=0xb5e5e288) 08-02 01:59:07.288: E/AndroidRuntime(1569): FATAL
> EXCEPTION: main 08-02 01:59:07.288: E/AndroidRuntime(1569):
> java.lang.UnsatisfiedLinkError: Native method not found:
> com.myproject.MainActivity.convert:()V 08-02 01:59:07.288:
> E/AndroidRuntime(1569): at com.myproject.MainActivity.convert(Native
> Method) 08-02 01:59:07.288: E/AndroidRuntime(1569): at
> com.myproject.MainActivity.onCreate(MainActivity.java:30) 08-02
> 01:59:07.288: E/AndroidRuntime(1569): at
> android.app.Activity.performCreate(Activity.java:5008) 08-02
> 01:59:07.288: E/AndroidRuntime(1569): at
> android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
> 08-02 01:59:07.288: E/AndroidRuntime(1569): at
> android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
> 08-02 01:59:07.288: E/AndroidRuntime(1569): at
> android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
> 08-02 01:59:07.288: E/AndroidRuntime(1569): at
> android.app.ActivityThread.access$600(ActivityThread.java:130) 08-02
> 01:59:07.288: E/AndroidRuntime(1569): at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
> 08-02 01:59:07.288: E/AndroidRuntime(1569): at
> android.os.Handler.dispatchMessage(Handler.java:99) 08-02
> 01:59:07.288: E/AndroidRuntime(1569): at
> android.os.Looper.loop(Looper.java:137) 08-02 01:59:07.288:
> E/AndroidRuntime(1569): at
> android.app.ActivityThread.main(ActivityThread.java:4745) 08-02
> 01:59:07.288: E/AndroidRuntime(1569): at
> java.lang.reflect.Method.invokeNative(Native Method) 08-02
> 01:59:07.288: E/AndroidRuntime(1569): at
> java.lang.reflect.Method.invoke(Method.java:511) 08-02 01:59:07.288:
> E/AndroidRuntime(1569): at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
> 08-02 01:59:07.288: E/AndroidRuntime(1569): at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 08-02
> 01:59:07.288: E/AndroidRuntime(1569): at
> dalvik.system.NativeStart.main(Native Method)
For some reason the method isn't being seen and yet the library is loading....
for what it's worth, I edited this code from here and pulled out what i needed.
Thanx
In the source file you have:
Java_com_myproject_ndk_convert
But the javah has:
Java_com_myproject_MainActivity_convert
The log also says:
No implementation found for native Lcom/myproject/MainActivity;.convert:
Did you mean to write:
Java_com_myproject_MainActivity_convert
Why is the debug window empty debugging an Android app that does not include a MAIN and LAUNCH activity, but only a receiver? Is it normal or there is something wrong?
When I launch the app in debug mode this is the LogCat:
10-24 13:02:52.998: D/AndroidRuntime(5782): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
10-24 13:02:52.998: D/AndroidRuntime(5782): CheckJNI is ON
10-24 13:02:53.108: D/dalvikvm(5782): Trying to load lib libjavacore.so 0x0
10-24 13:02:53.118: D/dalvikvm(5782): Added shared lib libjavacore.so 0x0
10-24 13:02:53.159: D/dalvikvm(5782): Trying to load lib libnativehelper.so 0x0
10-24 13:02:53.168: D/dalvikvm(5782): Added shared lib libnativehelper.so 0x0
10-24 13:02:54.324: D/AndroidRuntime(5782): Calling main entry com.android.commands.pm.Pm
10-24 13:02:54.398: D/AndroidRuntime(5782): Shutting down VM
10-24 13:02:54.418: D/dalvikvm(5782): GC_CONCURRENT freed 102K, 78% free 466K/2048K, paused 1ms+3ms, total 22ms
10-24 13:02:54.448: D/dalvikvm(5782): Debugger has detached; object registry had 1 entries
10-24 13:04:07.651: E/ThrottleService(159): problem during onPollAlarm: java.lang.IllegalStateException: problem parsing stats: java.io.FileNotFoundException: /proc/net/xt_qtaguid/iface_stat_all: open failed: ENOENT (No such file or directory)
10-24 13:05:07.188: E/MP3Extractor(39): Unable to resync. Signalling end of stream.
10-24 13:05:08.118: I/AudioService(159): AudioFocus abandonAudioFocus() from android.media.AudioManager#412af538
10-24 13:06:00.370: D/dalvikvm(220): GC_CONCURRENT freed 386K, 57% free 9099K/20743K, paused 74ms+10ms, total 195ms
This is the Console window
[2012-10-24 15:02:53 - SMSApp] ------------------------------
[2012-10-24 15:02:53 - SMSApp] Android Launch!
[2012-10-24 15:02:53 - SMSApp] adb is running normally.
[2012-10-24 15:02:53 - SMSApp] No Launcher activity found!
[2012-10-24 15:02:53 - SMSApp] The launch will only sync the application package on the device!
[2012-10-24 15:02:53 - SMSApp] Performing sync
[2012-10-24 15:02:53 - SMSApp] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'NFC-Smartphone-1'
[2012-10-24 15:02:55 - SMSApp] Application already deployed. No need to reinstall.
[2012-10-24 15:02:55 - SMSApp] \SMSApp\bin\SMSApp.apk installed on device
[2012-10-24 15:02:55 - SMSApp] Done!
As you can see the application was already installed on the emulator, but the same issue is present when the application is installed for the first time.
Let me know whether it is useful to see also the code.
I tried with a slightly different version of the same app just to force Eclipse to reinstall the app in the emulator (added a space). This is the LogCat of the reinstallation:
10-25 12:43:14.628: D/AndroidRuntime(701): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
10-25 12:43:14.628: D/AndroidRuntime(701): CheckJNI is ON
10-25 12:43:14.687: D/dalvikvm(701): Trying to load lib libjavacore.so 0x0
10-25 12:43:14.707: D/dalvikvm(701): Added shared lib libjavacore.so 0x0
10-25 12:43:14.747: D/dalvikvm(701): Trying to load lib libnativehelper.so 0x0
10-25 12:43:14.747: D/dalvikvm(701): Added shared lib libnativehelper.so 0x0
10-25 12:43:15.647: D/AndroidRuntime(701): Calling main entry com.android.commands.pm.Pm
10-25 12:43:15.707: W/ActivityManager(148): No content provider found for permission revoke: file:///data/local/tmp/SMSApp.apk
10-25 12:43:15.737: W/ActivityManager(148): No content provider found for permission revoke: file:///data/local/tmp/SMSApp.apk
10-25 12:43:15.917: I/PackageManager(148): Removing non-system package:com.storassa.android.smsapp
10-25 12:43:15.917: I/ActivityManager(148): Force stopping package com.storassa.android.smsapp uid=10044
10-25 12:43:15.967: I/dalvikvm(148): Jit: resizing JitTable from 4096 to 8192
10-25 12:43:16.088: I/PackageManager(148): Package com.storassa.android.smsapp codePath changed from /data/app/com.storassa.android.smsapp-2.apk to /data/app/com.storassa.android.smsapp-1.apk; Retaining data and using new
10-25 12:43:16.098: I/PackageManager(148): Running dexopt on: com.storassa.android.smsapp
10-25 12:43:16.948: D/dalvikvm(715): DexOpt: load 124ms, verify+opt 526ms, 730780 bytes
10-25 12:43:16.977: I/ActivityManager(148): Force stopping package com.storassa.android.smsapp uid=10044
10-25 12:43:16.977: W/PackageManager(148): Code path for pkg : com.storassa.android.smsapp changing from /data/app/com.storassa.android.smsapp-2.apk to /data/app/com.storassa.android.smsapp-1.apk
10-25 12:43:16.977: W/PackageManager(148): Resource path for pkg : com.storassa.android.smsapp changing from /data/app/com.storassa.android.smsapp-2.apk to /data/app/com.storassa.android.smsapp-1.apk
10-25 12:43:17.067: D/PackageManager(148): New package installed in /data/app/com.storassa.android.smsapp-1.apk
10-25 12:43:17.337: D/dalvikvm(148): GC_CONCURRENT freed 664K, 8% free 11375K/12231K, paused 77ms+12ms, total 180ms
10-25 12:43:17.337: D/dalvikvm(148): WAIT_FOR_CONCURRENT_GC blocked 100ms
Another tips: no saved filters appears in LogCat.