LibGDX Android app violates API usage policies - android

After submitting my Android app, created with LibGDX 1.9.10, I started getting loads of crashes.
After some investigations, I found that the crashes are coming from devices with Android 9 and higher (API level 28). It works fine on lower version Androids.
Investigating further, the errors I find seem to indicate that the errors are caused by LibGDX's Android launcher violating API usage policies in place since Android 9:
https://developer.android.com/distribute/best-practices/develop/restrictions-non-sdk-interfaces
"Starting in Android 9 (API level 28), the platform restricts which
non-SDK interfaces your app can use."
The errors I see look like this:
03-10 06:25:33.602: D/StrictMode(27425): StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Ljava/nio/NIOAccess;->getBasePointer(Ljava/nio/Buffer;)J
03-10 06:25:33.602: D/StrictMode(27425): at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
03-10 06:25:33.602: D/StrictMode(27425): at android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidGL20.init(Native Method)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidGraphics.<init>(Unknown Source:86)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidGraphics.<init>(Unknown Source:1)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidApplication.init(Unknown Source:30)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidApplication.initialize(Unknown Source:1)
03-10 06:25:33.602: D/StrictMode(27425): at my-libgdx-app.AndroidLauncher.onCreate(Unknown Source:97)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.Activity.performCreate(Activity.java:7327)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.Activity.performCreate(Activity.java:7318)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
03-10 06:25:33.602: D/StrictMode(27425): at androidx.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:187)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3087)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3250)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1947)
03-10 06:25:33.602: D/StrictMode(27425): at android.os.Handler.dispatchMessage(Handler.java:106)
03-10 06:25:33.602: D/StrictMode(27425): at android.os.Looper.loop(Looper.java:214)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread.main(ActivityThread.java:7032)
03-10 06:25:33.602: D/StrictMode(27425): at java.lang.reflect.Method.invoke(Native Method)
03-10 06:25:33.602: D/StrictMode(27425): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
03-10 06:25:33.602: D/StrictMode(27425): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
03-10 06:25:33.602: D/StrictMode(27425): StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Ljava/nio/NIOAccess;->getBaseArray(Ljava/nio/Buffer;)Ljava/lang/Object;
03-10 06:25:33.602: D/StrictMode(27425): at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
03-10 06:25:33.602: D/StrictMode(27425): at android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidGL20.init(Native Method)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidGraphics.<init>(Unknown Source:86)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidGraphics.<init>(Unknown Source:1)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidApplication.init(Unknown Source:30)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidApplication.initialize(Unknown Source:1)
03-10 06:25:33.602: D/StrictMode(27425): at my-libgdx-app.AndroidLauncher.onCreate(Unknown Source:97)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.Activity.performCreate(Activity.java:7327)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.Activity.performCreate(Activity.java:7318)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
03-10 06:25:33.602: D/StrictMode(27425): at androidx.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:187)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3087)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3250)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1947)
03-10 06:25:33.602: D/StrictMode(27425): at android.os.Handler.dispatchMessage(Handler.java:106)
03-10 06:25:33.602: D/StrictMode(27425): at android.os.Looper.loop(Looper.java:214)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread.main(ActivityThread.java:7032)
03-10 06:25:33.602: D/StrictMode(27425): at java.lang.reflect.Method.invoke(Native Method)
03-10 06:25:33.602: D/StrictMode(27425): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
03-10 06:25:33.602: D/StrictMode(27425): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
03-10 06:25:33.602: D/StrictMode(27425): StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Ljava/nio/NIOAccess;->getBaseArrayOffset(Ljava/nio/Buffer;)I
03-10 06:25:33.602: D/StrictMode(27425): at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
03-10 06:25:33.602: D/StrictMode(27425): at android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidGL20.init(Native Method)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidGraphics.<init>(Unknown Source:86)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidGraphics.<init>(Unknown Source:1)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidApplication.init(Unknown Source:30)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidApplication.initialize(Unknown Source:1)
03-10 06:25:33.602: D/StrictMode(27425): at my-libgdx-app.AndroidLauncher.onCreate(Unknown Source:97)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.Activity.performCreate(Activity.java:7327)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.Activity.performCreate(Activity.java:7318)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
03-10 06:25:33.602: D/StrictMode(27425): at androidx.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:187)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3087)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3250)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1947)
03-10 06:25:33.602: D/StrictMode(27425): at android.os.Handler.dispatchMessage(Handler.java:106)
03-10 06:25:33.602: D/StrictMode(27425): at android.os.Looper.loop(Looper.java:214)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread.main(ActivityThread.java:7032)
03-10 06:25:33.602: D/StrictMode(27425): at java.lang.reflect.Method.invoke(Native Method)
03-10 06:25:33.602: D/StrictMode(27425): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
03-10 06:25:33.602: D/StrictMode(27425): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
03-10 06:25:33.602: D/StrictMode(27425): StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Ljava/nio/Buffer;->position:I
03-10 06:25:33.602: D/StrictMode(27425): at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
03-10 06:25:33.602: D/StrictMode(27425): at android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidGL20.init(Native Method)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidGraphics.<init>(Unknown Source:86)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidGraphics.<init>(Unknown Source:1)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidApplication.init(Unknown Source:30)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidApplication.initialize(Unknown Source:1)
03-10 06:25:33.602: D/StrictMode(27425): at my-libgdx-app.AndroidLauncher.onCreate(Unknown Source:97)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.Activity.performCreate(Activity.java:7327)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.Activity.performCreate(Activity.java:7318)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
03-10 06:25:33.602: D/StrictMode(27425): at androidx.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:187)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3087)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3250)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1947)
03-10 06:25:33.602: D/StrictMode(27425): at android.os.Handler.dispatchMessage(Handler.java:106)
03-10 06:25:33.602: D/StrictMode(27425): at android.os.Looper.loop(Looper.java:214)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread.main(ActivityThread.java:7032)
03-10 06:25:33.602: D/StrictMode(27425): at java.lang.reflect.Method.invoke(Native Method)
03-10 06:25:33.602: D/StrictMode(27425): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
03-10 06:25:33.602: D/StrictMode(27425): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
03-10 06:25:33.602: D/StrictMode(27425): StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Ljava/nio/Buffer;->limit:I
03-10 06:25:33.602: D/StrictMode(27425): at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
03-10 06:25:33.602: D/StrictMode(27425): at android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidGL20.init(Native Method)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidGraphics.<init>(Unknown Source:86)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidGraphics.<init>(Unknown Source:1)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidApplication.init(Unknown Source:30)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidApplication.initialize(Unknown Source:1)
03-10 06:25:33.602: D/StrictMode(27425): at my-libgdx-app.AndroidLauncher.onCreate(Unknown Source:97)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.Activity.performCreate(Activity.java:7327)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.Activity.performCreate(Activity.java:7318)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
03-10 06:25:33.602: D/StrictMode(27425): at androidx.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:187)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3087)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3250)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1947)
03-10 06:25:33.602: D/StrictMode(27425): at android.os.Handler.dispatchMessage(Handler.java:106)
03-10 06:25:33.602: D/StrictMode(27425): at android.os.Looper.loop(Looper.java:214)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread.main(ActivityThread.java:7032)
03-10 06:25:33.602: D/StrictMode(27425): at java.lang.reflect.Method.invoke(Native Method)
03-10 06:25:33.602: D/StrictMode(27425): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
03-10 06:25:33.602: D/StrictMode(27425): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
03-10 06:25:33.602: D/StrictMode(27425): StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Ljava/nio/Buffer;->_elementSizeShift:I
03-10 06:25:33.602: D/StrictMode(27425): at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
03-10 06:25:33.602: D/StrictMode(27425): at android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidGL20.init(Native Method)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidGraphics.<init>(Unknown Source:86)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidGraphics.<init>(Unknown Source:1)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidApplication.init(Unknown Source:30)
03-10 06:25:33.602: D/StrictMode(27425): at com.badlogic.gdx.backends.android.AndroidApplication.initialize(Unknown Source:1)
03-10 06:25:33.602: D/StrictMode(27425): at my-libgdx-app.AndroidLauncher.onCreate(Unknown Source:97)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.Activity.performCreate(Activity.java:7327)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.Activity.performCreate(Activity.java:7318)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
03-10 06:25:33.602: D/StrictMode(27425): at androidx.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:187)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3087)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3250)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1947)
03-10 06:25:33.602: D/StrictMode(27425): at android.os.Handler.dispatchMessage(Handler.java:106)
03-10 06:25:33.602: D/StrictMode(27425): at android.os.Looper.loop(Looper.java:214)
03-10 06:25:33.602: D/StrictMode(27425): at android.app.ActivityThread.main(ActivityThread.java:7032)
03-10 06:25:33.602: D/StrictMode(27425): at java.lang.reflect.Method.invoke(Native Method)
03-10 06:25:33.602: D/StrictMode(27425): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
03-10 06:25:33.602: D/StrictMode(27425): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
The log above is from Firebase Test Lab, but I am sure it represents the same error I get from actual devices in the wild.
What can I do? My crash stats are getting hammered and ratings are sure to follow :(

I just found that I am actually building the Android app with Libgdx 1.9.9 (not 1.9.10 as stated in the question). 1.9.10 should have the fix for the issue, so I am confirming it right now, will mark as answered when confirmed.

Related

Running empty Android program - is this behavior expected?

I'm learning the basics of Android development and I've ran into some issues with setting up the programming environment. Now I've created a new Android Application Project and I'm running it using my phone. When I do, I get an error message on my phone: "Unfortunately, HelloWorld has stopped." and I'm not sure if it's supposed to or not, considering that I've done absolutely nothing to the project files. Here is the LogCat output in its entirety:
03-10 18:34:16.264: D/dalvikvm(2673): Late-enabling CheckJNI
03-10 18:34:16.361: W/dalvikvm(2673): VFY: unable to resolve static field 1559 (ActionBarWindow) in Landroid/support/v7/appcompat/R$styleable;
03-10 18:34:16.361: D/dalvikvm(2673): VFY: replacing opcode 0x62 at 0x0004
03-10 18:34:16.364: D/AndroidRuntime(2673): Shutting down VM
03-10 18:34:16.364: W/dalvikvm(2673): threadid=1: thread exiting with uncaught exception (group=0x416d7d40)
03-10 18:34:16.368: E/AndroidRuntime(2673): FATAL EXCEPTION: main
03-10 18:34:16.368: E/AndroidRuntime(2673): Process: com.example.helloworld, PID: 2673
03-10 18:34:16.368: E/AndroidRuntime(2673): java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable
03-10 18:34:16.368: E/AndroidRuntime(2673): at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:107)
03-10 18:34:16.368: E/AndroidRuntime(2673): at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:58)
03-10 18:34:16.368: E/AndroidRuntime(2673): at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98)
03-10 18:34:16.368: E/AndroidRuntime(2673): at com.example.helloworld.MainActivity.onCreate(MainActivity.java:18)
03-10 18:34:16.368: E/AndroidRuntime(2673): at android.app.Activity.performCreate(Activity.java:5248)
03-10 18:34:16.368: E/AndroidRuntime(2673): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
03-10 18:34:16.368: E/AndroidRuntime(2673): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2173)
03-10 18:34:16.368: E/AndroidRuntime(2673): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2269)
03-10 18:34:16.368: E/AndroidRuntime(2673): at android.app.ActivityThread.access$800(ActivityThread.java:139)
03-10 18:34:16.368: E/AndroidRuntime(2673): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
03-10 18:34:16.368: E/AndroidRuntime(2673): at android.os.Handler.dispatchMessage(Handler.java:102)
03-10 18:34:16.368: E/AndroidRuntime(2673): at android.os.Looper.loop(Looper.java:136)
03-10 18:34:16.368: E/AndroidRuntime(2673): at android.app.ActivityThread.main(ActivityThread.java:5102)
03-10 18:34:16.368: E/AndroidRuntime(2673): at java.lang.reflect.Method.invokeNative(Native Method)
03-10 18:34:16.368: E/AndroidRuntime(2673): at java.lang.reflect.Method.invoke(Method.java:515)
03-10 18:34:16.368: E/AndroidRuntime(2673): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
03-10 18:34:16.368: E/AndroidRuntime(2673): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
03-10 18:34:16.368: E/AndroidRuntime(2673): at dalvik.system.NativeStart.main(Native Method)
03-10 18:34:18.259: I/Process(2673): Sending signal. PID: 2673 SIG: 9
03-10 18:36:57.062: W/dalvikvm(2984): VFY: unable to resolve static field 1559 (ActionBarWindow) in Landroid/support/v7/appcompat/R$styleable;
03-10 18:36:57.063: D/dalvikvm(2984): VFY: replacing opcode 0x62 at 0x0004
03-10 18:36:57.064: D/AndroidRuntime(2984): Shutting down VM
03-10 18:36:57.064: W/dalvikvm(2984): threadid=1: thread exiting with uncaught exception (group=0x416d7d40)
03-10 18:36:57.066: E/AndroidRuntime(2984): FATAL EXCEPTION: main
03-10 18:36:57.066: E/AndroidRuntime(2984): Process: com.example.helloworld, PID: 2984
03-10 18:36:57.066: E/AndroidRuntime(2984): java.lang.NoClassDefFoundError: android.support.v7.appcompat.R$styleable
03-10 18:36:57.066: E/AndroidRuntime(2984): at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:107)
03-10 18:36:57.066: E/AndroidRuntime(2984): at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:58)
03-10 18:36:57.066: E/AndroidRuntime(2984): at android.support.v7.app.ActionBarActivity.onCreate(ActionBarActivity.java:98)
03-10 18:36:57.066: E/AndroidRuntime(2984): at com.example.helloworld.MainActivity.onCreate(MainActivity.java:18)
03-10 18:36:57.066: E/AndroidRuntime(2984): at android.app.Activity.performCreate(Activity.java:5248)
03-10 18:36:57.066: E/AndroidRuntime(2984): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
03-10 18:36:57.066: E/AndroidRuntime(2984): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2173)
03-10 18:36:57.066: E/AndroidRuntime(2984): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2269)
03-10 18:36:57.066: E/AndroidRuntime(2984): at android.app.ActivityThread.access$800(ActivityThread.java:139)
03-10 18:36:57.066: E/AndroidRuntime(2984): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1210)
03-10 18:36:57.066: E/AndroidRuntime(2984): at android.os.Handler.dispatchMessage(Handler.java:102)
03-10 18:36:57.066: E/AndroidRuntime(2984): at android.os.Looper.loop(Looper.java:136)
03-10 18:36:57.066: E/AndroidRuntime(2984): at android.app.ActivityThread.main(ActivityThread.java:5102)
03-10 18:36:57.066: E/AndroidRuntime(2984): at java.lang.reflect.Method.invokeNative(Native Method)
03-10 18:36:57.066: E/AndroidRuntime(2984): at java.lang.reflect.Method.invoke(Method.java:515)
03-10 18:36:57.066: E/AndroidRuntime(2984): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
03-10 18:36:57.066: E/AndroidRuntime(2984): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
03-10 18:3
6:57.066: E/AndroidRuntime(2984): at dalvik.system.NativeStart.main(Native Method)
So, is this normal behavior or have I done something wrong while setting up Eclipse, etc?
It looks like the Android compatibility library is not correctly configured for your project. In Eclipse, right click on the project in the package explorer and select Android Tools > Add Support Library. After setting up the support library, clean and rebuild your project.
This is normal behavior when reporting an error with your application.

How open native call details screen for a particular call log in Samsung and HTC android device using intent?

I am developing an android application to show all call logs in the list and when user taps on any call log, i need to open native app's call details screen for that tapped call log.
I have tried following code snippet and it works fine in Emulator (Pure android OS.)
Intent mDetailsIntent = new Intent(Intent.ACTION_VIEW); mDetailsIntent.setType(android.provider.CallLog.Calls.CONTENT_TYPE);
Uri mUri = Uri.withAppendedPath(android.provider.CallLog.Calls.CONTENT_URI, String.valueOf(mCallLog.getId()));
mDetailsIntent.setData(mUri);
startActivity(mDetailsIntent);
But when I run it on Samsung device, it shown the last recent call log's details screen each time regardless of call log id.
And for HTC devices, it throws ActivityNotFoundException.
Following log cat is for HTC device.
**03-10 14:19:00.772: D/LogsFragment(20947): Call log details uri==>content://call_log/calls/62
03-10 14:19:00.782: W/System.err(20947): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=content://call_log/calls/62 }
03-10 14:19:00.792: W/System.err(20947): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1638)
03-10 14:19:00.792: W/System.err(20947): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1510)
03-10 14:19:00.792: W/System.err(20947): at android.app.Activity.startActivityForResult(Activity.java:3258)
03-10 14:19:00.792: W/System.err(20947): at android.support.v4.app.FragmentActivity.startActivityFromFragment(FragmentActivity.java:833)
03-10 14:19:00.792: W/System.err(20947): at android.support.v4.app.Fragment.startActivity(Fragment.java:856)
03-10 14:19:00.792: W/System.err(20947): at com.cwiker.fragments.LogsFragment.onItemClick(LogsFragment.java:219)
03-10 14:19:00.792: W/System.err(20947): at android.widget.AdapterView.performItemClick(AdapterView.java:292)
03-10 14:19:00.792: W/System.err(20947): at android.widget.AbsListView.performItemClick(AbsListView.java:1099)
03-10 14:19:00.792: W/System.err(20947): at android.widget.ListView.performItemClick(ListView.java:4758)
03-10 14:19:00.792: W/System.err(20947): at android.widget.AbsListView$PerformClick.run(AbsListView.java:2556)
03-10 14:19:00.792: W/System.err(20947): at android.widget.AbsListView$1.run(AbsListView.java:3223)
03-10 14:19:00.792: W/System.err(20947): at android.os.Handler.handleCallback(Handler.java:608)
03-10 14:19:00.802: W/System.err(20947): at android.os.Handler.dispatchMessage(Handler.java:92)
03-10 14:19:00.802: W/System.err(20947): at android.os.Looper.loop(Looper.java:156)
03-10 14:19:00.802: W/System.err(20947): at android.app.ActivityThread.main(ActivityThread.java:4987)
03-10 14:19:00.802: W/System.err(20947): at java.lang.reflect.Method.invokeNative(Native Method)
03-10 14:19:00.802: W/System.err(20947): at java.lang.reflect.Method.invoke(Method.java:511)
03-10 14:19:00.802: W/System.err(20947): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
03-10 14:19:00.802: W/System.err(20947): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
03-10 14:19:00.802: W/System.err(20947): at dalvik.system.NativeStart.main(Native Method)**
Please help me to solve this problem.
Thanks.

Google Maps v2 Error inflating class fragment

I'm using google maps v2 in my application. The app crashes as soon as it starts. Min SDK version is 8 and Max is 19. I can't get what the error is. Below is my LogCat and Code, Please Help
Log
03-10 16:17:37.977: E/AndroidRuntime(24296): FATAL EXCEPTION: main
03-10 16:17:37.977: E/AndroidRuntime(24296): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appscourt.earth.map.location/com.appscourt.earth.map.location.MainActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class fragment
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2136)
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2174)
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.app.ActivityThread.access$700(ActivityThread.java:141)
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1267)
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.os.Handler.dispatchMessage(Handler.java:99)
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.os.Looper.loop(Looper.java:137)
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.app.ActivityThread.main(ActivityThread.java:5059)
03-10 16:17:37.977: E/AndroidRuntime(24296): at java.lang.reflect.Method.invokeNative(Native Method)
03-10 16:17:37.977: E/AndroidRuntime(24296): at java.lang.reflect.Method.invoke(Method.java:511)
03-10 16:17:37.977: E/AndroidRuntime(24296): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792)
03-10 16:17:37.977: E/AndroidRuntime(24296): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555)
03-10 16:17:37.977: E/AndroidRuntime(24296): at dalvik.system.NativeStart.main(Native Method)
03-10 16:17:37.977: E/AndroidRuntime(24296): Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class fragment
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
03-10 16:17:37.977: E/AndroidRuntime(24296): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:260)
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.app.Activity.setContentView(Activity.java:1893)
03-10 16:17:37.977: E/AndroidRuntime(24296): at com.appscourt.earth.map.location.MainActivity.onCreate(MainActivity.java:31)
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.app.Activity.performCreate(Activity.java:5058)
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2100)
03-10 16:17:37.977: E/AndroidRuntime(24296): ... 11 more
03-10 16:17:37.977: E/AndroidRuntime(24296): Caused by: java.lang.SecurityException: The Maps API requires the additional following permissions to be set in the AndroidManifest.xml to ensure a correct behavior:
03-10 16:17:37.977: E/AndroidRuntime(24296): <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
03-10 16:17:37.977: E/AndroidRuntime(24296): at maps.e.ch.a(Unknown Source)
03-10 16:17:37.977: E/AndroidRuntime(24296): at maps.e.ay.a(Unknown Source)
03-10 16:17:37.977: E/AndroidRuntime(24296): at maps.e.ay.a(Unknown Source)
03-10 16:17:37.977: E/AndroidRuntime(24296): at maps.e.al.a(Unknown Source)
03-10 16:17:37.977: E/AndroidRuntime(24296): at maps.e.bg.a(Unknown Source)
03-10 16:17:37.977: E/AndroidRuntime(24296): at maps.e.bf.a(Unknown Source)
03-10 16:17:37.977: E/AndroidRuntime(24296): at eio.onTransact(SourceFile:107)
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.os.Binder.transact(Binder.java:326)
03-10 16:17:37.977: E/AndroidRuntime(24296): at com.google.android.gms.maps.internal.IMapFragmentDelegate$a$a.onCreateView(Unknown Source)
03-10 16:17:37.977: E/AndroidRuntime(24296): at com.google.android.gms.maps.SupportMapFragment$a.onCreateView(Unknown Source)
03-10 16:17:37.977: E/AndroidRuntime(24296): at com.google.android.gms.dynamic.a$4.b(Unknown Source)
03-10 16:17:37.977: E/AndroidRuntime(24296): at com.google.android.gms.dynamic.a.a(Unknown Source)
03-10 16:17:37.977: E/AndroidRuntime(24296): at com.google.android.gms.dynamic.a.onCreateView(Unknown Source)
03-10 16:17:37.977: E/AndroidRuntime(24296): at com.google.android.gms.maps.SupportMapFragment.onCreateView(Unknown Source)
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.support.v4.app.Fragment.performCreateView(Fragment.java:1500)
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:900)
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1082)
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1184)
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:291)
03-10 16:17:37.977: E/AndroidRuntime(24296): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)
XML File
<fragment
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="35dip"
android:name="com.google.android.gms.maps.SupportMapFragment" />
MainActivity.Java
public class MainActivity extends FragmentActivity implements
LoaderCallbacks<Cursor> {
....
private void initializeMap() {
if (gMap == null) {
gMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(
R.id.map)).getMap();
// check if map is created successfully or not
if (gMap == null) {
Toast.makeText(getApplicationContext(),
"Sorry! unable to create maps", Toast.LENGTH_SHORT)
.show();
}
}
}
Your logcat clearly said:
Caused by: java.lang.SecurityException: The Maps API requires the additional following permissions to be set in the AndroidManifest.xml to
ensure a correct behavior: 03-10 16:17:37.977: E/AndroidRuntime(24296):
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
You need to add this permission in your manifest.xml
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
For the Internet security reason you need to add this permission to manifest file.
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
To inflate Google Map you need to Add below permission in your manifest. It clearly defined in your logcat error.
Caused by: java.lang.SecurityException: The Maps API requires the additional following permissions to be set in the AndroidManifest.xml to ensure a correct behavior:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Also make sure you have added the below permissions also
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!-- External storage for caching. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

Getting warning when trying to view saved camera picture in gridview

I am going to use camera/gallery in my project. FOr this i have first taken picture and saved it in my folder(Suppose pictureworld) and also saved the imageuri in the localdatabase. Then when i am trying to get the picture to show it in the gridview i am getting a warning message. In the gridview there is no picture but it can view the picture name. I have checked that it is creating the picture and also the uri in the localdatabase is correct.I want to add that when i am trying to save the pic using the gallery ..there is no problem. I have used the same adapter for viewing the saved gallery and camera picture. I am attaching the warning here:
03-10 17:48:11.367: W/System.err(522): at libcore.io.IoBridge.open(IoBridge.java:406)
03-10 17:48:11.367: W/System.err(522): at java.io.FileInputStream.<init>(FileInputStream.java:78)
03-10 17:48:11.367: W/System.err(522): at java.io.FileInputStream.<init>(FileInputStream.java:105)
03-10 17:48:11.367: W/System.err(522): at android.content.ContentResolver.openInputStream(ContentResolver.java:369)
03-10 17:48:11.367: W/System.err(522): at android.provider.MediaStore$Images$Media.getBitmap(MediaStore.java:705)
03-10 17:48:11.367: W/System.err(522): at hr.s2is.ischool.admin.adapter.CommunityUserAdapter.getView(CommunityUserAdapter.java:71)
03-10 17:48:11.367: W/System.err(522): at android.widget.AbsListView.obtainView(AbsListView.java:2033)
03-10 17:48:11.367: W/System.err(522): at android.widget.GridView.makeAndAddView(GridView.java:1323)
03-10 17:48:11.377: W/System.err(522): at android.widget.GridView.makeRow(GridView.java:328)
03-10 17:48:11.377: W/System.err(522): at android.widget.GridView.fillDown(GridView.java:281)
03-10 17:48:11.377: W/System.err(522): at android.widget.GridView.fillFromTop(GridView.java:403)
03-10 17:48:11.377: W/System.err(522): at android.widget.GridView.layoutChildren(GridView.java:1215)
03-10 17:48:11.377: W/System.err(522): at android.widget.AbsListView.onLayout(AbsListView.java:1863)
03-10 17:48:11.377: W/System.err(522): at android.view.View.layout(View.java:11278)
03-10 17:48:11.377: W/System.err(522): at android.view.ViewGroup.layout(ViewGroup.java:4224)
03-10 17:48:11.377: W/System.err(522): at android.widget.RelativeLayout.onLayout(RelativeLayout.java:925)
03-10 17:48:11.387: W/System.err(522): at android.view.View.layout(View.java:11278)
03-10 17:48:11.387: W/System.err(522): at android.view.ViewGroup.layout(ViewGroup.java:4224)
03-10 17:48:11.387: W/System.err(522): at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
03-10 17:48:11.387: W/System.err(522): at android.view.View.layout(View.java:11278)
03-10 17:48:11.387: W/System.err(522): at android.view.ViewGroup.layout(ViewGroup.java:4224)
03-10 17:48:11.387: W/System.err(522): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1628)
03-10 17:48:11.397: W/System.err(522): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1486)
03-10 17:48:11.397: W/System.err(522): at android.widget.LinearLayout.onLayout(LinearLayout.java:1399)
03-10 17:48:11.397: W/System.err(522): at android.view.View.layout(View.java:11278)
03-10 17:48:11.397: W/System.err(522): at android.view.ViewGroup.layout(ViewGroup.java:4224)
03-10 17:48:11.397: W/System.err(522): at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
03-10 17:48:11.397: W/System.err(522): at android.view.View.layout(View.java:11278)
03-10 17:48:11.397: W/System.err(522): at android.view.ViewGroup.layout(ViewGroup.java:4224)
03-10 17:48:11.407: W/System.err(522): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1489)
03-10 17:48:11.407: W/System.err(522): at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442)
03-10 17:48:11.407: W/System.err(522): at android.os.Handler.dispatchMessage(Handler.java:99)
03-10 17:48:11.407: W/System.err(522): at android.os.Looper.loop(Looper.java:137)
03-10 17:48:11.407: W/System.err(522): at android.app.ActivityThread.main(ActivityThread.java:4424)
03-10 17:48:11.407: W/System.err(522): at java.lang.reflect.Method.invokeNative(Native Method)
03-10 17:48:11.417: W/System.err(522): at java.lang.reflect.Method.invoke(Method.java:511)
03-10 17:48:11.417: W/System.err(522): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
03-10 17:48:11.417: W/System.err(522): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
03-10 17:48:11.417: W/System.err(522): at dalvik.system.NativeStart.main(Native Method)
03-10 17:48:11.417: W/System.err(522): Caused by: libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
03-10 17:48:11.427: W/System.err(522): at libcore.io.Posix.open(Native Method)
03-10 17:48:11.427: W/System.err(522): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
03-10 17:48:11.427: W/System.err(522): at libcore.io.IoBridge.open(IoBridge.java:390)
Have you given the permission to read the local storage? You should check if any permission is declared in Android Manifest regarding Writing and reading of Internal Storage.
did you add permissions
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
One more thing:
With sdk, you can't write to the root of internal storage. This cause your error.Try something like this
final File dir = new File(context.getFilesDir() + "/nfs/guille/groce/users/nicholsk/workspace3/SQLTest");
dir.mkdirs(); //create folders where write files
final File file = new File(dir, "BlockForTest.txt");

how to reach my locahost DB from android phone [duplicate]

This question already has answers here:
NetworkOnMainThreadException [duplicate]
(5 answers)
Closed 9 years ago.
I have developed an Android and now I want to test it in my real phone
this app has a webserivice for user reg. and login, also it has a xampp server hosting my DB and a forum which I access from the app.
can soembody plz help to figure out why I can't use it in my device
here is my logcat
03-10 17:54:56.360: E/SensorManager(2377): thread start
03-10 17:54:56.555: E/SpannableStringBuilder(2377): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
03-10 17:54:56.555: E/SpannableStringBuilder(2377): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
03-10 17:56:06.415: E/SpannableStringBuilder(2377): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
03-10 17:56:06.415: E/SpannableStringBuilder(2377): SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
03-10 17:56:12.920: E/AndroidRuntime(2377): FATAL EXCEPTION: main
03-10 17:56:12.920: E/AndroidRuntime(2377): android.os.NetworkOnMainThreadException
03-10 17:56:12.920: E/AndroidRuntime(2377): at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1118)
03-10 17:56:12.920: E/AndroidRuntime(2377): at libcore.io.BlockGuardOs.connect(BlockGuardOs.java:84)
03-10 17:56:12.920: E/AndroidRuntime(2377): at libcore.io.IoBridge.connectErrno(IoBridge.java:127)
03-10 17:56:12.920: E/AndroidRuntime(2377): at libcore.io.IoBridge.connect(IoBridge.java:112)
03-10 17:56:12.920: E/AndroidRuntime(2377): at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:192)
03-10 17:56:12.920: E/AndroidRuntime(2377): at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:459)
03-10 17:56:12.920: E/AndroidRuntime(2377): at java.net.Socket.connect(Socket.java:842)
03-10 17:56:12.920: E/AndroidRuntime(2377): at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:119)
03-10 17:56:12.920: E/AndroidRuntime(2377): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:144)
03-10 17:56:12.920: E/AndroidRuntime(2377): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
03-10 17:56:12.920: E/AndroidRuntime(2377): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
03-10 17:56:12.920: E/AndroidRuntime(2377): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:360)
03-10 17:56:12.920: E/AndroidRuntime(2377): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:670)
03-10 17:56:12.920: E/AndroidRuntime(2377): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:509)
03-10 17:56:12.920: E/AndroidRuntime(2377): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
03-10 17:56:12.920: E/AndroidRuntime(2377): at com.mohammed.watzIslam.library.JSONParser.getJSONFromUrl(JSONParser.java:44)
03-10 17:56:12.920: E/AndroidRuntime(2377): at com.mohammed.watzIslam.library.UserFunctions.loginUser(UserFunctions.java:39)
03-10 17:56:12.920: E/AndroidRuntime(2377): at com.mohammed.watzIslam.LoginActivity$1.onClick(LoginActivity.java:59)
03-10 17:56:12.920: E/AndroidRuntime(2377): at android.view.View.performClick(View.java:4211)
03-10 17:56:12.920: E/AndroidRuntime(2377): at android.view.View$PerformClick.run(View.java:17267)
03-10 17:56:12.920: E/AndroidRuntime(2377): at android.os.Handler.handleCallback(Handler.java:615)
03-10 17:56:12.920: E/AndroidRuntime(2377): at android.os.Handler.dispatchMessage(Handler.java:92)
03-10 17:56:12.920: E/AndroidRuntime(2377): at android.os.Looper.loop(Looper.java:137)
03-10 17:56:12.920: E/AndroidRuntime(2377): at android.app.ActivityThread.main(ActivityThread.java:4898)
03-10 17:56:12.920: E/AndroidRuntime(2377): at java.lang.reflect.Method.invokeNative(Native Method)
03-10 17:56:12.920: E/AndroidRuntime(2377): at java.lang.reflect.Method.invoke(Method.java:511)
03-10 17:56:12.920: E/AndroidRuntime(2377): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
03-10 17:56:12.920: E/AndroidRuntime(2377): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
03-10 17:56:12.920: E/AndroidRuntime(2377): at dalvik.system.NativeStart.main(Native Method)
any help is appreciated
You're doing network stuff on the main thread. Don't do that. Use AsyncTasks instead.

Categories

Resources