0

I'm trying to use ActionBarDrawerToggle in my project.So I imported project support v7 appcompact to eclipse.When I tried to add support v7 appcompact to my project as a lib,it didn't work.Shown as the picture,once I reopen properties->android it showed a cross.

Android->libarary->add

errors shown

I tried to add support-v4 and support-v7 appcompact jars in support-v7 to my project->libs.Then I got no error.But when running application on my phone,it crashed.

Logging:java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/appcompat/R$styleable;[crash log][3]

Uttam Kumar Roy
  • 2,060
  • 4
  • 23
  • 29
彭强威
  • 9
  • 2

2 Answers2

0

Tks guys.I solved the problem by myself.

I removed appcompact project,reimported it and ticked off "copy projects into workspace" while importing.The red cross in properties->android->lib disappeared.And my application run normally on my device now.

By the way,you don't have to import appcompact.jar or support-v4.jar to your project.And you have to remove existing support-v4.jar in your project because this would lead to "multiple dex files define".

Is there anyone who can tell me why I cannot use project from a different folder?Tks:)

彭强威
  • 9
  • 2
-1
  1. Add support library from sdk manager

sdk manger

2.Go to your project in the navigator, right click on properties.

properties

3.Click add external jars.

4.Go to your ADT Bundle folder, go to sdk/extras/android/support/v7/appcompat/libs.

5.Select the file android-support-v7-appcompat.jar

6.Go to order and export and check the box next to your new jar.

7.Click ok.

For Detail: link-1, Link-2

Community
  • 1
  • 1
Tanim reja
  • 2,120
  • 1
  • 16
  • 23
  • TKs. I had tried your suggestion,but still couldn't solve the problem. Error accored while running:java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/appcompat/R$styleable; – 彭强威 Apr 12 '16 at 20:54