NoClassDefFoundError when adding SocialAuth to Eclipse

I tried adding an external library to my Android project, but no luck. My application crashed with Exception at runtime:

09-06 07:44:41.921: E/AndroidRuntime(601): java.lang.NoClassDefFoundError: org.brickred.socialauth.android.SocialAuthAdapter 

Found many different magic solutions, but nothing helped:

  • The "libs" directory has been created and JARs have been added.
  • Also added JARs in "Project Properties -> Java Build Path -> Libraries"
  • In "Project Properties -> Java Build Path -> Order and Export" moved the JAR up and checked it
  • I tried to clear the project and even create a new project.
  • The latest version of Eclipse is installed.

I see that the size of the APK changes when the library is added.

Any ideas?

Software Used:

  • Eclipse: Version: Juno Release Build id: 20120614-1722
  • ADT: 20.0.3.v201208082019-427395
+4
source share
7 answers

I had the same problem and none of the existing answers here solved the problem.

Then I checked the SocialAuth examples (which worked) and noticed that the jar name is different from mine - socialauth-android.jar instead of socialauth-android-1.0.jar

I used the banner socialauth-android.jar and the runtime error disappeared.

+2
source

You just need to define a new action in the AndroidManifest.xml file.

Put the code below in the <application> ----</application> your manifest file.

 <uses-library android:name="org.brickred.socialauth.android.SocialAuthAdapter" /> 
+1
source

Insert the jar file into the libs folder, go to * β†’ properties-> java build path-> libraries-> click Add banks β†’ * select the application folder And select the jar file and click ok and clean your project.

0
source

Sometimes an error occurs due to an ADT update. Try putting this in the <Application> tags in the Manifiest.xml file

 <uses-library android:name="org.brickred.socialauth...(your lib name)" /> 

And look more if Ref lib is installed in your prj properties: Manage project libs

0
source

java.lang.NoClassDefFoundError - runtime error. This means that it’s NOT important where and how you place your banks in your project (missing jars here will lead to compile-time errors). It is important that your required banks are included in the built bank. Try to open the compiled / generated jar file and check if it contains the necessary banks and that they are in the right place.

0
source

You just need to add the jars shipped in sdk in your build path. Have you tried other examples inside sdk. If you are still experiencing a problem, you can send an email to support android collaborators.

0
source

Once you have socialauth - *. jar and socialauth-android.jar in the libs folder, try right-clicking on it and choosing Build Path> Add To Build Path. In my case, the problem disappeared when I got the " Linked Libraries " in my project.

0
source

Source: https://habr.com/ru/post/1432665/


All Articles