sayhaha
sayhaha

Reputation: 789

Android code works on phone but not on emulator

If I run the code on my phone galaxy s2 2.3.6, it works fine. However, if I try to run on eclipse emulator, it will give me an error. :(

What the code does is simple viewflipper.

I tried to run on emulator platform 2.3.3 and 4.0.3

Thank you for the help.

bottom is the logcat output.

02-21 17:11:39.223: D/dalvikvm(353): GC_FOR_MALLOC freed <1K, 53% free 2560K/5379K, external 1645K/2137K, paused 25ms 02-21 17:11:39.233: D/skia(353): --- decoder->decode returned false 02-21 17:11:39.233: D/AndroidRuntime(353): Shutting down VM 02-21 17:11:39.233: W/dalvikvm(353): threadid=1: thread exiting with uncaught exception (group=0x40015560) 02-21 17:11:39.253: E/AndroidRuntime(353): FATAL EXCEPTION: main 02-21 17:11:39.253: E/AndroidRuntime(353): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.exercise.AndroidViewFlipper/com.exercise.AndroidViewFlipper.AndroidViewFlipperActivity}: android.view.InflateException: Binary XML file line #38: Error inflating class 02-21 17:11:39.253: E/AndroidRuntime(353): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647) 02-21 17:11:39.253: E/AndroidRuntime(353): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 02-21 17:11:39.253: E/AndroidRuntime(353): at android.app.ActivityThread.access$1500(ActivityThread.java:117) [50+ more]

Upvotes: 0

Views: 426

Answers (2)

sayhaha
sayhaha

Reputation: 789

When I create the new project, Eclipse asks for target version. However, it seems like it sets minimum version to that Target version #.

After I change the minimum version, it fixed the problem.

Upvotes: 0

Barak
Barak

Reputation: 16393

I had an issue similar to this.

Try deleting the emulator instance you are using (I do mean to delete it in the AVD manager) and then recreate it. That solved the issue for me. Also make sure that the emulator is emulating all the features necessary for your app.

Upvotes: 2

Related Questions