Application stopped unexpectedly on launch - no compilation errors in Eclipse - android

My application for Android (API level 8+) is compiled without any error messages in Eclipse.
The console says:
[2011-08-04 16:10:50 - PROJECT_NAME] Android Launch!
[2011-08-04 16:10:50 - PROJECT_NAME] adb is running normally.
[2011-08-04 16:10:50 - PROJECT_NAME] Performing PACKAGE_NAME.MainActivity activity launch
[2011-08-04 16:10:52 - PROJECT_NAME] Uploading PROJECT_NAME.apk onto device '80A354043048365763'
[2011-08-04 16:10:52 - PROJECT_NAME] Installing PROJECT_NAME.apk...
[2011-08-04 16:10:55 - PROJECT_NAME] Success!
[2011-08-04 16:10:55 - PROJECT_NAME] Starting activity PACKAGE_NAME.MainActivity on device DEVICE_ID
[2011-08-04 16:10:56 - PROJECT_NAME] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=PACKAGE_NAME/.MainActivity }
This is what is always displayed there. The application is then started on my USB-connected Android device.
It used to work fine, until at some point in the developing process the following message appeared:.
Sorry! The application Messages (process PACKAGE_NAME) has stopped unexpectedly. Please try again. Force close.
In the background, there is the application window - but without any GUI elements: no buttons, no text. Just the application's title on the top.
I don't know why this message appears. I cannot test my application anymore. And - as I already said - there are no errors in Eclipse.
Logcat says the following:
08-04 16:35:27.666: INFO/ActivityManager(2365): Force stopping package PACKAGE_NAME uid=10077
08-04 16:35:27.676: INFO/ActivityManager(2365): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=PACKAGE_NAME/.MainActivity }
08-04 16:35:27.726: WARN/Flex(2448): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:27.766: INFO/ActivityManager(2365): Start proc PACKAGE_NAME for activity PACKAGE_NAME/.MainActivity: pid=4262 uid=10077 gids={3003}
08-04 16:35:27.916: WARN/ActivityThread(4262): Application PACKAGE_NAME is waiting for the debugger on port 8100...
08-04 16:35:27.926: INFO/System.out(4262): Sending WAIT chunk
08-04 16:35:28.016: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:28.016: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:28.016: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:28.016: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:28.016: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] 0. mDataNetType: 2
08-04 16:35:28.016: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] curNetwork=26203 curHPLMN=26203
08-04 16:35:28.126: INFO/System.out(4262): Debugger has connected
08-04 16:35:28.136: INFO/System.out(4262): waiting for debugger to settle...
08-04 16:35:28.336: INFO/System.out(4262): waiting for debugger to settle...
08-04 16:35:28.536: INFO/System.out(4262): waiting for debugger to settle...
08-04 16:35:28.736: INFO/System.out(4262): waiting for debugger to settle...
08-04 16:35:28.936: INFO/System.out(4262): waiting for debugger to settle...
08-04 16:35:29.141: INFO/System.out(4262): waiting for debugger to settle...
08-04 16:35:29.336: INFO/System.out(4262): waiting for debugger to settle...
08-04 16:35:29.539: INFO/System.out(4262): waiting for debugger to settle...
08-04 16:35:29.739: INFO/System.out(4262): waiting for debugger to settle...
08-04 16:35:29.945: INFO/System.out(4262): waiting for debugger to settle...
08-04 16:35:30.146: INFO/System.out(4262): debugger has settled (1340)
08-04 16:35:31.016: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:31.016: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:31.016: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:31.016: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:31.026: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] 0. mDataNetType: 2
08-04 16:35:31.026: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] curNetwork=26203 curHPLMN=26203
08-04 16:35:34.016: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:34.016: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:34.016: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:34.016: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:34.026: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] 0. mDataNetType: 2
08-04 16:35:34.026: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] curNetwork=26203 curHPLMN=26203
08-04 16:35:37.016: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:37.016: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:37.016: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:37.016: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:37.026: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] 0. mDataNetType: 2
08-04 16:35:37.026: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] curNetwork=26203 curHPLMN=26203
08-04 16:35:37.697: WARN/ActivityManager(2365): Launch timeout has expired, giving up wake lock!
08-04 16:35:37.894: WARN/ActivityManager(2365): Activity idle timeout for HistoryRecord{451e5930 PACKAGE_NAME/.MainActivity}
08-04 16:35:40.016: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:40.016: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:40.016: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:40.016: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:40.026: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] 0. mDataNetType: 2
08-04 16:35:40.026: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] curNetwork=26203 curHPLMN=26203
08-04 16:35:43.017: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:43.017: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:43.017: WARN/Flex(2365): getString FLEX_COUNTRY_CODE COM
08-04 16:35:43.017: WARN/Flex(2365): getString FLEX_OPERATOR_CODE OPEN
08-04 16:35:43.026: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] 0. mDataNetType: 2
08-04 16:35:43.026: DEBUG/StatusBarPolicy(2365): [BRIGHTHY] curNetwork=26203 curHPLMN=26203
I hope somebody can help me ... :) I'm almost desperate. Thank you very much in advance!
Edit #1:
When I run the application in Eclipse's debug mode, the error message doesn't appear. The application window appears but without any GUI elements. And I have to close the window using the HOME button. The BACK button doesn't work. And in the application settings I can choose "Force Stop". So is there any problem with threads maybe? Maybe the application got stuck?
Edit #2:
It doesn't seem to be an Eclipse problem or phone problem as I am still able to create a "Hello World" app. It even runs on the phone.
Edit #3:
My main activity starts as follows:
public class MainActivity extends ListActivity {
When I change this to ...
public class MainActivity extends Activity {
... and comment out the following line, the application is shown without any error messages:
setListAdapter(this.m_adapter);
Edit #4:
I think I can remember again what I changed before the problem occurred for the first time: I implemented the code of a tutorial on ListViews which worked fine. But then I changed the ID of the listview (see tutorial: main.xml) from "android:list" to "resultList". So this was probably the cause.
When I change it back now, the error occurrs in initiateSearch() where it says thread.notifyAll();
When I comment out this line, everything works without any errors, but the application does not what it should do anymore, of course.

Having talked to Marco it turns out the error was to do with the id naming of the List element in the xml.
http://developer.android.com/reference/android/app/ListActivity.html - "...To do this, your own view MUST contain a ListView object with the id '#android:id/list' ..."
Eclipse is a bit rubbish sometimes!!
Things I would try in order:
Clean projects
Restart Eclipse
Completely remove the application and data & cache from your handset
On your phone go in to your settings-> Applications-> Development and disable then re-enable USB Debugging
Restart your phone
Rebuild your eclipse workspace
Let me know if any of those help

Related

OpenGl renderer on Android

I am trying to make a simple renderer with OpenGL2.0, made up only of a main activity, surface view, and renderer file. Whenever I run it on an avd, the screen turns black and says the program has encountered a problem. Here is the logcat
08-04 03:55:59.722: D/libEGL(6287): Emulator without GPU support detected. Fallback to software renderer.
08-04 03:55:59.821: I/Choreographer(6287): Skipped 292 frames! The application may be doing too much work on its main thread.
08-04 03:56:00.042: D/libEGL(6287): loaded /system/lib/egl/libGLES_android.so
08-04 03:56:00.801: D/gralloc_goldfish(6287): Emulator without GPU emulation detected.
08-04 03:56:00.835: W/dalvikvm(6287): threadid=11: thread exiting with uncaught exception (group=0x40a71930)
08-04 03:56:00.881: E/AndroidRuntime(6287): FATAL EXCEPTION: GLThread 102
08-04 03:56:00.881: E/AndroidRuntime(6287): java.lang.IllegalArgumentException: No configs match configSpec
08-04 03:56:00.881: E/AndroidRuntime(6287): at android.opengl.GLSurfaceView$BaseConfigChooser.chooseConfig(GLSurfaceView.java:863)
08-04 03:56:00.881: E/AndroidRuntime(6287): at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:1024)
08-04 03:56:00.881: E/AndroidRuntime(6287): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1401)
08-04 03:56:00.881: E/AndroidRuntime(6287): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
08-04 03:56:02.155: I/Choreographer(6287): Skipped 121 frames! The application may be doing too much work on its main thread.
08-04 03:56:07.941: I/Process(6287): Sending signal. PID: 6287 SIG: 9
Can the problem be recognized from this or should I provide code as well?

InApp Billing: Caller uid is different

I'm trying to implement InApp billing. When I open the Play Store on my HTC Desire running (custom rom, rooted) GB, I get a message "An error occured, please try again". In the logcat, it says this:
08-04 19:58:59.920: I/ActivityManager(178): Starting: Intent { act=android.intent.action.VIEW cmp=com.android.vending/com.google.android.finsky.activities.IabActivity (has extras) } from pid -1
08-04 19:58:59.940: I/dalvikvm(1274): Could not find method android.accounts.AccountManager.newChooseAccountIntent, referenced from method com.google.android.finsky.activities.AuthenticatedActivity.chooseAccount
08-04 19:58:59.940: W/dalvikvm(1274): VFY: unable to resolve static method 7: Landroid/accounts/AccountManager;.newChooseAccountIntent (Landroid/accounts/Account;Ljava/util/ArrayList;[Ljava/lang/String;ZLjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Landroid/os/Bundle;)Landroid/content/Intent;
08-04 19:58:59.940: D/dalvikvm(1274): VFY: replacing opcode 0x77 at 0x0021
08-04 19:58:59.940: D/dalvikvm(1274): VFY: dead code 0x0024-0029 in Lcom/google/android/finsky/activities/AuthenticatedActivity;.chooseAccount (Z)V
08-04 19:58:59.950: I/dalvikvm(1274): Could not find method com.google.android.finsky.activities.AuthenticatedActivity.recreate, referenced from method com.google.android.finsky.activities.AuthenticatedActivity.restart
08-04 19:58:59.950: W/dalvikvm(1274): VFY: unable to resolve virtual method 2843: Lcom/google/android/finsky/activities/AuthenticatedActivity;.recreate ()V
08-04 19:58:59.950: D/dalvikvm(1274): VFY: replacing opcode 0x6e at 0x0009
08-04 19:59:00.090: D/ResourceType(1274): calling getConfigurations
08-04 19:59:00.090: D/ResourceType(1274): called getConfigurations size=321
08-04 19:59:00.251: I/ActivityManager(178): Displayed com.android.vending/com.google.android.finsky.activities.IabActivity: +318ms
08-04 19:59:00.271: D/Finsky(1274): [1] DownloadImpl.setState: self-update-download from null to UNQUEUED.
08-04 19:59:00.271: D/Finsky(1274): [1] DownloadQueueImpl.add: Download self-update-download added to DownloadQueue
08-04 19:59:00.281: D/Finsky(1274): [1] DownloadImpl.setState: self-update-download from UNQUEUED to QUEUED.
08-04 19:59:00.341: I/installd(136): free_cache(0) avail 249487360
08-04 19:59:00.421: D/dalvikvm(1274): GC_CONCURRENT freed 909K, 50% free 3393K/6727K, external 2025K/2118K, paused 4ms+3ms
08-04 19:59:00.531: D/Finsky(1274): [1] DownloadQueueImpl.startDownload: Download self-update-download starting
08-04 19:59:00.651: D/Finsky(1274): [1] GetBillingCountriesAction.run: Skip getting fresh list of billing countries.
08-04 19:59:00.651: D/Finsky(1274): [1] DownloadImpl.setState: self-update-download from QUEUED to DOWNLOADING.
08-04 19:59:00.651: D/Finsky(1274): [1] DownloadQueueImpl.notifyProgress: self-update-download: onProgress 0/-1 Status: 190.
08-04 19:59:00.681: D/Finsky(1274): [1] DownloadQueueImpl.onStart: self-update-download: onStart
08-04 19:59:00.691: W/Finsky(1274): [1] CarrierParamsAction.run: Saving carrier billing params failed.
08-04 19:59:00.701: D/Finsky(1274): [1] CarrierProvisioningAction.shouldFetchProvisioning: Required CarrierBillingParams missing. Shouldn't fetch provisioning.
08-04 19:59:00.711: D/Finsky(1274): [1] CarrierProvisioningAction.run: No need to fetch provisioning from carrier.
08-04 19:59:00.721: W/AccountManagerService(178): caller uid 10005 is different than the authenticator's uid
08-04 19:59:00.721: E/Volley(1274): [32] 1.run: Caught SecurityException: caller uid 10005 is different than the authenticator's uid
08-04 19:59:00.771: D/Finsky(1274): [1] CheckoutPurchase.onErrorReceived: Could not retrieve Checkout auth token: caller uid 10005 is different than the authenticator's uid
08-04 19:59:00.771: E/Finsky(1274): [1] CheckoutPurchase.setError: type=UNKNOWN, code=-1, message=An error occurred. Please try again.
08-04 19:59:00.861: D/Finsky(1274): [1] MarketBillingService.sendResponseCode: Sending response RESULT_DEVELOPER_ERROR for request 8575012147884887212 to com.haarman.inapptest.
08-04 19:59:00.901: D/Finsky(1274): [1] DownloadQueueImpl.notifyProgress: self-update-download: onProgress 0/-1 Status: 192.
On my Asus TF101 running (custom rom, rooted) ICS, it does work.
On an HTC One V running stock ICS, it does work.
On an HTC Legend running (custom rom, rooted) GB, it does work.
So only on my HTC Desire it doesn't, work, which, frankly, is my main device. I've tried to reset the device to factory defaults, but that didn't help.
What's happening here?
Apparently, the Play Store on my Desire didn't update automatically. It was running 3.5.x, I had to manually push 3.5.17 for it to work.

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

Android Mono '/data/data/Mono.Android.DebugRuntime/lib/libmonosgen-2.0.so' not found

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.

Unit testing Android Apps on Eclipse + jUnit - Test run failed: Test run incomplete. Expected 1 tests, received 0

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);
}

Categories

Resources