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
Related
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.
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.
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
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.
I'm trying to get some unit tests up for my Android apps. I was following the Hello, Testing tutorial from the Android dev center, but it's giving me a message that reads:
Test run failed: Test run incomplete. Expected 1 tests, received 0
Here's the code I have:
public class LoginTest extends ActivityInstrumentationTestCase2<Login> {
Activity mActivity;
EditText mLoginTxt;
EditText mPwdTxt;
Button mLoginBtn;
Button mClearBtn;
public LoginTest(String pkg, Class<Login> activityClass) {
super("pkg_name", Login.class);
}
#Override
public void setUp() throws Exception {
super.setUp();
}
public void testPreconditions() {
}
public void testClear() {
assertTrue(true);
}
Here's the console output:
[2011-08-23 12:21:12 - <AppNameTest>] ------------------------------
[2011-08-23 12:21:12 - <AppNameTest>] Android Launch!
[2011-08-23 12:21:12 - <AppNameTest>] adb is running normally.
[2011-08-23 12:21:12 - <AppNameTest>] Performing android.test.InstrumentationTestRunner JUnit launch
[2011-08-23 12:21:12 - <AppNameTest>] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'AndroidHDPI'
[2011-08-23 12:21:14 - <AppNameTest>] Application already deployed. No need to reinstall.
[2011-08-23 12:21:14 - <AppNameTest>] Project dependency found, installing: <AppName>
[2011-08-23 12:21:16 - <AppNameTest>] Application already deployed. No need to reinstall.
[2011-08-23 12:21:16 - <AppNameTest>] Launching instrumentation android.test.InstrumentationTestRunner on device emulator-5554
[2011-08-23 12:21:18 - <AppNameTest>] Collecting test information
[2011-08-23 12:21:20 - <AppNameTest>] Test run failed: Test run incomplete. Expected 1 tests, received 0
And here's the LogCat output:
08-23 12:28:41.905: DEBUG/AndroidRuntime(1092): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
08-23 12:28:41.905: DEBUG/AndroidRuntime(1092): CheckJNI is ON
08-23 12:28:42.155: DEBUG/AndroidRuntime(1092): --- registering native functions ---
08-23 12:28:42.995: DEBUG/AndroidRuntime(1092): Shutting down VM
08-23 12:28:43.005: DEBUG/dalvikvm(1092): Debugger has detached; object registry had 1 entries
08-23 12:28:43.025: INFO/AndroidRuntime(1092): NOTE: attach of thread 'Binder Thread #3' failed
08-23 12:28:43.625: DEBUG/AndroidRuntime(1100): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
08-23 12:28:43.625: DEBUG/AndroidRuntime(1100): CheckJNI is ON
08-23 12:28:43.876: DEBUG/AndroidRuntime(1100): --- registering native functions ---
08-23 12:28:44.735: DEBUG/AndroidRuntime(1100): Shutting down VM
08-23 12:28:44.745: DEBUG/dalvikvm(1100): Debugger has detached; object registry had 1 entries
08-23 12:28:44.765: INFO/AndroidRuntime(1100): NOTE: attach of thread 'Binder Thread #3' failed
08-23 12:28:45.385: DEBUG/AndroidRuntime(1108): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
08-23 12:28:45.385: DEBUG/AndroidRuntime(1108): CheckJNI is ON
08-23 12:28:45.645: DEBUG/AndroidRuntime(1108): --- registering native functions ---
08-23 12:28:46.555: INFO/ActivityManager(59): Force stopping package com.PatientPoint.MCC uid=10038
08-23 12:28:46.625: INFO/ActivityManager(59): Start proc <pkg_name> for added application <pkg_name>: pid=1114 uid=10038 gids={3003}
08-23 12:28:47.196: INFO/TestRunner(1114): started: warning(junit.framework.TestSuite$1)
08-23 12:28:47.236: INFO/ActivityManager(59): Force stopping package <pkg_name> uid=10038
08-23 12:28:47.246: INFO/Process(59): Sending signal. PID: 1114 SIG: 9
08-23 12:28:47.355: DEBUG/AndroidRuntime(1108): Shutting down VM
08-23 12:28:47.375: DEBUG/jdwp(1108): Got wake-up signal, bailing out of select
08-23 12:28:47.375: DEBUG/dalvikvm(1108): Debugger has detached; object registry had 1 entries
08-23 12:28:47.415: INFO/AndroidRuntime(1108): NOTE: attach of thread 'Binder Thread #3' failed
Ok, looks like I was using the wrong constructor. I've made eclipse auto generate the code and it created this:
public LoginTest(String pkg, Class<Login> activityClass) {
super(pkg, Login.class);
}
However, upon changing it to this:
public LoginTest() {
super("pkg_name", Login.class);
}
it works fine. I'm not sure why, though, so if anyone can provide an explanation, I'd be happy to accept that as the answer. For everyone else encountering this error, all the online discussion around this seems to indicate that there's some error in your constructor.
i have removed the argument and now this is working try it.
public class LoginTest extends ActivityInstrumentationTestCase2<Login> {
Activity mActivity;
EditText mLoginTxt;
EditText mPwdTxt;
Button mLoginBtn;
Button mClearBtn;
public LoginTest() {
super("pkg_name", Login.class);
}
#Override
public void setUp() throws Exception {
super.setUp();
}
public void testPreconditions() {
}
public void testClear() {
assertTrue(true);
}