java.lang.NoClassDefFoundError: android.support.v7

2019-06-14 13:31发布

问题:

I am running my app on Eclipse, after successfully setup my project with latest android-support-v7-appcompat library i am facing this issue, don't know how to rectify it, my error log is below

08-12 14:34:09.335: E/AndroidRuntime(7681): java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV14
08-12 14:34:09.335: E/AndroidRuntime(7681):     at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:93)
08-12 14:34:09.335: E/AndroidRuntime(7681):     at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:77)
08-12 14:34:09.335: E/AndroidRuntime(7681):     at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:429)
08-12 14:34:09.335: E/AndroidRuntime(7681):     at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:57)
08-12 14:34:09.335: E/AndroidRuntime(7681):     at com.fleetjack.android.apps.viewer.FleetLanding.onCreate(FleetLanding.java:125)
08-12 14:34:09.335: E/AndroidRuntime(7681):     at android.app.Activity.performCreate(Activity.java:5283)
08-12 14:34:09.335: E/AndroidRuntime(7681):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
08-12 14:34:09.335: E/AndroidRuntime(7681):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2209)
08-12 14:34:09.335: E/AndroidRuntime(7681):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2299)
08-12 14:34:09.335: E/AndroidRuntime(7681):     at android.app.ActivityThread.access$700(ActivityThread.java:150)
08-12 14:34:09.335: E/AndroidRuntime(7681):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1280)
08-12 14:34:09.335: E/AndroidRuntime(7681):     at android.os.Handler.dispatchMessage(Handler.java:99)
08-12 14:34:09.335: E/AndroidRuntime(7681):     at android.os.Looper.loop(Looper.java:137)
08-12 14:34:09.335: E/AndroidRuntime(7681):     at android.app.ActivityThread.main(ActivityThread.java:5283)
08-12 14:34:09.335: E/AndroidRuntime(7681):     at java.lang.reflect.Method.invokeNative(Native Method)
08-12 14:34:09.335: E/AndroidRuntime(7681):     at java.lang.reflect.Method.invoke(Method.java:511)
08-12 14:34:09.335: E/AndroidRuntime(7681):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
08-12 14:34:09.335: E/AndroidRuntime(7681):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
08-12 14:34:09.335: E/AndroidRuntime(7681):     at dalvik.system.NativeStart.main(Native Method)

In my libs folder i have added three jar files -> support design, supportV4, supportV7-appcompact, gcm(i have removed libraries in appcompact project library )

As well in my manifest i have changed my app theme to android:theme="@style/Theme.AppCompat" changed activity to AppCompatActivity, Now when i try to run my application it always through an exception. Kindly help me to fix this issue Searched through google but all the solution is for Android-Studio i am using eclipse

Thanks in advance

回答1:

import android-support-* jar files in libs, may causes error.

each library is android-project structure, jar file is not contain android-project structure (res, assets, etc).

import libraries projects and add reference.

check your project settings.

  1. import 'android-support-v7-appcompat library' as project?
  2. clean android-support-v7-appcompat library and your project.
  3. check your project, referencing appcompat library.

  4. check build path

if you still facing error, please comment.