Tips to add Support Library

In case you need to add Android Support Library, such as android-support-v4.jar; Google documents suggested to:
- In Eclipse Select Project > Properties, select Java Build Path, and navigate to Libraries.
- Select Add External Jars, include the following jar files, and click OK: <android-sdk-folder>/extras/android/compatibility/v4/android-support-v4.jar

But...I found that it is not always work, even always NOT work!

No error when you compile your code, but fail with error "Caused by: java.lang.NoClassDefFoundError: youractivity" at runtime.

My alternatively, Right click your project, select Android Tools > Add Support Library...

Add Support Library...


----------

Here is another solution advised by Stefan de Bruijn in comments:
- create a folder called "libs", NOT "lib".
- copy the required jar in "libs" folder.
- Update Java Build Path by selecting "Add JARs..." (NOT "Add External JARs...") to add the jar in libs.
- like this: java.lang.NoClassDefFoundError: com.google.ads.AdView.

thumbnail
Title: Tips to add Support Library
Rating: 100% based on 99998 ratings. 10 user reviews.
Post by

Related articles :

0 comments:

Post a Comment

My Blog List

 
Copyright © 2015. About - Web Version - Mobile Version Sitemap - Contact - Privacy