Reputation: 14361
Android app is trying to be launched on the emulator. Emulator launched without an error. Shows Time and the colourful screen. Here we get the success message.
------------------------------
Android Launch!
adb is running normally.
Performing com.example.x.MainActivity activity launch
Automatic Target Mode: Preferred AVD 'NexusS' is available on emulator 'emulator-5554'
Uploading x.apk onto device 'emulator-5554'
Installing x.apk...
**Success!**
Starting activity com.example.x.MainActivity on device emulator-5554
ActivityManager: WARNING: linker: libdvm.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.heyworld/.MainActivity }
Yet right after that message logCAT triggers following message.
E/AndroidRuntime(1629): FATAL EXCEPTION: main
E/AndroidRuntime(1629): Process: com.example.x, PID: 1629
E/AndroidRuntime(1629): java.lang.NoClassDefFoundError:
android.support.v7.appcompat.R$styleable
E/AndroidRuntime(1629): at android.support.v7.app.ActionBarActivityDelegate.onCreate(ActionBarActivityDelegate.java:106)
E/AndroidRuntime(1629): at android.support.v7.app.ActionBarActivityDelegateICS.onCreate(ActionBarActivityDelegateICS.java:57)
...
...
...
E/AndroidRuntime(1629): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(1629): at android.app.ActivityThread.main(ActivityThread.java:5026)
E/AndroidRuntime(1629): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(1629): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(1629): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
E/AndroidRuntime(1629): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
E/AndroidRuntime(1629): at dalvik.system.NativeStart.main(Native Method)
Then Emulator displays:
"Unfortunately x has stopped working."
Next there was a pop up asking what kind or monitoring we should make logcat to do. We selected "anything higher than warn". Then the app failed again. And emulator displayed,
"Unfortunately x has stopped"
So we are wondering what's really going on. We have searched and tried out most tips given in here on SO for similar questions. But there's no luck yet.
FYI : my team mates are asking different types of questions under my account. I just specify it, because every day there's a different type (area) of a bug or question being asked on my profile.
Upvotes: 0
Views: 265
Reputation: 3926
See One of the two solution is working for you?
Solution 1
Import support library as a project from "sdk/extras/android/support/v7/appcompat".
Reference library in your project (for Eclipse, "Properties - Android - Add").
Build projects (for Eclipse, "Projects - Build All"). Make sure, you have "android.support.v7.appcompat" in your main project gen folder. If it doesn't worked - clean and rebuild project.
Solution 2
Right-click the library project folder and select Build Path > Configure Build Path.
In the Order and Export tab, check the .jar files you just added to the build path, so they are available to projects that depend on this library project. For example, the appcompat project requires you to export both the android-support-v4.jar and android-support-v7-appcompat.jar files.
Uncheck Android Dependencies.
Upvotes: 1