There should be missing configuration I guess but couldn't find it.
Following my changes for displaying action bar on main activity.
1 - Extend ActionBarActivity for the root activity.
public class MainActivity extends ActionBarActivity implements OnItemSelectedListener {
2 - Updated minsdkversion to 11
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="18" />
3 - Add support library android-support-v7-appcombat.jar
4 - Change menu xml.
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:yourapp="http://schemas.android.com/apk/res-auto"
>
<item
android:id="#+id/action_aboutbox"
android:orderInCategory="100"
android:showAsAction="always"
android:title="#string/action_aboutbox"/>
<item
android:id="#+id/action_exit"
android:orderInCategory="100"
android:showAsAction="always"
android:title="#string/action_exit"/>
</menu>
Following is logcat log after running app.
10-17 01:38:18.174: D/AndroidRuntime(1814): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
10-17 01:38:18.174: D/AndroidRuntime(1814): CheckJNI is ON
10-17 01:38:18.253: D/dalvikvm(1814): Trying to load lib libjavacore.so 0x0
10-17 01:38:18.274: D/dalvikvm(1814): Added shared lib libjavacore.so 0x0
10-17 01:38:18.343: D/dalvikvm(1814): Trying to load lib libnativehelper.so 0x0
10-17 01:38:18.343: D/dalvikvm(1814): Added shared lib libnativehelper.so 0x0
10-17 01:38:18.504: E/cutils-trace(1814): Error opening trace file: No such file or directory (2)
10-17 01:38:19.464: D/AndroidRuntime(1814): Calling main entry com.android.commands.pm.Pm
10-17 01:38:19.504: D/AndroidRuntime(1814): Shutting down VM
10-17 01:38:19.504: D/dalvikvm(1814): Debugger has detached; object registry had 1 entries
10-17 01:38:20.974: D/AndroidRuntime(1825): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
10-17 01:38:20.974: D/AndroidRuntime(1825): CheckJNI is ON
10-17 01:38:21.044: D/dalvikvm(1825): Trying to load lib libjavacore.so 0x0
10-17 01:38:21.075: D/dalvikvm(1825): Added shared lib libjavacore.so 0x0
10-17 01:38:21.224: D/dalvikvm(1825): Trying to load lib libnativehelper.so 0x0
10-17 01:38:21.224: D/dalvikvm(1825): Added shared lib libnativehelper.so 0x0
10-17 01:38:21.364: E/cutils-trace(1825): Error opening trace file: No such file or directory (2)
10-17 01:38:22.224: D/AndroidRuntime(1825): Calling main entry com.android.commands.am.Am
10-17 01:38:22.244: D/dalvikvm(1825): Note: class Landroid/app/ActivityManagerNative; has 163 unimplemented (abstract) methods
10-17 01:38:22.284: I/ActivityManager(286): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=org.siteprice.googlepagerankchecker/.MainActivity} from pid 1825
10-17 01:38:22.314: W/WindowManager(286): Screenshot failure taking screenshot for (123x164) to layer 21005
10-17 01:38:22.384: D/AndroidRuntime(1825): Shutting down VM
10-17 01:38:22.384: D/jdwp(1825): Got wake-up signal, bailing out of select
10-17 01:38:22.384: D/dalvikvm(1825): Debugger has detached; object registry had 1 entries
10-17 01:38:24.334: I/Choreographer(1795): Skipped 46 frames! The application may be doing too much work on its main thread.
10-17 01:38:24.544: D/dalvikvm(1795): GC_FOR_ALLOC freed 234K, 11% free 2785K/3100K, paused 42ms, total 80ms
10-17 01:38:25.233: I/Choreographer(1795): Skipped 127 frames! The application may be doing too much work on its main thread.
10-17 01:38:25.594: I/ActivityManager(286): Displayed org.siteprice.googlepagerankchecker/.MainActivity: +3s246ms
Is there anything I should do?
Use
yourapp:showAsAction="always"
Related
I am making app which on portrait mode shows fragmentA (containing Listview) and when in Landscape mode, it shows fragmentA and fragmentB(Listview and its corresponding description).It keeps on crashing,my hunch says either there is a fault in if-else condition in MainActivity or problem is in communication pattern.I request Everyone to please Help. Here is my MainActivity.xml
package com.example.prince.fragment_modularui2;
import android.content.Intent;
import android.content.res.Resources;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity implements FragmentA.Communicator{
String s;
Resources r=getResources();
String[] a=r.getStringArray(R.array.descr);
FragmentA fa;
FragmentB fb;
FragmentManager manager;
#Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
manager=getSupportFragmentManager();
//fa always present
fa= (FragmentA) manager.findFragmentById(R.id.fragment);
fb= (FragmentB) manager.findFragmentById(R.id.fragment2);
fa.setCommunicator(this);
}
#Override
public void respond(int data) {
Intent i=new Intent(this,AnotherActivity.class);
i.putExtra("index",data);
startActivity(i);
}
}
here is activity_main.xml in Portrait
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<fragment
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.example.prince.fragment_modularui2.FragmentA"
android:id="#+id/fragment"
></fragment>
</LinearLayout>
activity_main in landscape
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">
<fragment
android:id="#+id/fragment"
android:name="com.example.prince.fragment_modularui2.FragmentA"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true" />
<fragment
android:id="#+id/fragment2"
android:name="com.example.prince.fragment_modularui2.FragmentB"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true" />
</LinearLayout>
Rest of the code is https://github.com/AlmightyHeathcliff/Fragment_ModularUi2
The stackTrace is
07-18 09:45:09.252 1974-1974/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
07-18 09:45:09.254 1974-1974/? D/AndroidRuntime: CheckJNI is OFF
07-18 09:45:09.289 1974-1974/? W/art: Unexpected CPU variant for X86 using defaults: x86
07-18 09:45:09.301 1974-1974/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
07-18 09:45:09.316 1974-1974/? E/memtrack: Couldn't load memtrack module (No such file or directory)
07-18 09:45:09.316 1974-1974/? E/android.os.Debug: failed to load memtrack module: -2
07-18 09:45:09.317 1974-1974/? I/Radio-JNI: register_android_hardware_Radio DONE
07-18 09:45:09.325 1974-1974/? D/AndroidRuntime: Calling main entry com.android.commands.pm.Pm
07-18 09:45:09.330 1974-1974/? I/art: System.exit called, status: 0
07-18 09:45:09.330 1974-1974/? I/AndroidRuntime: VM exiting with result code 0.
07-18 09:45:09.333 1974-1982/? W/MessageQueue: Handler (android.os.Handler) {f6bbfb3} sending message to a Handler on a dead thread
java.lang.IllegalStateException: Handler (android.os.Handler) {f6bbfb3} sending message to a Handler on a dead thread
at android.os.MessageQueue.enqueueMessage(MessageQueue.java:543)
at android.os.Handler.enqueueMessage(Handler.java:643)
at android.os.Handler.sendMessageAtTime(Handler.java:612)
at android.os.Handler.sendMessageDelayed(Handler.java:582)
at android.os.Handler.post(Handler.java:338)
at android.os.ResultReceiver$MyResultReceiver.send(ResultReceiver.java:57)
at com.android.internal.os.IResultReceiver$Stub.onTransact(IResultReceiver.java:58)
at android.os.Binder.execTransact(Binder.java:565)
07-18 09:45:09.972 1993-1993/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
07-18 09:45:09.976 1993-1993/? D/AndroidRuntime: CheckJNI is OFF
07-18 09:45:10.012 1993-1993/? W/art: Unexpected CPU variant for X86 using defaults: x86
07-18 09:45:10.015 1993-1993/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
07-18 09:45:10.049 1993-1993/? E/memtrack: Couldn't load memtrack module (No such file or directory)
07-18 09:45:10.049 1993-1993/? E/android.os.Debug: failed to load memtrack module: -2
07-18 09:45:10.050 1993-1993/? I/Radio-JNI: register_android_hardware_Radio DONE
07-18 09:45:10.059 1993-1993/? D/AndroidRuntime: Calling main entry com.android.commands.pm.Pm
07-18 09:45:10.064 1993-2001/? W/MessageQueue: Handler (android.os.Handler) {f6bbfb3} sending message to a Handler on a dead thread
java.lang.IllegalStateException: Handler (android.os.Handler) {f6bbfb3} sending message to a Handler on a dead thread
at android.os.MessageQueue.enqueueMessage(MessageQueue.java:543)
at android.os.Handler.enqueueMessage(Handler.java:643)
at android.os.Handler.sendMessageAtTime(Handler.java:612)
at android.os.Handler.sendMessageDelayed(Handler.java:582)
at android.os.Handler.post(Handler.java:338)
at android.os.ResultReceiver$MyResultReceiver.send(ResultReceiver.java:57)
at com.android.internal.os.IResultReceiver$Stub.onTransact(IResultReceiver.java:58)
at android.os.Binder.execTransact(Binder.java:565)
07-18 09:45:10.064 1993-1993/? I/art: System.exit called, status: 0
07-18 09:45:10.064 1993-1993/? I/AndroidRuntime: VM exiting with result code 0.
07-18 09:45:13.487 2005-2005/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
07-18 09:45:13.491 2005-2005/? D/AndroidRuntime: CheckJNI is OFF
07-18 09:45:13.569 2005-2005/? W/art: Unexpected CPU variant for X86 using defaults: x86
07-18 09:45:13.575 2005-2005/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
07-18 09:45:13.708 2009-2009/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
07-18 09:45:13.715 2009-2009/? D/AndroidRuntime: CheckJNI is OFF
07-18 09:45:13.760 2005-2005/? E/memtrack: Couldn't load memtrack module (No such file or directory)
07-18 09:45:13.760 2005-2005/? E/android.os.Debug: failed to load memtrack module: -2
07-18 09:45:13.761 2005-2005/? I/Radio-JNI: register_android_hardware_Radio DONE
07-18 09:45:13.776 2005-2005/? D/AndroidRuntime: Calling main entry com.android.commands.wm.Wm
07-18 09:45:13.814 2009-2009/? W/art: Unexpected CPU variant for X86 using defaults: x86
07-18 09:45:13.825 2009-2009/? D/ICU: No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
07-18 09:45:13.833 2005-2005/? D/AndroidRuntime: Shutting down VM
07-18 09:45:13.839 2005-2019/? W/art: Thread attaching while runtime is shutting down: Binder:2005_2
07-18 09:45:13.839 2005-2019/? I/AndroidRuntime: NOTE: attach of thread 'Binder:2005_2' failed
07-18 09:45:13.891 2009-2009/? E/memtrack: Couldn't load memtrack module (No such file or directory)
07-18 09:45:13.891 2009-2009/? E/android.os.Debug: failed to load memtrack module: -2
07-18 09:45:13.892 2009-2009/? I/Radio-JNI: register_android_hardware_Radio DONE
07-18 09:45:13.903 2009-2009/? D/AndroidRuntime: Calling main entry com.android.commands.am.Am
07-18 09:45:13.909 765-1149/system_process I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.prince.fragment_modularui2/.MainActivity} from uid 0 on display 0
07-18 09:45:13.919 2009-2009/? D/AndroidRuntime: Shutting down VM
07-18 09:45:13.993 765-1021/system_process W/ActivityManager: Slow operation: 75ms so far, now at startProcess: returned from zygote!
07-18 09:45:13.993 765-1021/system_process W/ActivityManager: Slow operation: 75ms so far, now at startProcess: done updating battery stats
07-18 09:45:13.993 765-1021/system_process W/ActivityManager: Slow operation: 75ms so far, now at startProcess: building log message
07-18 09:45:13.993 765-1021/system_process I/ActivityManager: Start proc 2027:com.example.prince.fragment_modularui2/u0a115 for activity com.example.prince.fragment_modularui2/.MainActivity
07-18 09:45:13.993 765-1021/system_process W/ActivityManager: Slow operation: 75ms so far, now at startProcess: starting to update pids map
07-18 09:45:13.993 765-1021/system_process W/ActivityManager: Slow operation: 75ms so far, now at startProcess: done updating pids map
07-18 09:45:13.993 765-1021/system_process W/ActivityManager: Slow operation: 75ms so far, now at startProcess: done starting proc!
07-18 09:45:14.003 2027-2027/? I/art: Late-enabling -Xcheck:jni
07-18 09:45:14.004 2027-2027/? W/art: Unexpected CPU variant for X86 using defaults: x86
07-18 09:45:14.258 500-757/? D/gralloc_vbox86: gralloc_alloc: format 1 and usage 0x933 imply creation of host color buffer
07-18 09:45:14.784 2027-2027/com.example.prince.fragment_modularui2 W/System: ClassLoader referenced unknown path: /data/app/com.example.prince.fragment_modularui2-1/lib/x86
07-18 09:45:14.813 2027-2027/com.example.prince.fragment_modularui2 I/InstantRun: starting instant run server: is main process
07-18 09:45:14.814 2027-2027/com.example.prince.fragment_modularui2 V/InstantRun: Starting server socket listening for package com.example.prince.fragment_modularui2 on android.net.LocalSocketAddress#8989009
07-18 09:45:14.814 2027-2027/com.example.prince.fragment_modularui2 V/InstantRun: Started server for package com.example.prince.fragment_modularui2
07-18 09:45:14.903 2027-2027/com.example.prince.fragment_modularui2 D/AndroidRuntime: Shutting down VM
07-18 09:45:14.904 2027-2027/com.example.prince.fragment_modularui2 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.prince.fragment_modularui2, PID: 2027
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.prince.fragment_modularui2/com.example.prince.fragment_modularui2.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2567)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
at android.content.ContextWrapper.getResources(ContextWrapper.java:86)
at android.view.ContextThemeWrapper.getResourcesInternal(ContextThemeWrapper.java:127)
at android.view.ContextThemeWrapper.getResources(ContextThemeWrapper.java:121)
at android.support.v7.app.AppCompatActivity.getResources(AppCompatActivity.java:549)
at com.example.prince.fragment_modularui2.MainActivity.<init>(MainActivity.java:12)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1078)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2557)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
07-18 09:45:14.907 765-1021/system_process W/ActivityManager: Force finishing activity com.example.prince.fragment_modularui2/.MainActivity
07-18 09:45:15.031 500-505/? D/gralloc_vbox86: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
07-18 09:45:15.058 500-505/? D/gralloc_vbox86: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
07-18 09:45:15.115 500-505/? D/gralloc_vbox86: gralloc_alloc: format 1 and usage 0x900 imply creation of host color buffer
07-18 09:45:15.232 765-1842/system_process I/OpenGLRenderer: Initialized EGL, version 1.4
07-18 09:45:15.232 765-1842/system_process D/OpenGLRenderer: Swap behavior 1
07-18 09:45:15.429 765-779/system_process W/ActivityManager: Activity pause timeout for ActivityRecord{b0310c2 u0 com.example.prince.fragment_modularui2/.MainActivity t693 f}
07-18 09:45:15.431 765-779/system_process I/ActivityManager: Killing 1353:android.process.media/u0a10 (adj 906): empty #17
07-18 09:45:15.432 765-779/system_process I/WindowManager: Failed to capture screenshot of Token{7756ed3 ActivityRecord{b0310c2 u0 com.example.prince.fragment_modularui2/.MainActivity t693 f}} appWin=Window{7f1e54b u0 Starting com.example.prince.fragment_modularui2} drawState=1
07-18 09:45:15.448 765-786/system_process I/Choreographer: Skipped 70 frames! The application may be doing too much work on its main thread.
07-18 09:45:15.452 765-1150/system_process D/ActivityManager: cleanUpApplicationRecord -- 1353
07-18 09:45:15.456 765-1842/system_process E/EGL_emulation: tid 1842: eglSurfaceAttrib(1174): error 0x3009 (EGL_BAD_MATCH)
07-18 09:45:15.456 765-1842/system_process W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xc4afa800, error=EGL_BAD_MATCH
07-18 09:45:16.337 765-780/system_process I/Choreographer: Skipped 52 frames! The application may be doing too much work on its main thread.
07-18 09:45:25.438 765-779/system_process W/ActivityManager: Activity destroy timeout for ActivityRecord{b0310c2 u0 com.example.prince.fragment_modularui2/.MainActivity t693 f}
From the stacktrace I gather that you are calling getResources() on a Context that is null. This makes sense because you are declaring your resources as a field like:
Resources res = getResources();
This gets executed before the activity is created but you can only call getResources() once the activity is created. So the solution is to declare your resources like:
private Resources res;
And in your activity onCreate method you do:
res = getResources();
This also means that you can't use the res variable until the onCreate method is executed. Generally it is better to not declare resources as a variable like that but rather declare your string array as:
String[] a;
and then in onCreate just call: a = getResources().getStringArray(R.array.desc);
One other tip I can give you is to name your variable clearer. A string array named 'a' is not very descriptive. You can call it something like descriptionArray to make it more clear.
I'm having some problems trying to install APKs in a specific device. I have lots of devices and it hadn't happened so far (all of them, Radxa Rock Pro).
When I run pm install myApp I get
root#radxaPro:/ # pm install /sdcard/myApp.apk
pkg: /sdcard/myApp.apk
Failure [INSTALL_FAILED_INTERNAL_ERROR]
Logcat output:
06-02 13:02:33.032 I/AndroidRuntime( 4469): JNI options: '-Xjniopts:warnonly'
06-02 13:02:33.042 D/dalvikvm( 4469): Trying to load lib libjavacore.so 0x0
06-02 13:02:33.042 D/dalvikvm( 4469): Added shared lib libjavacore.so 0x0
06-02 13:02:33.052 D/dalvikvm( 4469): Trying to load lib libnativehelper.so 0x0
06-02 13:02:33.052 D/dalvikvm( 4469): Added shared lib libnativehelper.so 0x0
06-02 13:02:33.052 D/dalvikvm( 4469): No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
06-02 13:02:33.082 D/dalvikvm( 4469): Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
06-02 13:02:33.232 E/memtrack( 4469): Couldn't load memtrack module (No such file or directory)
06-02 13:02:33.232 E/android.os.Debug( 4469): failed to load memtrack module: -2
06-02 13:02:33.282 D/AndroidRuntime( 4469): Calling main entry com.android.commands.pm.Pm
06-02 13:02:33.292 W/ActivityManager( 474): Unable to start service Intent { cmp=com.android.defcontainer/.DefaultContainerService } U=0: not found
06-02 13:02:33.292 E/PackageManager( 474): Failed to bind to media container service
I think the most important line is Unable to start service Intent { cmp=com.android.defcontainer/.DefaultContainerService } U=0: not found because a successful installation shows this (another device):
06-02 13:04:35.747: I/AndroidRuntime(1005): JNI options: '-Xjniopts:warnonly'
06-02 13:04:35.757: D/dalvikvm(1005): Trying to load lib libjavacore.so 0x0
06-02 13:04:35.767: D/dalvikvm(1005): Added shared lib libjavacore.so 0x0
06-02 13:04:35.767: D/dalvikvm(1005): Trying to load lib libnativehelper.so 0x0
06-02 13:04:35.767: D/dalvikvm(1005): Added shared lib libnativehelper.so 0x0
06-02 13:04:35.767: D/dalvikvm(1005): No JNI_OnLoad found in libnativehelper.so 0x0, skipping init
06-02 13:04:35.797: D/dalvikvm(1005): Note: class Landroid/app/ActivityManagerNative; has 179 unimplemented (abstract) methods
06-02 13:04:35.927: E/memtrack(1005): Couldn't load memtrack module (No such file or directory)
06-02 13:04:35.927: E/android.os.Debug(1005): failed to load memtrack module: -2
06-02 13:04:35.977: D/AndroidRuntime(1005): Calling main entry com.android.commands.pm.Pm
06-02 13:04:35.987: I/ActivityManager(478): Start proc com.android.defcontainer for service com.android.defcontainer/.DefaultContainerService: pid=1016 uid=10001 gids={50001, 1028, 1015, 1023, 2001, 1035}
The DefaultContainerService.apk is located in /system/priv-app/ but I have been able to check that it is not actually installed in that device. If I try to install it, I get the same error.
Does anyone have an idea? Is the Android system corrupt?
Thanks in advance.
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.
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.
I wonder if you can help me with this error.
I am running a fresh fully updated install of windows 7 with
Visual studio 2010 Professional in trial mode.
In Visual Studio I create a new OpenGl Mono for Android Application
using the built in template.
I compile and run the application.
The emulator boots (I am running API_8) EMU.
The application starts and then aborts.
(In the emulator I get a black screen which quickly closes.)
Same thing happens if I do similar using the Mono Develop IDE
and or the other templates.
Here is a dump of the error message (I cannot find much info on google)
It looks like the error is related to the load library fail.
Thanks
// DUMP
03-05 23:23:47.464 D/AndroidRuntime( 418):
03-05 23:23:47.464 D/AndroidRuntime( 418): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
03-05 23:23:47.464 D/AndroidRuntime( 418): CheckJNI is ON
03-05 23:23:47.574 D/AndroidRuntime( 418): --- registering native functions ---
03-05 23:23:48.034 I/ActivityManager( 60): Start proc OpenGLApplication1.OpenGLApplication1 for broadcast OpenGLApplication1.OpenGLApplication1/mono.android.Seppuku: pid=424 uid=10038 gids={3003, 1015}
03-05 23:23:48.164 I/ActivityThread( 424): Publishing provider OpenGLApplication1.OpenGLApplication1.__mono_init__: mono.MonoRuntimeProvider
03-05 23:23:48.174 D/dalvikvm( 424): Trying to load lib /data/data/OpenGLApplication1.OpenGLApplication1/lib/libmonodroid.so 0x44e7f010
03-05 23:23:48.174 D/dalvikvm( 424): Added shared lib /data/data/OpenGLApplication1.OpenGLApplication1/lib/libmonodroid.so 0x44e7f010
03-05 23:23:48.184 F/MonoDroid( 424): shared runtime initialization error: Cannot load library: load_library[1083]: Library '/data/data/Mono.Android.DebugRuntime/lib/libmonosgen-2.0.so' not found
03-05 23:23:48.204 I/ActivityManager( 60): Process OpenGLApplication1.OpenGLApplication1 (pid 424) has died.
03-05 23:23:48.214 D/AndroidRuntime( 418): Shutting down VM
03-05 23:23:48.214 D/jdwp ( 418): adbd disconnected
03-05 23:23:48.624 D/AndroidRuntime( 432):
03-05 23:23:48.624 D/AndroidRuntime( 432): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
03-05 23:23:48.624 D/AndroidRuntime( 432): CheckJNI is ON
03-05 23:23:48.734 D/AndroidRuntime( 432): --- registering native functions ---
03-05 23:23:49.173 I/ActivityManager( 60): Start proc OpenGLApplication1.OpenGLApplication1 for broadcast OpenGLApplication1.OpenGLApplication1/mono.android.Seppuku: pid=438 uid=10038 gids={3003, 1015}
03-05 23:23:49.294 I/ActivityThread( 438): Publishing provider OpenGLApplication1.OpenGLApplication1.__mono_init__: mono.MonoRuntimeProvider
03-05 23:23:49.303 D/dalvikvm( 438): Trying to load lib /data/data/OpenGLApplication1.OpenGLApplication1/lib/libmonodroid.so 0x44e7f010
03-05 23:23:49.303 D/dalvikvm( 438): Added shared lib /data/data/OpenGLApplication1.OpenGLApplication1/lib/libmonodroid.so 0x44e7f010
03-05 23:23:49.314 F/MonoDroid( 438): shared runtime initialization error: Cannot load library: load_library[1083]: Library '/data/data/Mono.Android.DebugRuntime/lib/libmonosgen-2.0.so' not found
03-05 23:23:49.334 I/ActivityManager( 60): Process OpenGLApplication1.OpenGLApplication1 (pid 438) has died.
03-05 23:23:49.344 D/AndroidRuntime( 432): Shutting down VM
03-05 23:23:49.344 D/jdwp ( 432): adbd disconnected
03-05 23:23:50.333 D/AndroidRuntime( 447):
03-05 23:23:50.333 D/AndroidRuntime( 447): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
03-05 23:23:50.333 D/AndroidRuntime( 447): CheckJNI is ON
03-05 23:23:50.443 D/AndroidRuntime( 447): --- registering native functions ---
03-05 23:23:50.873 I/ActivityManager( 60): Starting activity: Intent { act=android.intent.action.MAIN flg=0x10000000 cmp=OpenGLApplication1.OpenGLApplication1/openglapplication1.Activity1 }
03-05 23:23:50.893 I/ActivityManager( 60): Start proc OpenGLApplication1.OpenGLApplication1 for activity OpenGLApplication1.OpenGLApplication1/openglapplication1.Activity1: pid=453 uid=10038 gids={3003, 1015}
03-05 23:23:50.923 D/AndroidRuntime( 447): Shutting down VM
03-05 23:23:50.923 D/jdwp ( 447): adbd disconnected
03-05 23:23:50.953 I/AndroidRuntime( 447): NOTE: attach of thread 'Binder Thread #3' failed
03-05 23:23:51.173 I/ActivityThread( 453): Publishing provider OpenGLApplication1.OpenGLApplication1.__mono_init__: mono.MonoRuntimeProvider
03-05 23:23:51.223 D/dalvikvm( 453): Trying to load lib /data/data/OpenGLApplication1.OpenGLApplication1/lib/libmonodroid.so 0x44e7eef0
03-05 23:23:51.223 D/dalvikvm( 453): Added shared lib /data/data/OpenGLApplication1.OpenGLApplication1/lib/libmonodroid.so 0x44e7eef0
03-05 23:23:51.263 F/MonoDroid( 453): shared runtime initialization error: Cannot load library: load_library[1083]: Library '/data/data/Mono.Android.DebugRuntime/lib/libmonosgen-2.0.so' not found
03-05 23:23:51.283 I/ActivityManager( 60): Process OpenGLApplication1.OpenGLApplication1 (pid 453) has died.
03-05 23:23:51.293 I/UsageStats( 60): Unexpected resume of com.android.launcher while already resumed in OpenGLApplication1.OpenGLApplication1
03-05 23:23:51.423 W/InputManagerService( 60): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#45104b68
The issue is from the newer versions of mono where libmonosgen-2.0 does not get installed automatically. The path that you will see in which it fails is actually a simlink for the library. What you have to do is manually or through a non-mono apk, create the following:
A folder with your package name in /data/app-lib/
in the folder you will have to push the libmonosgen-2.0.so (and libmonodroid.so if needed)
After this is done you have to navigate to data/data/your.package.name and create a simlink from lib -> the folder you created previously. the command to use is ln -s.
I have noticed that in some cases the simlink exists, but is pointing to a false location.
I had to do this manually and it would not survive a factory reset. A colleugue of mine actually did this the non-mono apk path which does everything for him when ever the provisioning app executes on first launch.
Try going to the project properties and turn off "fast deployment". Then manually remove your app from the emu/device, and try again.
Another possibility is that you don't have enough free space on your device. The problem isn't in your package (OpenGLApplication1), the problem is from installing the Mono.Android.DebugRuntime package, as /data/data/Mono.Android.DebugRuntime/lib/libmonosgen-2.0.so doesn't exist.
I would suggest looking through the adb logcat log, and see if something like the following is present:
W/NativeHelper( 98): Failed to cache package shared libs
W/NativeHelper( 98): java.io.IOException: Couldn't create cached binary /data/data/Mono.Android.DebugRuntime/lib/libmonosgen-2.0.so in /data/data/Mono.Android.DebugRuntime/lib
W/NativeHelper( 98): at com.android.internal.content.NativeLibraryHelper.copyNativeBinaryLI(NativeLibraryHelper.java:289)
If messages like the above are present, remove the Mono.Android.DebugRuntime package (adb uninstall Mono.Android.DebugRuntime), remove some extra apps from your device (to free up space), and try re-installing your app from the IDE.