Map not loading anymore in Android app -
ive generated new api key android application , keeps crashing whenever try use part of app uses google maps.
does know problem be?
ive not changed code @ working flawlessly before updated api key.
thanks.
05-03 00:26:20.699: e/androidruntime(11859): fatal exception: main 05-03 00:26:20.699: e/androidruntime(11859): java.lang.runtimeexception: unable start activity componentinfo{com.example.menuexample/com.example.menuexample.routeviewactivity}: java.lang.nullpointerexception 05-03 00:26:20.699: e/androidruntime(11859): @ android.app.activitythread.performlaunchactivity(activitythread.java:2180) 05-03 00:26:20.699: e/androidruntime(11859): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2230) 05-03 00:26:20.699: e/androidruntime(11859): @ android.app.activitythread.access$600(activitythread.java:141) 05-03 00:26:20.699: e/androidruntime(11859): @ android.app.activitythread$h.handlemessage(activitythread.java:1234) 05-03 00:26:20.699: e/androidruntime(11859): @ android.os.handler.dispatchmessage(handler.java:99) 05-03 00:26:20.699: e/androidruntime(11859): @ android.os.looper.loop(looper.java:137) 05-03 00:26:20.699: e/androidruntime(11859): @ android.app.activitythread.main(activitythread.java:5041) 05-03 00:26:20.699: e/androidruntime(11859): @ java.lang.reflect.method.invokenative(native method) 05-03 00:26:20.699: e/androidruntime(11859): @ java.lang.reflect.method.invoke(method.java:511) 05-03 00:26:20.699: e/androidruntime(11859): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:793) 05-03 00:26:20.699: e/androidruntime(11859): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:560) 05-03 00:26:20.699: e/androidruntime(11859): @ dalvik.system.nativestart.main(native method) 05-03 00:26:20.699: e/androidruntime(11859): caused by: java.lang.nullpointerexception 05-03 00:26:20.699: e/androidruntime(11859): @ com.example.menuexample.routeviewactivity.setupmap(routeviewactivity.java:121) 05-03 00:26:20.699: e/androidruntime(11859): @ com.example.menuexample.routeviewactivity.setupmapifneeded(routeviewactivity.java:111) 05-03 00:26:20.699: e/androidruntime(11859): @ com.example.menuexample.routeviewactivity.oncreate(routeviewactivity.java:61) 05-03 00:26:20.699: e/androidruntime(11859): @ android.app.activity.performcreate(activity.java:5104) 05-03 00:26:20.699: e/androidruntime(11859): @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1080) 05-03 00:26:20.699: e/androidruntime(11859): @ android.app.activitythread.performlaunchactivity(activitythread.java:2144) 05-03 00:26:20.699: e/androidruntime(11859): ... 11 more
update:
ok seems problem location manager (returning null) :
locman = (locationmanager) getsystemservice(location_service); criteria criteria = new criteria(); provider = locman.getbestprovider(criteria, false); loc = locman.getlastknownlocation(provider);
manifest
<uses-permission android:name="android.permission.access_network_state" /> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.access_coarse_location" /> <uses-permission android:name="android.permission.access_fine_location" /> <uses-permission android:name="com.google.android.providers.gsf.permission.read_gservices" /> <uses-permission android:name="android.permission.get_accounts" /> <uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="com.google.android.c2dm.permission.receive" /> <uses-permission android:name="android.permission.vibrate" /> <uses-permission android:name="android.permission.wake_lock" />
ok locationmanager not getting location.
any appreciated. im stressing.
can see grids in mapview.if yes may not getting location.but if not getting , application crashes,check manifest following
<uses-library android:name=”com.google.android.maps” />
Comments
Post a Comment