Skip to content Skip to sidebar Skip to footer

My Android Application Won't Run On 2 Devices But Works On Emulator

I'm writing an application that displays Google Map right after the login screen. The Build Target is set to 2.3 and my devices run: 1) Samsung Galaxy Ace (2.3.4) 2) Motorolla Xoom

Solution 1:

I presuppose you are using a diferente Maps API KEY for emulating the app, and another different signed with your MD5 signature to run the app on devices. Check it out here.

Solution 2:

In case anyone else has the same issue I think I have found a solution.

I looked up the error in LogCat:

04-0600:27:13.510: E/AndroidRuntime(3163): android.os.NetworkOnMainThreadException

And according to this http://developer.android.com/reference/android/os/NetworkOnMainThreadException.html

it seems that some (newer) android versions don't allow internet connection requests in the MainActivity or something like that.

Even though I was targetting android version 10 (2.3) I still had the error so I changed my project target to version 8 and it seems to work okay now.

Post a Comment for "My Android Application Won't Run On 2 Devices But Works On Emulator"