Android dalvikvm thread still suspended. Can't start debugging - android

I have the following problem. I had a stable version of my android application and started adding code. When debugging the edited version of the app it threw an illegal argument exception. So i decided to comment out all the new code, but after that i could not launch the app.
The logcat shows that the thread is still suspended and i tried several solutions i found like remove all breakpoints and clean the project.
Problem: I can't launch my app
Can anyone explain why this happens and how to solve it?
Console:
[2015-02-27 21:42:16 - CaveExplorer] ------------------------------
[2015-02-27 21:42:16 - CaveExplorer] Android Launch!
[2015-02-27 21:42:16 - CaveExplorer] adb is running normally.
[2015-02-27 21:42:16 - CaveExplorer] Performing com.jeroenb.caveexplorer.CaveExplorerActivity activity launch
[2015-02-27 21:42:16 - CaveExplorer] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2015-02-27 21:42:18 - CaveExplorer] Uploading CaveExplorer.apk onto device '901b509d'
[2015-02-27 21:42:19 - CaveExplorer] Installing CaveExplorer.apk...
[2015-02-27 21:42:31 - CaveExplorer] Success!
[2015-02-27 21:42:32 - CaveExplorer] Starting activity com.jeroenb.caveexplorer.CaveExplorerActivity on device 901b509d
[2015-02-27 21:42:32 - CaveExplorer] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.jeroenb.caveexplorer/.CaveExplorerActivity }
[2015-02-27 21:42:32 - CaveExplorer] Attempting to connect debugger to 'com.jeroenb.caveexplorer' on port 8600
Logcat:
02-27 21:43:00.597: D/ActivityThread(5318): handleBindApplication:com.jeroenb.caveexplorer
02-27 21:43:00.597: D/ActivityThread(5318): setTargetHeapUtilization:0.75
02-27 21:43:00.597: D/ActivityThread(5318): setTargetHeapMinFree:2097152
02-27 21:43:00.607: I/System.out(5318): Sending WAIT chunk
02-27 21:43:00.607: W/ActivityThread(5318): Application com.jeroenb.caveexplorer is waiting for the debugger on port 8100...
02-27 21:43:00.617: I/dalvikvm(5318): Debugger is active
02-27 21:43:00.807: I/System.out(5318): Debugger has connected
02-27 21:43:00.807: I/System.out(5318): waiting for debugger to settle...
02-27 21:43:01.007: I/System.out(5318): waiting for debugger to settle...
02-27 21:43:01.217: I/System.out(5318): waiting for debugger to settle...
02-27 21:43:01.417: I/System.out(5318): waiting for debugger to settle...
02-27 21:43:01.617: I/System.out(5318): waiting for debugger to settle...
02-27 21:43:01.817: I/System.out(5318): waiting for debugger to settle...
02-27 21:43:02.017: I/System.out(5318): waiting for debugger to settle...
02-27 21:43:02.217: I/System.out(5318): debugger has settled (1437)
02-27 21:43:02.287: I/Adreno-EGL(5318): <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LNX.LA.3.5.2.2_RB1.04.04.04.087.028_msm8974_LNX.LA.3.5.2.2_RB1__release_AU ()
02-27 21:43:02.287: I/Adreno-EGL(5318): OpenGL ES Shader Compiler Version: E031.24.00.15
02-27 21:43:02.287: I/Adreno-EGL(5318): Build Date: 07/31/14 Thu
02-27 21:43:02.287: I/Adreno-EGL(5318): Local Branch:
02-27 21:43:02.287: I/Adreno-EGL(5318): Remote Branch: quic/LNX.LA.3.5.2.2_rb1
02-27 21:43:02.287: I/Adreno-EGL(5318): Local Patches: NONE
02-27 21:43:02.287: I/Adreno-EGL(5318): Reconstruct Branch: AU_LINUX_ANDROID_LNX.LA.3.5.2.2_RB1.04.04.04.087.028 + NOTHING
02-27 21:43:02.337: D/OpenGLRenderer(5318): Enabling debug mode 0
02-27 21:43:03.547: D/dalvikvm(5318): threadid=1: still suspended after undo (sc=1 dc=1)
The stack trace, i hope it helps
DalvikVM [localhost:8600]
Thread [<1> main] (Suspended (exception IllegalArgumentException))
<VM does not provide monitor information>
Choreographer.doCallbacks(int, long) line: 584
Choreographer.doFrame(long, int) line: 544
Choreographer$FrameDisplayEventReceiver.run() line: 747
Handler.handleCallback(Message) line: 733
Choreographer$FrameHandler(Handler).dispatchMessage(Message) line: 95
Looper.loop() line: 136
ActivityThread.main(String[]) line: 5146
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 515
ZygoteInit$MethodAndArgsCaller.run() line: 732
ZygoteInit.main(String[]) line: 566
NativeStart.main(String[]) line: not available [native method]
Thread [<10> Binder_2] (Running)
Thread [<9> Binder_1] (Running)

Related

Cannot execute HelloJni app with Valgrind

I am trying to analyse a simple HelloJni project (built in Android Studio) using Valgrind and I am facing some troubles in the final steps when executing the application with Valgrind.
I am developing on a Nexus 4 device with Android 5.1.
Installation info:
I have used the "build_valgrind.sh" script to cross-compile valgrind (for api android-21) and to copy it to /data/local/Inst.
I have also copied "start_valgrind.sh" to /data/local/ folder, giving all permissions ("chmod 777) to the script.
Then I set properties to the HelloJni app.
adb shell "su -c 'setprop wrap.com.example.hellojni \"logwrapper /data/local/start_valgrind.sh \"'"
The actual problem comes when I try to execute the app:
adb shell "su -c 'am start -a android.intent.action.MAIN -n com.example.hellojni/.HelloJni'"
The logcat output I get is posted at the end.
When I execute the HelloJni app without setting logwrapper properties, it executes as expected. I am not sure what I am doing wrong, but it looks as if I have problems with "CheckJNI is OFF". Has someone been able to execute any application with this approach? Any help will be appreciated.
logcat_output
--------- beginning of main
I/Finsky (19498): [1] com.google.android.finsky.services.j.a(148): Installation state replication succeeded.
E/kickstart( 627): Wrote to /sys/power/wake_lock
E/kickstart( 627): Received file "/dev/block/platform/msm_sdcc.1/by-name/m9kefs1"
E/kickstart( 627): 786432 bytes transferred in 0.185s (4.06 MBps)
E/kickstart( 627): Successfully downloaded files from target
E/kickstart( 627): Wrote to /sys/power/wake_unlock
E/kickstart( 627): Sahara protocol completed
D/AndroidRuntime(22076): >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
D/AndroidRuntime(22076): CheckJNI is OFF
D/AndroidRuntime(22077): >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
D/AndroidRuntime(22077): CheckJNI is OFF
W/app_process32_o(22077): type=1400 audit(0.0:317): avc: denied { write } for name="system#framework#boot.art" dev="mmcblk0p23" ino=185108 scontext=u:r:shell:s0 tcontext=u:object_r:dalvikcache_data_file:s0 tclass=file
D/AndroidRuntime(22076): Calling main entry com.android.commands.am.Am
--------- beginning of system
I/ActivityManager(18563): START u0 {act=android.intent.action.MAIN flg=0x10000000 cmp=com.example.hellojni/.HelloJni} from uid 0 on display 0
V/WindowManager(18563): addAppToken: AppWindowToken{385169a4 token=Token{13e037 ActivityRecord{2ce09936 u0 com.example.hellojni/.HelloJni t3}}} to stack=1 task=3 at 0
D/AndroidRuntime(22077): Calling main entry com.android.commands.am.Am
I/art (22110): Late-enabling -Xcheck:jni
I/start_valgrind.sh(22127): valgrind: cannot create log file '/sdcard/valgrind.log.22128': Permission denied
I/start_valgrind.sh(22127): start_valgrind.sh terminated by exit(1)
W/Zygote (18317): Error reading pid from wrapped process, child may have died
W/Zygote (18317): java.io.EOFException
W/Zygote (18317): at libcore.io.Streams.readFully(Streams.java:83)
W/Zygote (18317): at java.io.DataInputStream.readInt(DataInputStream.java:103)
W/Zygote (18317): at com.android.internal.os.ZygoteConnection.handleParentProc(ZygoteConnection.java:979)
W/Zygote (18317): at com.android.internal.os.ZygoteConnection.runOnce(ZygoteConnection.java:276)
W/Zygote (18317): at com.android.internal.os.ZygoteInit.runSelectLoop(ZygoteInit.java:788)
W/Zygote (18317): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
I/ActivityManager(18563): Start proc 22110:com.example.hellojni/u0a125 for activity com.example.hellojni/.HelloJni
D/AndroidRuntime(22076): Shutting down VM
I/art (22076): Debugger is no longer active
D/AndroidRuntime(22077): Shutting down VM
I/art (22077): Debugger is no longer active
I/Zygote (18317): Process 22110 exited cleanly (1)
W/ActivityManager(18563): Process ProcessRecord{173c48d3 22110:com.example.hellojni/u0a125} failed to attach
I/ActivityManager(18563): Killing 22110:com.example.hellojni/u0a125 (adj -100): start timeout

Android project rename - won't launch now

After successful tests I've tried to rename my project / package from, 'test...' to something more relevant. I used the various Eclipse refactor helpers where possible. All the source files appear to have the right package at the top now, the manifest seems to have the right package name, etc. I performed a 'clean'.
All seemed well. Only problem is that it won't launch - doesn't even get to the activity onCreate() handler. It crashes at AvtivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line 2417.
Clearly something still has the old name in it, but I cannot find it.
Any suggestions where to look / what to do?
As requested: log cat (nothing in console):
07-14 07:00:04.149: D/AndroidRuntime(347): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<<br>
07-14 07:00:04.149: D/AndroidRuntime(347): CheckJNI is ON<br>
07-14 07:00:04.389: D/AndroidRuntime(347): --- registering native functions ---<br>
07-14 07:00:04.830: D/ddm-heap(347): Got feature list request<br>
07-14 07:00:05.239: D/AndroidRuntime(347): Shutting down VM<br>
07-14 07:00:05.250: D/dalvikvm(347): DestroyJavaVM waiting for non-daemon threads to exit<br>
07-14 07:00:05.250: D/dalvikvm(347): DestroyJavaVM shutting VM down<br>
07-14 07:00:05.250: D/dalvikvm(347): HeapWorker thread shutting down<br>
07-14 07:00:05.259: D/dalvikvm(347): HeapWorker thread has shut down<br>
07-14 07:00:05.259: D/jdwp(347): JDWP shutting down net...<br>
07-14 07:00:05.269: I/dalvikvm(347): Debugger has detached; object registry had 1 entries<br>
07-14 07:00:05.279: D/dalvikvm(347): VM cleaning up<br>
07-14 07:00:05.291: E/AndroidRuntime(347): ERROR: thread attach failed<br>
07-14 07:00:05.309: D/dalvikvm(347): LinearAlloc 0x0 used 629532 of 5242880 (12%)<br>
07-14 07:00:05.801: D/AndroidRuntime(355): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<<br>
07-14 07:00:05.809: D/AndroidRuntime(355): CheckJNI is ON<br>
07-14 07:00:06.049: D/AndroidRuntime(355): --- registering native functions ---<br>
07-14 07:00:06.490: D/ddm-heap(355): Got feature list request<br>
07-14 07:00:06.910: D/ActivityManager(52): Uninstalling process uk.co.nightshadearts.golfcaddy<br>
07-14 07:00:06.910: I/ActivityManager(52): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=uk.co.nightshadearts.golfcaddy/uk.co.nightshadearts.golfcaddy }<br>
07-14 07:00:06.969: D/AndroidRuntime(355): Shutting down VM<br>
07-14 07:00:06.969: D/dalvikvm(355): DestroyJavaVM waiting for non-daemon threads to exit<br>
07-14 07:00:07.009: E/AndroidRuntime(355): ERROR: thread attach failed<br>
07-14 07:00:07.009: D/dalvikvm(355): DestroyJavaVM shutting VM down<br>
07-14 07:00:07.009: D/dalvikvm(355): HeapWorker thread shutting down<br>
07-14 07:00:07.019: D/dalvikvm(355): HeapWorker thread has shut down<br>
07-14 07:00:07.019: D/jdwp(355): JDWP shutting down net...<br>
07-14 07:00:07.019: I/dalvikvm(355): Debugger has detached; object registry had 1 entries<br>
07-14 07:00:07.051: D/dalvikvm(355): VM cleaning up<br>
07-14 07:00:07.070: D/dalvikvm(355): LinearAlloc 0x0 used 639500 of 5242880 (12%)<br>
07-14 07:00:07.160: I/ActivityManager(52): Start proc uk.co.nightshadearts.golfcaddy for activity uk.co.nightshadearts.golfcaddy/uk.co.nightshadearts.golfcaddy: pid=362 uid=10031 gids={1015}<br>
07-14 07:00:07.309: D/ddm-heap(362): Got feature list request<br>
07-14 07:00:07.460: W/ActivityThread(362): Application uk.co.nightshadearts.golfcaddy is waiting for the debugger on port 8100...<br>
07-14 07:00:07.489: I/System.out(362): Sending WAIT chunk<br>
07-14 07:00:07.510: I/dalvikvm(362): Debugger is active<br>
07-14 07:00:07.750: I/System.out(362): Debugger has connected<br>
07-14 07:00:07.750: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:07.951: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:08.150: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:08.350: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:08.559: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:08.759: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:08.960: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:09.187: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:09.397: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:09.609: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:09.827: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:10.039: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:10.263: I/System.out(362): waiting for debugger to settle...<br>
07-14 07:00:10.479: I/System.out(362): debugger has settled (1449)<br>
07-14 07:00:10.681: E/gralloc(52): [unregister] handle 0x3fa718 still locked (state=40000001)<br>
07-14 07:00:17.029: W/ActivityManager(52): Launch timeout has expired, giving up wake lock!<br>
07-14 07:00:17.391: W/ActivityManager(52): Activity idle timeout for HistoryRecord{44f00a48 uk.co.nightshadearts.golfcaddy/uk.co.nightshadearts.golfcaddy}<br>
Calls:
GolfCaddy [Android Application]
DalvikVM[localhost:8610]
Thread [<3> main] (Suspended (exception RuntimeException))
ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2417
ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2512
ActivityThread.access$2200(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 119
ActivityThread$H.handleMessage(Message) line: 1863
ActivityThread$H(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123
ActivityThread.main(String[]) line: 4363
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 860
ZygoteInit.main(String[]) line: 618
NativeStart.main(String[]) line: not available [native method]
Thread [<13> Binder Thread #2] (Running)
Thread [<11> Binder Thread #1] (Running)
Answer:
Actually, I seem to have solved it, though I don't really know what I've fixed.
Following instructions fromn alextsc on app won't install after package rename I did the following:
Dumped the faulty project completely (deleted the project and the file tree) - fortunately I had the common sense to have copied the original before I did anything.
Copied the original back under 'workbench'.
Added a new project (original name) using create from existing source option.
That got it back and working.
Then rt clk on project and select Android Tools >> Rename application package, and let it do everything it wanted to.
Under src the package still had the old name, however. Used Eclipse refactor on that to change to the new name.
Still seems to work. All src files have the right package as well.
Renamed the (one) activity - still works. After that it was just more internal code modifactions line the XML app name.
Conclusion: Android Tools >> Rename application package did something, but I don't know what.
Moral: pick a name and stick to it in future.
Change the package name in manifest as
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.org.xxx" // your packagename here..
>
</manifest>
after changing this R.java will created once again under the new package and then you have to import R in all activity..
Try this, it may helpful to you..
Here is what I did.
In the Eclipse project "src" folder, you are going to have something called "com.test...", rename it to the new name and click OK. Then all the files should update automatically. At least it worked perfectly for me.
Please, remember that you have to change it in the Android Manifest as well.

Adding addmob adds to main.xml crashes my app

Let me start by saying that this app was working fine the day before. I have restarted the pc, removed the project and added a previous version of the project and it keeps crashing. If i remove this from main.xml which gets loaded from the mainactivity the app does not crash. If i have this in the main.xml :
<com.google.ads.AdView
android:id="#+id/adView"
android:layout_width="wrap_content"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
ads:adSize="BANNER"
ads:adUnitId="a14ee1ad68dcbdb"
ads:loadAdOnCreate="true" />
the app crashes. If i run the app and this code is not in the main.xml file but in other xml files the app works fine and it will show adds from other activities.
I tried removing all the code in the xml file and just have the above admob adds in there and it still crashed. I was thinking about uninstalling eclipse and installing it again???
Any ideas????
Here is a Everything from start to finish in logcat:
03-30 11:39:17.215: D/AndroidRuntime(338): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
03-30 11:39:17.215: D/AndroidRuntime(338): CheckJNI is ON
03-30 11:39:17.335: D/AndroidRuntime(338): --- registering native functions ---
03-30 11:39:17.825: D/AndroidRuntime(338): Shutting down VM
03-30 11:39:17.825: D/dalvikvm(338): Debugger has detached; object registry had 1 entries
03-30 11:39:17.845: I/AndroidRuntime(338): NOTE: attach of thread 'Binder Thread #3' failed
03-30 11:39:18.215: D/AndroidRuntime(346): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
03-30 11:39:18.215: D/AndroidRuntime(346): CheckJNI is ON
03-30 11:39:18.345: D/AndroidRuntime(346): --- registering native functions ---
03-30 11:39:18.835: I/ActivityManager(59): Force stopping package com.petermihaylov.android.cardcounter uid=10040
03-30 11:39:18.835: I/Process(59): Sending signal. PID: 331 SIG: 9
03-30 11:39:18.896: I/UsageStats(59): Unexpected resume of com.android.launcher while already resumed in com.petermihaylov.android.cardcounter
03-30 11:39:18.905: W/InputManagerService(59): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#45094eb8
03-30 11:39:18.945: I/ActivityManager(59): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.petermihaylov.android.cardcounter/.MainActivity }
03-30 11:39:18.945: D/AndroidRuntime(346): Shutting down VM
03-30 11:39:18.955: D/jdwp(346): Got wake-up signal, bailing out of select
03-30 11:39:18.955: D/dalvikvm(346): Debugger has detached; object registry had 1 entries
03-30 11:39:19.039: I/AndroidRuntime(346): NOTE: attach of thread 'Binder Thread #3' failed
03-30 11:39:19.155: I/ActivityManager(59): Start proc com.petermihaylov.android.cardcounter for activity com.petermihaylov.android.cardcounter/.MainActivity: pid=353 uid=10040 gids={3003}
03-30 11:39:19.345: D/dalvikvm(33): GC_EXPLICIT freed 285 objects / 10864 bytes in 186ms
03-30 11:39:19.475: W/ActivityThread(353): Application com.petermihaylov.android.cardcounter is waiting for the debugger on port 8100...
03-30 11:39:19.525: I/System.out(353): Sending WAIT chunk
03-30 11:39:19.565: I/dalvikvm(353): Debugger is active
03-30 11:39:19.595: D/dalvikvm(33): GC_EXPLICIT freed 47 objects / 2056 bytes in 249ms
03-30 11:39:19.745: I/System.out(353): Debugger has connected
03-30 11:39:19.745: I/System.out(353): waiting for debugger to settle...
03-30 11:39:19.945: I/System.out(353): waiting for debugger to settle...
03-30 11:39:20.075: D/dalvikvm(33): GC_EXPLICIT freed 2 objects / 64 bytes in 422ms
03-30 11:39:20.207: I/System.out(353): waiting for debugger to settle...
03-30 11:39:20.405: I/System.out(353): waiting for debugger to settle...
03-30 11:39:20.605: I/System.out(353): waiting for debugger to settle...
03-30 11:39:20.823: I/System.out(353): waiting for debugger to settle...
03-30 11:39:21.025: I/System.out(353): waiting for debugger to settle...
03-30 11:39:21.225: I/System.out(353): waiting for debugger to settle...
03-30 11:39:21.468: I/System.out(353): waiting for debugger to settle...
03-30 11:39:21.677: I/System.out(353): debugger has settled (1469)
03-30 11:39:29.005: W/ActivityManager(59): Launch timeout has expired, giving up wake lock!
03-30 11:39:29.421: W/ActivityManager(59): Activity idle timeout for HistoryRecord{450bae78 com.petermihaylov.android.cardcounter/.MainActivity}
Looks like you're trying to debug the app, and it's hanging on debug. Do you get any more relevant logs if you try to just run it?
Also, have you updated to r17 of the Android Tools by any chance? r17 of the tools force you to place the SDK in the libs/ folder of your project.
Are you sure you have stepped through a tutorial properly and added the permissions and imported the SDK?
Try stepping through this guide from the beginning:
https://developers.google.com/mobile-ads-sdk/docs/android/fundamentals
Cleaning the project in Eclipse sometimes solves some problems.
I had a very similar bizarre issue with Admob recently after a fresh install of Eclipse. After hours of looking into why, it ended up being my build order in the project preferences. I set the Google AdMob jar to the top, cleaned the project and all my issues were resolved.
The logcat text you have pasted does not give any error information. Can you paste the logcat text from the point of failure, generally you can see the communications with AdMob in here.
May help, just a thought.
New version of Android LED Clock just uploaded to the market
Jason

HelloWebView Sample: now using SDK 3 and getting killed

Updated: I have now included the logcat file below. Looking at it it appears I am still having a permission problems (06-05 14:10:36.593) - I am guessing the same problem I am having with SDK 7
Well I was trying to get the HelloWebview example working with SDK 7 with no success (see HelloWebView Sample: java.lang.SecurityException: Permission Denial thread), so I decided just out of curiosity to back off to SDK3 to see if I could learn anything. I have been able to get all the "Layout" samples to work and decided to try something a little harder.
Unfortunately, I still cannot get the simple HelloWebView app to run. I no longer get a Permission Denial but now the app is getting killed.
Killed usually implies that there are not enough resources (memory etc.) for an application to run.... Any thoughts? Are there any other log files I can look at either on my computer or on the emulator?
The main.xml, manifest, and console output are below. Let me know if you need more information.
Thanks,
Tim
main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<WebView
android:id="#+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</LinearLayout>
mainfest file:
<uses-permission android:name="android.permission.INTERNET" />
<uses-sdk android:minSdkVersion="3" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".HelloWebView3"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".HelloWebView3" android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
</activity>
</application>
Console output:
[2010-06-05 08:43:37 - HelloWebView3] ------------------------------
[2010-06-05 08:43:37 - HelloWebView3] Android Launch!
[2010-06-05 08:43:37 - HelloWebView3] adb is running normally.
[2010-06-05 08:43:37 - HelloWebView3] Performing com.example.hellowebview3.HelloWebView3 activity launch
[2010-06-05 08:43:37 - HelloWebView3] Automatic Target Mode: launching new emulator with compatible AVD 'Android1.5'
[2010-06-05 08:43:37 - HelloWebView3] Launching a new emulator with Virtual Device 'Android1.5'
[2010-06-05 08:43:42 - HelloWebView3] New emulator found: emulator-5554
[2010-06-05 08:43:42 - HelloWebView3] Waiting for HOME ('android.process.acore') to be launched...
[2010-06-05 08:45:04 - HelloWebView3] HOME is up on device 'emulator-5554'
[2010-06-05 08:45:04 - HelloWebView3] Uploading HelloWebView3.apk onto device 'emulator-5554'
[2010-06-05 08:45:04 - HelloWebView3] Installing HelloWebView3.apk...
[2010-06-05 08:45:19 - HelloWebView3] Success!
[2010-06-05 08:45:19 - HelloWebView3] Starting activity com.example.hellowebview3.HelloWebView3 on device
[2010-06-05 08:45:23 - HelloWebView3] ActivityManager: Starting: Intent { action=android.intent.action.MAIN categories={android.intent.category.LAUNCHER} comp={com.example.hellowebview3/com.example.hellowebview3.HelloWebView3} }
[2010-06-05 08:45:23 - HelloWebView3] ActivityManager: [1] Killed am start -n com....
logcat output:
06-05 14:10:33.963: DEBUG/AndroidRuntime(763): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
06-05 14:10:33.963: DEBUG/AndroidRuntime(763): CheckJNI is ON
06-05 14:10:34.232: INFO/jdwp(763): received file descriptor 20 from ADB
06-05 14:10:34.253: DEBUG/AndroidRuntime(763): --- registering native functions ---
06-05 14:10:35.013: DEBUG/AndroidRuntime(763): Shutting down VM
06-05 14:10:35.013: DEBUG/dalvikvm(763): DestroyJavaVM waiting for non-daemon threads to exit
06-05 14:10:35.022: DEBUG/dalvikvm(763): DestroyJavaVM shutting VM down
06-05 14:10:35.032: DEBUG/dalvikvm(763): HeapWorker thread shutting down
06-05 14:10:35.053: DEBUG/dalvikvm(763): HeapWorker thread has shut down
06-05 14:10:35.053: DEBUG/jdwp(763): JDWP shutting down net...
06-05 14:10:35.062: DEBUG/jdwp(763): +++ peer disconnected
06-05 14:10:35.062: INFO/dalvikvm(763): Debugger has detached; object registry had 2 entries
06-05 14:10:35.073: DEBUG/dalvikvm(763): VM cleaning up
06-05 14:10:35.102: WARN/dalvikvm(763): LinearAlloc 0x0 not freed: 0x410caa08 len=20
06-05 14:10:35.102: WARN/dalvikvm(763): LinearAlloc 0x0 not freed: 0x410caa20 len=340
06-05 14:10:35.112: WARN/dalvikvm(763): LinearAlloc 0x0 not freed: 0x410cab78 len=2244
06-05 14:10:35.112: DEBUG/dalvikvm(763): LinearAlloc 0x0 used 632420 of 4194304 (15%)
06-05 14:10:35.561: DEBUG/AndroidRuntime(772): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
06-05 14:10:35.561: DEBUG/AndroidRuntime(772): CheckJNI is ON
06-05 14:10:35.793: DEBUG/AndroidRuntime(772): --- registering native functions ---
06-05 14:10:35.803: INFO/jdwp(772): received file descriptor 20 from ADB
06-05 14:10:36.593: INFO/ActivityManager(579): Starting activity: Intent { action=android.intent.action.MAIN categories={android.intent.category.LAUNCHER} flags=0x10000000 comp={com.example.hellowebview3/com.example.hellowebview3.HelloWebView3} }
06-05 14:10:36.593: WARN/ActivityManager(579): Permission Denial: starting Intent { action=android.intent.action.MAIN categories={android.intent.category.LAUNCHER} flags=0x10000000 comp={com.example.hellowebview3/com.example.hellowebview3.HelloWebView3} } from null (pid=-1, uid=-1) requires null
06-05 14:10:36.602: DEBUG/AndroidRuntime(772): Shutting down VM
06-05 14:10:36.613: WARN/dalvikvm(772): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)
06-05 14:10:36.613: ERROR/AndroidRuntime(772): Uncaught handler: thread main exiting due to uncaught exception
06-05 14:10:36.623: ERROR/AndroidRuntime(772): *** EXCEPTION IN SYSTEM PROCESS. System will crash.
06-05 14:10:36.633: ERROR/AndroidRuntime(772): java.lang.SecurityException: Permission Denial: starting Intent { action=android.intent.action.MAIN categories={android.intent.category.LAUNCHER} flags=0x10000000 comp={com.example.hellowebview3/com.example.hellowebview3.HelloWebView3} } from null (pid=-1, uid=-1) requires null
06-05 14:10:36.633: ERROR/AndroidRuntime(772): at android.os.Parcel.readException(Parcel.java:1234)
06-05 14:10:36.633: ERROR/AndroidRuntime(772): at android.os.Parcel.readException(Parcel.java:1222)
06-05 14:10:36.633: ERROR/AndroidRuntime(772): at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1046)
06-05 14:10:36.633: ERROR/AndroidRuntime(772): at com.android.commands.am.Am.runStart(Am.java:199)
06-05 14:10:36.633: ERROR/AndroidRuntime(772): at com.android.commands.am.Am.run(Am.java:73)
06-05 14:10:36.633: ERROR/AndroidRuntime(772): at com.android.commands.am.Am.main(Am.java:51)
06-05 14:10:36.633: ERROR/AndroidRuntime(772): at com.android.internal.os.RuntimeInit.finishInit(Native Method)
06-05 14:10:36.633: ERROR/AndroidRuntime(772): at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:186)
06-05 14:10:36.633: ERROR/AndroidRuntime(772): at dalvik.system.NativeStart.main(Native Method)
06-05 14:10:36.661: ERROR/JavaBinder(772): Unknown binder error code. 0xfffffff7
06-05 14:10:36.661: ERROR/AndroidRuntime(772): Crash logging skipped, no checkin service
06-05 14:10:36.673: INFO/Process(772): Sending signal. PID: 772 SIG: 9
06-05 14:21:41.081: DEBUG/dalvikvm(626): GC freed 9840 objects / 555600 bytes in 106ms
There are any error messages you can look to. If you're using eclipse goto ddms perspective and open window logcat. (you can also directly display logcat without switching to the ddms perspective)
You have twice
<activity android:name=".HelloWebView3"
In your manifest

how to debug ExceptionInInitializationError?

I am getting an exception in a very simple 'study' application, so I expect the problem to be in my project setup, but I don't know how to debug ...
What is the context of the exception, "ExceptionInInitializationError"?
Where is it documented? A: Search Android Developers Guide
Stack trace from within Eclipse Debugger with: select thread -> right-click -> copy stack
Thread [<3> main] (Suspended (exception ExceptionInInitializerError))
Class.newInstance() line: 1479
Instrumentation.newActivity(ClassLoader, String, Intent) line: 1021
ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2367
ActivityThread.handleLaunchActivity(ActivityThread$ActivityRecord, Intent) line: 2470
ActivityThread.access$2200(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 119
ActivityThread$H.handleMessage(Message) line: 1821
ActivityThread$H(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123
ActivityThread.main(String[]) line: 4310
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 860
ZygoteInit.main(String[]) line: 618
NativeStart.main(String[]) line: not available [native method]
Here is the logcat:
I/ActivityManager( 52): Starting activity: Intent { flg=0x10000000 cmp=com.androidcode.study_wikinotes/.WikiNotes }
D/AndroidRuntime( 198): Shutting down VM
D/dalvikvm( 198): DestroyJavaVM waiting for non-daemon threads to exit
D/dalvikvm( 198): DestroyJavaVM shutting VM down
D/dalvikvm( 198): HeapWorker thread shutting down
D/dalvikvm( 198): HeapWorker thread has shut down
D/jdwp ( 198): JDWP shutting down net...
I/jdwp ( 198): adbd disconnected
D/dalvikvm( 198): VM cleaning up
E/AndroidRuntime( 198): ERROR: thread attach failed
I/ActivityManager( 52): Start proc com.androidcode.study_wikinotes for activity com.androidcode.study_wikinotes/.WikiNotes: pid=219 uid=10023 gids={}
D/dalvikvm( 198): LinearAlloc 0x0 used 634508 of 5242880 (12%)
D/ddm-heap( 155): Got feature list request
D/ddm-heap( 169): Got feature list request
D/ddm-heap( 183): Got feature list request
D/ddm-heap( 206): Got feature list request
D/ddm-heap( 219): Got feature list request
W/ActivityThread( 219): Application com.androidcode.study_wikinotes is waiting for the debugger on port 8100...
I/System.out( 219): Sending WAIT chunk
I/dalvikvm( 219): Debugger is active
I/System.out( 219): Debugger has connected
I/System.out( 219): waiting for debugger to settle...
I/System.out( 219): waiting for debugger to settle...
I/System.out( 219): waiting for debugger to settle...
I/System.out( 219): waiting for debugger to settle...
I/System.out( 219): waiting for debugger to settle...
I/System.out( 219): waiting for debugger to settle...
I/System.out( 219): waiting for debugger to settle...
I/System.out( 219): waiting for debugger to settle...
I/System.out( 219): waiting for debugger to settle...
I/System.out( 219): waiting for debugger to settle...
I/System.out( 219): waiting for debugger to settle...
I/System.out( 219): debugger has settled (1382)
W/dalvikvm( 219): Exception Ljava/util/regex/PatternSyntaxException; thrown during Lcom/androidcode/study_wikinotes/WikiNotes;.<clinit>
W/dalvikvm( 219): Class init failed in newInstance call (Lcom/androidcode/study_wikinotes/WikiNotes;)
Ahh ... I have an incomplete class in WikiNotes. Would you say the answer is to "start with logcat"? :) Thanks for the help. Go ahead and add your answer and I will accept it.
Yes the first thing to do when debugging in Android is to start by looking in LogCat.

Categories

Resources