android opengl error (Application unexpectedly stopped) - java

I'm developing this game for android. I'm following a tutorial on how to make menus. And this is the code. There's no errors just warning in the code so I dont know what to do.
08-23 21:31:41.099: E/System(79): Failure starting core service
08-23 21:31:41.099: E/System(79): java.lang.SecurityException
08-23 21:31:41.099: E/System(79): at android.os.BinderProxy.transact(Native Method)
08-23 21:31:41.099: E/System(79): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
08-23 21:31:41.099: E/System(79): at android.os.ServiceManager.addService(ServiceManager.java:72)
08-23 21:31:41.099: E/System(79): at com.android.server.ServerThread.run(SystemServer.java:206)
08-23 21:31:41.139: E/EventHub(79): could not get driver version for /dev/input/mouse0, Not a typewriter
08-23 21:31:41.139: E/EventHub(79): could not get driver version for /dev/input/mice, Not a typewriter
08-23 21:31:42.049: E/SoundPool(79): error loading /system/media/audio/ui/Effect_Tick.ogg
08-23 21:31:42.049: E/SoundPool(79): error loading /system/media/audio/ui/KeypressStandard.ogg
08-23 21:31:42.069: E/SoundPool(79): error loading /system/media/audio/ui/KeypressSpacebar.ogg
08-23 21:31:42.069: E/SoundPool(79): error loading /system/media/audio/ui/KeypressDelete.ogg
08-23 21:31:42.079: E/SoundPool(79): error loading /system/media/audio/ui/KeypressReturn.ogg
08-23 21:31:42.159: E/UsbObserver(79): java.lang.NullPointerException
08-23 21:31:42.159: E/UsbObserver(79): at com.android.server.UsbObserver.init(UsbObserver.java:131)
08-23 21:31:42.159: E/UsbObserver(79): at com.android.server.UsbObserver.<init>(UsbObserver.java:65)
08-23 21:31:42.159: E/UsbObserver(79): at com.android.server.ServerThread.run(SystemServer.java:402)
08-23 21:31:47.820: E/ThrottleService(79): Could not open GPS configuration file /etc/gps.conf
08-23 21:31:47.880: E/ThrottleService(79): Error reading data file
08-23 21:31:49.250: E/logwrapper(194): executing /system/bin/tc failed: No such file or directory
08-23 21:31:49.320: E/logwrapper(195): executing /system/bin/tc failed: No such file or directory
08-23 21:31:49.370: E/logwrapper(196): executing /system/bin/tc failed: No such file or directory
08-23 21:31:57.759: E/logwrapper(225): executing /system/bin/tc failed: No such file or directory
08-23 21:31:57.889: E/logwrapper(226): executing /system/bin/tc failed: No such file or directory
08-23 21:31:58.000: E/logwrapper(227): executing /system/bin/tc failed: No such file or directory
08-23 21:32:41.593: E/MetadataRetrieverClient(34): failed to extract an album art
08-23 21:33:17.502: E/ThrottleService(79): Error reading data file
08-23 22:06:08.702: E/AndroidRuntime(414): FATAL EXCEPTION: GLThread 13
08-23 22:06:08.702: E/AndroidRuntime(414): java.lang.IllegalArgumentException: No EGLConfig found!
08-23 22:06:08.702: E/AndroidRuntime(414): at org.andengine.opengl.view.ConfigChooser.chooseConfig(ConfigChooser.java:183)
08-23 22:06:08.702: E/AndroidRuntime(414): at org.andengine.opengl.view.ConfigChooser.chooseConfig(ConfigChooser.java:157)
08-23 22:06:08.702: E/AndroidRuntime(414): at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:919)
08-23 22:06:08.702: E/AndroidRuntime(414): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1264)
08-23 22:06:08.702: E/AndroidRuntime(414): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)

if you are trying this in an emulator - it's probably not configured properly. See my answer to this question - Android AndEngine problems: java.lang.IllegalArgumentException: No EGLConfig Found

Changed already the target SDK, enable GPU Host, the processor to Intel. Still getting errors
08-25 01:41:48.889: ERROR/Zygote(793): setreuid() failed. errno: 30
08-25 01:42:01.820: ERROR/Zygote(793): setreuid() failed. errno: 30
08-25 01:42:04.430: ERROR/BatteryService(853): acOnlinePath not found
08-25 01:42:04.430: ERROR/BatteryService(853): usbOnlinePath not found
08-25 01:42:04.430: ERROR/BatteryService(853): batteryStatusPath not found
08-25 01:42:04.430: ERROR/BatteryService(853): batteryHealthPath not found
08-25 01:42:04.430: ERROR/BatteryService(853): batteryPresentPath not found
08-25 01:42:04.430: ERROR/BatteryService(853): batteryCapacityPath not found
08-25 01:42:04.430: ERROR/BatteryService(853): batteryVoltagePath not found
08-25 01:42:04.430: ERROR/BatteryService(853): batteryTemperaturePath not found
08-25 01:42:04.430: ERROR/BatteryService(853): batteryTechnologyPath not found
08-25 01:42:04.770: ERROR/EGL_emulation(853): rcMakeCurrent returned EGL_FALSE
08-25 01:42:04.770: ERROR/EGL_emulation(853): tid 874: eglMakeCurrent(984): error 0x3006 (EGL_BAD_CONTEXT)
08-25 01:42:04.770: ERROR/libEGL(853): call to OpenGL ES API with no current context (logged once per thread)
08-25 01:42:04.770: ERROR/libEGL(853): call to OpenGL ES API with no current context (logged once per thread)
08-25 01:42:04.770: ERROR/libEGL(853): call to OpenGL ES API with no current context (logged once per thread)
08-25 01:42:04.770: ERROR/libEGL(853): call to OpenGL ES API with no current context (logged once per thread)
08-25 01:43:01.773: ERROR/Zygote(889): setreuid() failed. errno: 30

Related

WebView Activity crashes on missing Chrome package

My app has been working fine for several years on the Play Store.
The main activity's layout XML contains a WebView.
Recently, the app has begun to crash at launch time (but not always, and not on every device).
The Logcat shows a RuntimeException on WebViewFactory about Package not found: com.android.chrome.
I don't explicitly use this system class. The crash occurs whether the WebView is part of the XML layout, or instantiated programmatically. No try/catch will help.
06-26 18:22:52.560 1363 1409 I ActivityManager: Displayed com.my.app/.MyActivity: +46ms
06-26 18:22:52.829 1363 6524 D ActivityManager: # addPackageDependency # packageName=com.android.chrome -> proc: ProcessRecord{e72ceb3 9789:com.my.app/u0a214}
06-26 18:22:52.839 9789 9789 I WebViewFactory: Loading com.android.chrome version 75.0.3770.101 (code 377010137)
--------- beginning of crash
06-26 18:22:52.903 9789 10122 E AndroidRuntime: FATAL EXCEPTION: Thread-2
06-26 18:22:52.903 9789 10122 E AndroidRuntime: Process: com.my.app, PID: 9789
06-26 18:22:52.903 9789 10122 E AndroidRuntime: java.lang.RuntimeException: Package not found: com.android.chrome
06-26 18:22:52.903 9789 10122 E AndroidRuntime: at android.webkit.WebViewDelegate.getPackageId(WebViewDelegate.java:164)
06-26 18:22:52.903 9789 10122 E AndroidRuntime: at xZ.a(PG:16)
06-26 18:22:52.903 9789 10122 E AndroidRuntime: at xq.run(PG:14)
06-26 18:22:52.903 9789 10122 E AndroidRuntime: at java.lang.Thread.run(Thread.java:764)
06-26 18:22:52.908 9789 9789 I cr_LibraryLoader: Time to load native libraries: 3 ms (timestamps 7584-7587)
06-26 18:22:52.909 9789 10123 D OSTracker: OS Event: crash
06-26 18:22:52.844 1363 6524 D ActivityManager: # addPackageDependency # packageName=com.android.chrome -> proc: ProcessRecord{e72ceb3 9789:com.my.app/u0a214}
06-26 18:22:52.911 1363 3290 W ActivityManager: Force finishing activity com.my.app/.MyActivity
(I replaced my package name with com.my.app in the above log, for clarity.)
None of these lines are my own Log strings. It's all system's.
The crashing device do have the Chrome APK installed, and the WebView implementation is defined to be Chrome.
It seems to me that, at the time of app launch, the com.android.chrome dependency is not yet ready, and the system fails to load and bind it to my process.
Is there a way to force preloading the dependency?
Thanks.

App crashes in emulator using libgdx and tween engine

I'm currently working on a project and so far only have the splash and main screen done. I wanted to see how it would run in an Android environment so I ran it as an Android Application. The emulator booted up just fine but when it load the app or "Uploading Project-android.apk onto device 'emulator-5554'
Installing Project-android.apk..." it prompts up that it "Unfortunately, Project has stopped. Here I copied the logcat for reference.
06-26 23:33:53.190: D/dalvikvm(1808): Not late-enabling CheckJNI (already on)
06-26 23:33:53.280: D/dalvikvm(1808): Trying to load lib /data/app- lib/com.levellabs.project.android-2/libgdx.so 0xb1fbed48
06-26 23:33:53.280: D/dalvikvm(1808): Added shared lib /data/app- lib/com.levellabs.project.android-2/libgdx.so 0xb1fbed48
06-26 23:33:53.280: D/dalvikvm(1808): No JNI_OnLoad found in /data/app- lib/com.levellabs.project.android-2/libgdx.so 0xb1fbed48, skipping init
06-26 23:33:53.280: D/(1808): HostConnection::get() New Host Connection established 0xb90f3dc0, tid 1808
06-26 23:33:53.460: I/AndroidInput(1808): sensor listener setup
06-26 23:33:53.550: W/EGL_emulation(1808): eglSurfaceAttrib not implemented
06-26 23:33:53.550: D/OpenGLRenderer(1808): Enabling debug mode 0
06-26 23:33:53.560: D/(1808): HostConnection::get() New Host Connection established 0xb910b590, tid 1823
06-26 23:33:53.600: W/GL2JNIView(1808): creating OpenGL ES 2.0 context
06-26 23:33:53.800: D/dalvikvm(1808): Trying to load lib /data/app- lib/com.levellabs.project.android-2/libgdx.so 0xb1fbed48
06-26 23:33:53.800: D/dalvikvm(1808): Shared lib '/data/app- lib/com.levellabs.project.android-2/libgdx.so' already loaded in same CL 0xb1fbed48
06-26 23:33:53.800: I/GL2(1808): all initialized 2
06-26 23:33:53.800: I/AndroidGraphics(1808): OGL renderer: Android Emulator OpenGL ES Translator (GeForce GTX 770/PCIe/SSE2)
06-26 23:33:53.800: I/AndroidGraphics(1808): OGL vendor: Google (NVIDIA Corporation)
06-26 23:33:53.800: I/AndroidGraphics(1808): OGL version: OpenGL ES 2.0 (4.5.0 NVIDIA 350.12)
06-26 23:33:53.800: I/AndroidGraphics(1808): OGL extensions: GL_EXT_debug_marker GL_OES_EGL_image GL_OES_EGL_image_external GL_OES_depth24 GL_OES_depth32 GL_OES_element_index_uint GL_OES_texture_float GL_OES_texture_float_linear GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_packed_depth_stencil GL_OES_vertex_half_float GL_OES_texture_npot GL_OES_rgb8_rgba8
06-26 23:33:53.800: E/EGL_emulation(1808): [getAttribValue] Bad attribute idx
06-26 23:33:53.800: E/EGL_emulation(1808): tid 1823: eglGetConfigAttrib(605): error 0x3004 (EGL_BAD_ATTRIBUTE)
06-26 23:33:53.800: E/EGL_emulation(1808): [getAttribValue] Bad attribute idx
06-26 23:33:53.800: E/EGL_emulation(1808): tid 1823: eglGetConfigAttrib(605): error 0x3004 (EGL_BAD_ATTRIBUTE)
06-26 23:33:53.800: I/AndroidGraphics(1808): framebuffer: (5, 6, 5, 0)
06-26 23:33:53.800: I/AndroidGraphics(1808): depthbuffer: (24)
06-26 23:33:53.800: I/AndroidGraphics(1808): stencilbuffer: (0)
06-26 23:33:53.800: I/AndroidGraphics(1808): samples: (0)
06-26 23:33:53.800: I/AndroidGraphics(1808): coverage sampling: (false)
06-26 23:33:53.810: I/AndroidGraphics(1808): Managed meshes/app: { }
06-26 23:33:53.810: I/AndroidGraphics(1808): Managed textures/app: { }
06-26 23:33:53.810: I/AndroidGraphics(1808): Managed cubemap/app: { }
06-26 23:33:53.810: I/AndroidGraphics(1808): Managed shaders/app: { }
06-26 23:33:53.810: I/AndroidGraphics(1808): Managed buffers/app: { }
06-26 23:33:55.540: I/dalvikvm(1808): Could not find method aurelienribon.tweenengine.TweenManager.update, referenced from method com.levellabs.project.GameScreen.render
06-26 23:33:55.540: W/dalvikvm(1808): VFY: unable to resolve virtual method 369: Laurelienribon/tweenengine/TweenManager;.update (F)V
06-26 23:33:55.540: D/dalvikvm(1808): VFY: replacing opcode 0x6e at 0x0008
06-26 23:33:55.540: D/dalvikvm(1808): GC_FOR_ALLOC freed 407K, 14% free 2931K/3392K, paused 2ms, total 2ms
06-26 23:33:55.540: E/dalvikvm(1808): Could not find class 'aurelienribon.tweenengine.TweenManager', referenced from method com.levellabs.project.GameScreen.show
06-26 23:33:55.540: W/dalvikvm(1808): VFY: unable to resolve new-instance 100 (Laurelienribon/tweenengine/TweenManager;) in Lcom/levellabs/project/GameScreen;
06-26 23:33:55.540: D/dalvikvm(1808): VFY: replacing opcode 0x22 at 0x001e
06-26 23:33:55.540: D/dalvikvm(1808): DexOpt: unable to opt direct call 0x0170 at 0x20 in Lcom/levellabs/project/GameScreen;.show
06-26 23:33:55.540: I/dalvikvm(1808): Failed resolving Lcom/levellabs/project/tween/SpriteAccessor; interface 98 'Laurelienribon/tweenengine/TweenAccessor;'
06-26 23:33:55.540: W/dalvikvm(1808): Link of class 'Lcom/levellabs/project/tween/SpriteAccessor;' failed
06-26 23:33:55.540: D/dalvikvm(1808): DexOpt: unable to opt direct call 0x345e at 0x29 in Lcom/levellabs/project/GameScreen;.show
06-26 23:33:55.540: I/dalvikvm(1808): Failed resolving Lcom/levellabs/project/GameScreen$1; interface 99 'Laurelienribon/tweenengine/TweenCallback;'
06-26 23:33:55.540: W/dalvikvm(1808): Link of class 'Lcom/levellabs/project/GameScreen$1;' failed
06-26 23:33:55.540: D/dalvikvm(1808): DexOpt: unable to opt direct call 0x3434 at 0x54 in Lcom/levellabs/project/GameScreen;.show
06-26 23:33:55.660: D/dalvikvm(1808): GC_FOR_ALLOC freed 71K, 9% free 3192K/3472K, paused 2ms, total 2ms
06-26 23:33:56.120: W/dalvikvm(1808): threadid=11: thread exiting with uncaught exception (group=0xb1cecb20)
06-26 23:33:56.120: E/AndroidRuntime(1808): FATAL EXCEPTION: GLThread 75
06-26 23:33:56.120: E/AndroidRuntime(1808): Process: com.levellabs.project.android, PID: 1808
06-26 23:33:56.120: E/AndroidRuntime(1808): java.lang.NoClassDefFoundError: aurelienribon.tweenengine.TweenManager
06-26 23:33:56.120: E/AndroidRuntime(1808): at com.levellabs.project.GameScreen.show(GameScreen.java:68)
06-26 23:33:56.120: E/AndroidRuntime(1808): at com.badlogic.gdx.Game.setScreen(Game.java:61)
06-26 23:33:56.120: E/AndroidRuntime(1808): at com.levellabs.project.Project.create(Project.java:24)
06-26 23:33:56.120: E/AndroidRuntime(1808): at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphi cs.java:241)
06-26 23:33:56.120: E/AndroidRuntime(1808): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1512)
06-26 23:33:56.120: E/AndroidRuntime(1808): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
06-26 23:33:56.130: I/AndroidInput(1808): sensor listener tear down
06-26 23:33:56.130: I/AndroidGraphics(1808): Managed meshes/app: { }
06-26 23:33:56.130: I/AndroidGraphics(1808): Managed textures/app: { }
06-26 23:33:56.130: I/AndroidGraphics(1808): Managed cubemap/app: { }
06-26 23:33:56.130: I/AndroidGraphics(1808): Managed shaders/app: { }
06-26 23:33:56.130: I/AndroidGraphics(1808): Managed buffers/app: { }
I think your jar file version which has some native functions does not matches the libgdx.so file version which does not have that method. Better you compile the c++ libgdx library using Android NDK to match the native functions. I got this from your error
No JNI_OnLoad found in /data/app- lib/com.levellabs.project.android-2/libgdx.so 0xb1fbed48, skipping init
......
......
Could not find method aurelienribon.tweenengine.TweenManager.update, referenced from method com.levellabs.project.GameScreen.render
This means some of the native methods are not properly binded by the JNI
If you are running inside an emulator, you need corresponding .so files live libgdx.....so files
Refer this Android ndk + libgdx
If you want the ready made JAR files and .so files download here http://libgdx.badlogicgames.com/nightlies/dist/
You can see there are 11 JAR files and folders like armeabi/ armeabi-v7a/ x86/
Go through the README files for further setup needs and compilations steps.
There is also a success comment here Libgdx tween not working on Android
You can also download the Demo App https://java-universal-tween-engine.googlecode.com/files/tween-engine-demo-6.3.0.zip and check the libs folder inside it for the JAR files
If you need more help, ping me via https://chat.stackoverflow.com/rooms/50272/androidians chat room, I will help you

NullPointerException in Android when declaring a Content Provider

I'm facing a strange issue when declaring a Content Provider in my project. I'm copying the classes and Manifest declaration from another project of my own. It's working OK on my other project.
Here's part of my Manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.qr"
android:installLocation="auto"
android:versionCode="540"
android:versionName="5.4" >
(...)
<application
android:name=".Application"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:logo="#drawable/ic_launch" >
(...)
<provider
android:name=".provider.HistoryProvider"
android:authorities="com.example.qr.History"
android:exported="true"
android:multiprocess="true"
android:readPermission="com.example.qr.History.read"
android:writePermission="com.example.qr.History.write" />
(...)
</application>
</manifest>
When I run my app, I get this stack trace:
FATAL EXCEPTION: main
java.lang.NullPointerException
at android.app.ActivityThread.installProvider(ActivityThread.java:4783)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4430)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4372)
at android.app.ActivityThread.access$1300(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5039)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
This is the whole stack trace. No 'com.example' trace is included. Of course some code in my app is producing this but the actual crash happens in Android.
Because my own classes are not included in the stack trace, I really don't know where to look.
I've run the code in an emulator with Android 4.2 and I've compared it with the source code of that version of Android, so I know the crash is produced in this line of ActivityThread:
4782 ApplicationInfo ai = info.applicationInfo;
4783 if (context.getPackageName().equals(ai.packageName)) {
Here's a link to the source code of this class.
If I don't declare the content provider (i.e. if I remove from my Manifest), the app works perfectly.
I've added some logs to my Application class, as well as the main Activity class. The crash is produced before either is launched.
So, my question is: what in my code can be producing context, context.getPackageName() or info.applicationInfo to be null during installation?
EDIT
When triggering the stack trace in the emulator several times, I only get this between traces:
09-11 23:10:21.250: E/AndroidRuntime(933): at dalvik.system.NativeStart.main(Native Method)
09-11 23:10:21.470: D/dalvikvm(933): GC_CONCURRENT freed 142K, 9% free 2951K/3224K, paused 78ms+3ms, total 225ms
09-11 23:10:44.030: I/Process(933): Sending signal. PID: 933 SIG: 9
09-11 23:10:46.940: D/dalvikvm(947): GC_CONCURRENT freed 164K, 10% free 2711K/2996K, paused 13ms+114ms, total 201ms
09-11 23:10:47.170: I/ActivityThread(947): Pub com.example.qr.History: com.example.qr.provider.HistoryProvider
09-11 23:10:47.170: D/AndroidRuntime(947): Shutting down VM
09-11 23:10:47.170: W/dalvikvm(947): threadid=1: thread exiting with uncaught exception (group=0x40a70930)
09-11 23:10:47.180: E/AndroidRuntime(947): FATAL EXCEPTION: main

Application crashes when is executed using Google maps api v2

I am trying to basically load a map using Google maps api v2 so i can start working on a more complex application.
My problem is that i followed all the instructions in:
https://developers.google.com/maps/documentation/android/
to setup the new settings for the google map api v2 that uses Google play lib.
Everything is set up fine but when i run the application it crashes(myapp stoped working)
I am using intellij so the applications was signed through "build|Generate signed apk" and to get my SHA1 code i used the file that is generated when the Generate signed apk is selected. I created a new project in Google console named MapTest to get the api key and placed that in the manifest as specified.
Now i know that the emulators usually are missing some staff such as the openGL ES so i installed the app on my phone (Galaxy s2) and the application is still crashing.
ps the google play lib was added
Emulator is google api 15 and everything is updated to latest versions.
Any help or input is deeply appreciated.
Bellow i am including my xml files so you can see if there is anything wrong.
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"
>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.MapFragment"/>
</LinearLayout>
AndroidManifest xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.MapTest"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:targetSdkVersion="15" android:minSdkVersion="8"/>
<application android:label="#string/app_name" android:icon="#drawable/ic_launcher">
<uses-library android:name="com.google.android.maps"/>
<activity android:name="MyActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="my api key goes here"/>
</application>
<permission
android:name="com.example.MapTest.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.example.MapTest.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
</manifest>
MyActivity class
nothing really change tho included just in case
package com.example.MapTest;
import android.app.Activity;
import android.os.Bundle;
import com.google.android.gms.maps.MapFragment;
public class MyActivity extends Activity {
/**
* Called when the activity is first created.
*/
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
the log of the emulator
01-09 22:16:54.269: DEBUG/AndroidRuntime(1779): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
01-09 22:16:54.269: DEBUG/AndroidRuntime(1779): CheckJNI is ON
01-09 22:16:55.766: DEBUG/AndroidRuntime(1779): Calling main entry com.android.commands.pm.Pm
01-09 22:16:56.059: DEBUG/dalvikvm(1031): GC_EXPLICIT freed 416K, 15% free 11721K/13703K, paused 9ms+19ms
01-09 22:16:56.099: WARN/ActivityManager(1031): No content provider found for permission revoke: file:///data/local/tmp/com.example.MapTest
01-09 22:16:56.139: WARN/ActivityManager(1031): No content provider found for permission revoke: file:///data/local/tmp/com.example.MapTest
01-09 22:16:56.379: INFO/PackageManager(1031): Removing non-system package:com.example.MapTest
01-09 22:16:56.379: INFO/ActivityManager(1031): Force stopping package com.example.MapTest uid=10044
01-09 22:16:56.529: INFO/PackageManager(1031): Package com.example.MapTest codePath changed from /data/app/com.example.MapTest-2.apk to /data/app/com.example.MapTest-1.apk; Retaining data and using new
01-09 22:16:56.529: INFO/PackageManager(1031): Running dexopt on: com.example.MapTest
01-09 22:16:57.781: DEBUG/dalvikvm(1790): DexOpt: load 230ms, verify+opt 493ms
01-09 22:16:57.809: WARN/PackageManager(1031): Code path for pkg : com.example.MapTest changing from /data/app/com.example.MapTest-2.apk to /data/app/com.example.MapTest-1.apk
01-09 22:16:57.809: WARN/PackageManager(1031): Resource path for pkg : com.example.MapTest changing from /data/app/com.example.MapTest-2.apk to /data/app/com.example.MapTest-1.apk
01-09 22:16:57.829: INFO/ActivityManager(1031): Force stopping package com.example.MapTest uid=10044
01-09 22:16:57.939: DEBUG/PackageManager(1031): New package installed in /data/app/com.example.MapTest-1.apk
01-09 22:16:57.949: WARN/PackageManager(1031): Unknown permission android.permission.ADD_SYSTEM_SERVICE in package com.android.phone
01-09 22:16:57.949: WARN/PackageManager(1031): Unknown permission com.android.smspush.WAPPUSH_MANAGER_BIND in package com.android.phone
01-09 22:16:57.959: WARN/PackageManager(1031): Unknown permission com.android.vending.billing.BILLING_ACCOUNT_SERVICE in package com.google.android.gsf.login
01-09 22:16:57.959: WARN/PackageManager(1031): Unknown permission com.android.vending.billing.ADD_CREDIT_CARD in package com.google.android.gsf.login
01-09 22:16:57.959: WARN/PackageManager(1031): Unknown permission com.android.vending.billing.IBillingAccountService.BIND2 in package com.google.android.gsf.login
01-09 22:16:57.959: WARN/PackageManager(1031): Not granting permission android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS to package com.android.browser (protectionLevel=2 flags=0x9be45)
01-09 22:16:57.959: WARN/PackageManager(1031): Not granting permission android.permission.BIND_APPWIDGET to package com.android.widgetpreview (protectionLevel=3 flags=0x28be44)
01-09 22:16:57.989: WARN/PackageManager(1031): Unknown permission com.android.providers.im.permission.READ_ONLY in package com.google.android.apps.maps
01-09 22:16:57.989: WARN/PackageManager(1031): Not granting permission android.permission.DEVICE_POWER to package com.android.deskclock (protectionLevel=2 flags=0x8be45)
01-09 22:16:58.299: DEBUG/dalvikvm(1031): GC_CONCURRENT freed 544K, 15% free 11758K/13703K, paused 9ms+12ms
01-09 22:16:58.489: INFO/ActivityManager(1031): Force stopping package com.example.MapTest uid=10044
01-09 22:16:58.639: DEBUG/dalvikvm(1126): GC_EXPLICIT freed 250K, 7% free 11414K/12231K, paused 5ms+7ms
01-09 22:16:58.869: DEBUG/dalvikvm(1166): GC_EXPLICIT freed 172K, 4% free 9398K/9735K, paused 10ms+9ms
01-09 22:16:59.159: DEBUG/dalvikvm(1031): GC_EXPLICIT freed 191K, 15% free 11704K/13703K, paused 7ms+14ms
01-09 22:16:59.259: DEBUG/PackageManager(1031): generateServicesMap(android.accounts.AccountAuthenticator): 3 services unchanged
01-09 22:16:59.409: DEBUG/PackageManager(1031): generateServicesMap(android.content.SyncAdapter): 5 services unchanged
01-09 22:16:59.431: DEBUG/BackupManagerService(1031): Received broadcast Intent { act=android.intent.action.PACKAGE_REMOVED dat=package:com.example.MapTest flg=0x10000010 (has extras) }
01-09 22:16:59.459: DEBUG/PackageManager(1031): generateServicesMap(android.accounts.AccountAuthenticator): 3 services unchanged
01-09 22:16:59.479: DEBUG/PackageManager(1031): generateServicesMap(android.content.SyncAdapter): 5 services unchanged
01-09 22:16:59.599: DEBUG/BackupManagerService(1031): Received broadcast Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.example.MapTest flg=0x10000010 (has extras) }
01-09 22:16:59.629: VERBOSE/BackupManagerService(1031): updatePackageParticipantsLocked: #1
01-09 22:17:00.642: WARN/RecognitionManagerService(1031): no available voice recognition services found
01-09 22:17:00.889: DEBUG/BackupManagerService(1031): Received broadcast Intent { act=android.intent.action.PACKAGE_REPLACED dat=package:com.example.MapTest flg=0x10000010 (has extras) }
01-09 22:17:00.889: VERBOSE/BackupManagerService(1031): updatePackageParticipantsLocked: #1
01-09 22:17:01.519: DEBUG/dalvikvm(1031): GC_EXPLICIT freed 528K, 14% free 11847K/13703K, paused 7ms+17ms
01-09 22:17:02.069: DEBUG/AndroidRuntime(1779): Shutting down VM
01-09 22:17:02.089: INFO/AndroidRuntime(1779): NOTE: attach of thread 'Binder Thread #3' failed
01-09 22:17:02.089: DEBUG/dalvikvm(1779): GC_CONCURRENT freed 101K, 78% free 456K/2048K, paused 2ms+4ms
01-09 22:17:02.099: DEBUG/jdwp(1779): Got wake-up signal, bailing out of select
01-09 22:17:02.099: DEBUG/dalvikvm(1779): Debugger has detached; object registry had 1 entries
01-09 22:17:02.789: DEBUG/AndroidRuntime(1795): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
01-09 22:17:02.789: DEBUG/AndroidRuntime(1795): CheckJNI is ON
01-09 22:17:03.949: DEBUG/AndroidRuntime(1795): Calling main entry com.android.commands.am.Am
01-09 22:17:03.989: INFO/ActivityManager(1031): START {flg=0x10000000 cmp=com.example.MapTest/.MyActivity} from pid 1795
01-09 22:17:04.029: WARN/WindowManager(1031): Failure taking screenshot for (180x300) to layer 21005
01-09 22:17:04.111: DEBUG/AndroidRuntime(1795): Shutting down VM
01-09 22:17:04.139: DEBUG/dalvikvm(1806): Not late-enabling CheckJNI (already on)
01-09 22:17:04.139: INFO/AndroidRuntime(1795): NOTE: attach of thread 'Binder Thread #3' failed
01-09 22:17:04.159: DEBUG/dalvikvm(1795): GC_CONCURRENT freed 101K, 77% free 486K/2048K, paused 1ms+5ms
01-09 22:17:04.159: DEBUG/jdwp(1795): Got wake-up signal, bailing out of select
01-09 22:17:04.159: DEBUG/dalvikvm(1795): Debugger has detached; object registry had 1 entries
01-09 22:17:04.209: INFO/ActivityManager(1031): Start proc com.example.MapTest for activity com.example.MapTest/.MyActivity: pid=1806 uid=10044 gids={3003, 1015}
01-09 22:17:04.649: WARN/NetworkManagementSocketTagger(1031): setKernelCountSet(10044, 1) failed with errno -2
01-09 22:17:05.269: INFO/Process(1031): Sending signal. PID: 1806 SIG: 3
01-09 22:17:05.309: INFO/dalvikvm(1806): threadid=3: reacting to signal 3
01-09 22:17:05.429: INFO/dalvikvm(1806): Wrote stack traces to '/data/anr/traces.txt'
01-09 22:17:05.599: WARN/dalvikvm(1806): VFY: unable to resolve static field 40 (MapAttrs) in Lcom/google/android/gms/R$styleable;
01-09 22:17:05.599: DEBUG/dalvikvm(1806): VFY: replacing opcode 0x62 at 0x000e
01-09 22:17:05.609: DEBUG/AndroidRuntime(1806): Shutting down VM
01-09 22:17:05.609: WARN/dalvikvm(1806): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
01-09 22:17:05.629: ERROR/AndroidRuntime(1806): FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable
at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)
at android.app.Activity.onCreateView(Activity.java:4242)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:673)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
at android.app.Activity.setContentView(Activity.java:1835)
at com.example.MapTest.MyActivity.onCreate(MyActivity.java:13)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
at android.app.ActivityThread.access$600(ActivityThread.java:123)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4424)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
01-09 22:17:05.649: WARN/ActivityManager(1031): Force finishing activity com.example.MapTest/.MyActivity
01-09 22:17:05.659: WARN/WindowManager(1031): Failure taking screenshot for (180x300) to layer 21010
01-09 22:17:05.680: INFO/Process(1031): Sending signal. PID: 1806 SIG: 3
01-09 22:17:05.680: INFO/dalvikvm(1806): threadid=3: reacting to signal 3
01-09 22:17:05.699: INFO/dalvikvm(1806): Wrote stack traces to '/data/anr/traces.txt'
01-09 22:17:06.169: WARN/ActivityManager(1031): Activity pause timeout for ActivityRecord{4146dc60 com.example.MapTest/.MyActivity}
01-09 22:17:06.209: INFO/Process(1031): Sending signal. PID: 1806 SIG: 3
01-09 22:17:06.209: INFO/dalvikvm(1806): threadid=3: reacting to signal 3
01-09 22:17:06.229: INFO/dalvikvm(1806): Wrote stack traces to '/data/anr/traces.txt'
01-09 22:17:06.589: WARN/NetworkManagementSocketTagger(1031): setKernelCountSet(10044, 0) failed with errno -2
01-09 22:17:07.899: INFO/Process(1806): Sending signal. PID: 1806 SIG: 9
01-09 22:17:07.919: INFO/ActivityManager(1031): Process com.example.MapTest (pid 1806) has died.
01-09 22:17:08.109: WARN/InputManagerService(1031): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#414b9608
At the moment it is not possible to run Google Android Maps v2 on emulator (see response from Android devs here). You should use real device instead.
However, you can look for updates in this thread - looks like someone managed to create emulator which supports Google Android Maps v2
EDIT:
I can see some problem in your code:
You should extend android.support.v4.app.FragmentActivity, but not regular Activity class.
Also make sure you have added GooglePlayServices project (actually imported entire project) but not just a jar file. If you are using Eclipse, import the library project into your workspace. Click File > Import, select Android > Existing Android Code into Workspace, and browse to the copy of the library project to import it.
I finally fixed the problem. Google has a very bad tutorial. First of all thank you Pavel Dudka for the big help.
i imported google play lib as module and then google play lib as jar then i also added onother jar file android.suport.v4.jar were is can be found as the name is exmaple android\suppor\v4
After those modifications and with the recomentations the map did not work so i added the modified fragment bellow instead of using the one google provited and the map worked like a charm.
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="wrap_content"
android:layout_height="match_parent" />

Exception while using ksoap2-android

I have a problem regarding the ksoap2. My problem is that the project used to work well up to the time that I had to format my pc and set it up again.
I don't remember what version I had referenced in my application but I tried many of them and the problem still occurs.
04-05 13:56:18.289: E/dalvikvm(495): Could not find class 'org.ksoap2.serialization.SoapObject', referenced from method com.giatrosofia.Activity_Votana$ConnectAndGetLst.doInBackground
04-05 13:56:18.289: W/dalvikvm(495): VFY: unable to resolve new-instance 223 (Lorg/ksoap2/serialization/SoapObject;) in Lcom/giatrosofia/Activity_Votana$ConnectAndGetLst;
04-05 13:56:18.289: D/dalvikvm(495): VFY: replacing opcode 0x22 at 0x0000
04-05 13:56:29.627: W/dalvikvm(495): threadid=9: thread exiting with uncaught exception (group=0x40014760)
04-05 13:56:29.809: E/AndroidRuntime(495): FATAL EXCEPTION: AsyncTask #1
04-05 13:56:29.809: E/AndroidRuntime(495): java.lang.RuntimeException: An error occured while executing doInBackground()
04-05 13:56:29.809: E/AndroidRuntime(495): at android.os.AsyncTask$3.done(AsyncTask.java:266)
04-05 13:56:29.809: E/AndroidRuntime(495): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
04-05 13:56:29.809: E/AndroidRuntime(495): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
04-05 13:56:29.809: E/AndroidRuntime(495): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
04-05 13:56:29.809: E/AndroidRuntime(495): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
04-05 13:56:29.809: E/AndroidRuntime(495): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1081)
04-05 13:56:29.809: E/AndroidRuntime(495): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:574)
04-05 13:56:29.809: E/AndroidRuntime(495): at java.lang.Thread.run(Thread.java:1020)
04-05 13:56:29.809: E/AndroidRuntime(495): Caused by: java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject
The referenced file is ksoap2-android-assembly-2.6.2-jar-with-dependencies.jar
and the excpetion occured in
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
Here are the referenced jar files
Am I missing someging?
if you are using new ADT 17
then create one directory on root of your project named libs
and just copy and paste ksop jar into libs dir.
res
bin
libs --> your.jar file here
as new updated it will work well.
You can try to add the KSOAP2 to your "Order and Export" tab. To do that:
01- Right click on the name of your project
02- Click on Properties
03- Select Java Build Path
04- Check if the KSOAP Library is already on the Libraries Tab
05- Click on the Order and Export tab and check the checkbox next to ksoap2-android-assembly.
Export your project again and try it. It should work now.

Categories