Discussion Forums  >  Crashes, Memory Warnings

Replies: 9    Views: 131

Starmobi7
Aspiring developer
Profile
Posts: 5
Reg: Apr 17, 2012
London United K...
9,300
12/01/12 12:40 PM (11 years ago)

App always crashes when location button is pressed

Hello. I made an app but often crashes when I press the location button. when I press a button it just crashes and says: The application freds cab service( process com.fredscabservice) has stopped unexpectedly. Please try again 2.) The app has other buttons which work well when pressed but it’s the location button that constantly crashes. Any help would be nice :) Thank you! The log cat when the button for location is pressed is shown below: 12-01 17:00:16.268: E/dalvikvm(6894): Could not find class 'com.google.googlenav.map.TrafficService', referenced from method com.google.android.maps.MapActivity.createMap 12-01 17:00:16.268: E/dalvikvm(6894): Could not find class 'android.net.NetworkConnectivityListener', referenced from method com.google.android.maps.MapActivity.onCreate 12-01 17:00:22.818: E/AndroidRuntime(6894): FATAL EXCEPTION: main 12-01 17:00:22.818: E/AndroidRuntime(6894): java.lang.NoClassDefFoundError: android.net.NetworkConnectivityListener 12-01 17:00:22.818: E/AndroidRuntime(6894): at com.google.android.maps.MapActivity.onCreate(MapActivity.java:199) 12-01 17:00:22.818: E/AndroidRuntime(6894): at com.fredscabservice.BT_screen_map.onCreate(BT_screen_map.java:131) 12-01 17:00:22.818: E/AndroidRuntime(6894): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 12-01 17:00:22.818: E/AndroidRuntime(6894): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 12-01 17:00:22.818: E/AndroidRuntime(6894): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 12-01 17:00:22.818: E/AndroidRuntime(6894): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 12-01 17:00:22.818: E/AndroidRuntime(6894): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 12-01 17:00:22.818: E/AndroidRuntime(6894): at android.os.Handler.dispatchMessage(Handler.java:99) 12-01 17:00:22.818: E/AndroidRuntime(6894): at android.os.Looper.loop(Looper.java:123) 12-01 17:00:22.818: E/AndroidRuntime(6894): at android.app.ActivityThread.main(ActivityThread.java:4627) 12-01 17:00:22.818: E/AndroidRuntime(6894): at java.lang.reflect.Method.invokeNative(Native Method) 12-01 17:00:22.818: E/AndroidRuntime(6894): at java.lang.reflect.Method.invoke(Method.java:521) 12-01 17:00:22.818: E/AndroidRuntime(6894): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878) 12-01 17:00:22.818: E/AndroidRuntime(6894): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:636) 12-01 17:00:22.818: E/AndroidRuntime(6894): at dalvik.system.NativeStart.main(Native Method) 12-01 17:00:28.088: E/dalvikvm(6918): Could not find class 'com.google.googlenav.map.TrafficService', referenced from method com.google.android.maps.MapActivity.createMap 12-01 17:00:28.088: E/dalvikvm(6918): Could not find class 'android.net.NetworkConnectivityListener', referenced from method com.google.android.maps.MapActivity.onCreate 12-01 17:18:15.778: E/dalvikvm(6996): Could not find class 'com.google.googlenav.map.TrafficService', referenced from method com.google.android.maps.MapActivity.createMap 12-01 17:18:15.778: E/dalvikvm(6996): Could not find class 'android.net.NetworkConnectivityListener', referenced from method com.google.android.maps.MapActivity.onCreate
 
LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
like
12/01/12 02:41 PM (11 years ago)
Hi @Starmobi7, Check your manifest file and make sure your map activity is defined and make sure your using google api's. Hope this helps. LA
 
Starmobi7
Aspiring developer
Profile
Posts: 5
Reg: Apr 17, 2012
London United K...
9,300
like
12/01/12 05:32 PM (11 years ago)
Thanks LA. havve been at it for hours now, i am literary pulling my hair out. explains why iam bolding. I have added the map activity and yes am using google Api 8. Here is the view of the manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.fredscabservice" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="8"/> <!-- required device permissions --> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.READ_CONTACTS" /> <uses-permission android:name="android.permission.WRITE_CONTACTS" /> <!-- recommneded device features --> <uses-feature android:name="android.hardware.camera" android:required="false" /> <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" /> <uses-feature android:name="android.hardware.location" android:required="false" /> <uses-feature android:name="android.hardware.location.gps" android:required="false" /> <uses-feature android:name="android.hardware.telephony" android:required="false" /> <application android:name="fredscabservice_appDelegate" android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true" android:theme="@android:style/Theme.NoTitleBar"> <!-- activity root is the default, beginning activity --> <activity android:name="BT_activity_root" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation" android:excludeFromRecents="false" android:noHistory="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <!-- activities for general layout (tabbed or non-tabbed) --> <activity android:name=".BT_activity_base" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_activity_root_tabs" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <!-- remaining activities are for individual plugin types --> <activity android:name=".BT_screen_settingsDevice" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_customHTML" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_pptDoc" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_map" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_settingsLocation" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_menuListSimple" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_htmlDoc" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_excelDoc" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_wordDoc" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_splash" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_pdfDoc" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_customURL" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_blank" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_menuButtons" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_settingsLogIn" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BT_screen_quiz" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".WB_screen_menuImage" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".At53_video_player" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <activity android:name=".BTM_search" android:label="@string/app_name" android:configChanges="keyboardHidden|orientation"></activity> <!-- THE NEXT LINE IS ONLY USED IF MAPS ARE USED --> <uses-library android:name="com.google.android.maps"/> <activity android:name=".MapsActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> /> Any help appreciated thanks
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
12/01/12 05:33 PM (11 years ago)
Hi @Starmobi7, Welcome to buzztouch! This is an odd error because it generally just works. I'll assume that in your control panel you've set to Turn GPS On in the Core Properties section? And that you have your debug and/or release Google Maps API key set? And that you have a Google API 8 or newer target selected for your project? Have you added any additional code to your project? Mark
 
Starmobi7
Aspiring developer
Profile
Posts: 5
Reg: Apr 17, 2012
London United K...
9,300
like
12/01/12 05:43 PM (11 years ago)
Thanks Mark, i do not see the option to turn GPS on in the core properties section so i assume its off. i have both the debug and release map API keys and i am usin g google API 8. the only code i have added is that shown on the manifest in my previous post. (a map activity towards the end. hope this clarifies thanks in advance
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
12/01/12 05:49 PM (11 years ago)
In your app control panel, there is a link called "Core Properties." Click that, then find the "Start Tracking Location (turn on GPS)" section, and change to allow GPS. After that, trying syncing your control panel configuration file to your local one, and then run it again. Here is a link that shows how to sync them up: http://www.youtube.com/watch?v=Sp2vL1XCPC0 If you're still having problems, let me know. We'll work it out! Mark
 
LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
like
12/01/12 05:51 PM (11 years ago)
@Starmobi, The research I did shows one of two things: 1. Your manifest file is not setup correctly..ie..an instrument..which would allow maps connectivity or gps. 2. Google api, which you are using. LA
 
Starmobi7
Aspiring developer
Profile
Posts: 5
Reg: Apr 17, 2012
London United K...
9,300
like
12/02/12 04:48 PM (11 years ago)
Thanks LA, Thanks Mark. I have looked again at my manifest file. I downloaded a new Zip file of my project after i had turned on the GPS. I am happy to report that the App does not crash when click on the location button now. So tremendous progress. Turning on GPS in core properties has solved the crashing problem of my location screen. Hurray!!!!! When the location button is clicked i get a grid of squares with a pin. I am ecstatic for the progress. You guys are genius. Tomorrow i will look at ensuring the map begins to show. Thanks a bunch
 
LA
Aspiring developer
Profile
Posts: 3278
Reg: Aug 16, 2012
Jerseyville, IL
42,880
like
12/02/12 04:52 PM (11 years ago)
@Starmobi7, Happy to help. LA
 
Starmobi7
Aspiring developer
Profile
Posts: 5
Reg: Apr 17, 2012
London United K...
9,300
like
12/04/12 10:18 AM (11 years ago)
Looks like i celebrated too soon. just after i posted success, the old issue of "application has stopped unexpectedly. please try again" is still there when i connect my device to use as an emulator. The issue is not there in the AVD emulator I am using buzz touch version 2, Google API level 8 Android 2.2. Below are links to explain what i am getting; Video of my set up: Set up on Emulator: http://youtu.be/lp49JmGORsI Set up on htc device: http://youtu.be/AFKoRZa8smI error log when App closes unexpectedly. http://stargeneral.co.uk/errors/error%20log%20for%20app%20stopping%20unexpectedly.txt
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.