I was finally able to find my crouton library, after getting solutions for this question on SO. I was directed to maven central where i downloaded crouton-1.8.4 the third of size 24kb on a list at the bottom of the page. Then i copied it into the libs folder in my android project, added it to build path, and checked it in the order and export panel.
This solved the problem i was facing then in the question i asked before.
The code i tried to run was Crouton.makeText(this, "BAD Crouton", Style.ALERT);
just to see if it works. I i'm testing it on a 4.4.2 emulator. And i also tried it on a 2.2 emulator, after adding the Style.Builder, which it requires to work on lower devices. i get the same problem.
But when my joy was short-lived, because when i tested it on the emulator, here is the error i got in my logcat.
01-17 03:15:44.537: E/AndroidRuntime(2203): FATAL EXCEPTION: main
01-17 03:15:44.537: E/AndroidRuntime(2203): Process: com.example.dester, PID: 2203
01-17 03:15:44.537: E/AndroidRuntime(2203): java.lang.NoClassDefFoundError: de.keyboardsurfer.android.widget.crouton.Style
01-17 03:15:44.537: E/AndroidRuntime(2203): at com.example.dester.MainActivity.onCreate(MainActivity.java:17)
01-17 03:15:44.537: E/AndroidRuntime(2203): at android.app.Activity.performCreate(Activity.java:5231)
01-17 03:15:44.537: E/AndroidRuntime(2203): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
01-17 03:15:44.537: E/AndroidRuntime(2203): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
01-17 03:15:44.537: E/AndroidRuntime(2203): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
01-17 03:15:44.537: E/AndroidRuntime(2203): at android.app.ActivityThread.access$800(ActivityThread.java:135)
01-17 03:15:44.537: E/AndroidRuntime(2203): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
01-17 03:15:44.537: E/AndroidRuntime(2203): at android.os.Handler.dispatchMessage(Handler.java:102)
01-17 03:15:44.537: E/AndroidRuntime(2203): at android.os.Looper.loop(Looper.java:136)
01-17 03:15:44.537: E/AndroidRuntime(2203): at android.app.ActivityThread.main(ActivityThread.java:5017)
01-17 03:15:44.537: E/AndroidRuntime(2203): at java.lang.reflect.Method.invokeNative(Native Method)
01-17 03:15:44.537: E/AndroidRuntime(2203): at java.lang.reflect.Method.invoke(Method.java:515)
01-17 03:15:44.537: E/AndroidRuntime(2203): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
01-17 03:15:44.537: E/AndroidRuntime(2203): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
01-17 03:15:44.537: E/AndroidRuntime(2203): at dalvik.system.NativeStart.main(Native Method)
When i first got the error i thought it must be something simple, so i cleaned and rebuilt it again and still got the same error. Then i searched for info on java.lang.NoClassDefFoundError
and i found out that it had something to do with VM not being to locate a class that it was asked to load. In this case that would be the Style class.
I have spent almost 24 hours on this and have tried lots of solutions, all too no avail.
Just incase, my java compiler compliance level is 1.6 and i using JRE6 Thanks
Style.class
. – Yarkand