Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Updated SDK version, getting ClassNotFoundException: android.support.v4.view.ViewPager

Tags:

android

When i was working on my Android project i found Logcat to be annoying (not keeping the scroll bar at a given point) and read that updating SDK versions adds a pause button to combat this issue. I updated to SDK version 17 and now i am having some strange problems that i didn't have before. I deleted and added the android support library but no luck. Ive been reading around the interwebs but i still cant figure it out. Log is below.

03-22 15:54:18.558: E/AndroidRuntime(11597): FATAL EXCEPTION: main
03-22 15:54:18.558: E/AndroidRuntime(11597): java.lang.RuntimeException: Unable to start   activity ComponentInfo{kris.android/kris.android.ActivityPortfolio}:  android.view.InflateException: Binary XML file line #184: Error inflating class android.support.v4.view.ViewPager
03-22 15:54:18.558: E/AndroidRuntime(11597):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1821)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1842)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at android.app.ActivityThread.access$1500(ActivityThread.java:132)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1038)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at android.os.Handler.dispatchMessage(Handler.java:99)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at android.os.Looper.loop(Looper.java:150)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at android.app.ActivityThread.main(ActivityThread.java:4263)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at java.lang.reflect.Method.invokeNative(Native Method)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at java.lang.reflect.Method.invoke(Method.java:507)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at dalvik.system.NativeStart.main(Native Method)
03-22 15:54:18.558: E/AndroidRuntime(11597): Caused by: android.view.InflateException: Binary XML file line #184: Error inflating class android.support.v4.view.ViewPager
03-22 15:54:18.558: E/AndroidRuntime(11597):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:581)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:231)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at android.app.Activity.setContentView(Activity.java:1742)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at kris.android.ActivityPortfolio.onCreate(ActivityPortfolio.java:44)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1072)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1785)
03-22 15:54:18.558: E/AndroidRuntime(11597):    ... 11 more
03-22 15:54:18.558: E/AndroidRuntime(11597): Caused by: java.lang.ClassNotFoundException: android.support.v4.view.ViewPager in loader dalvik.system.PathClassLoader[/data/app/kris.android-2.apk]
03-22 15:54:18.558: E/AndroidRuntime(11597):    at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at android.view.LayoutInflater.createView(LayoutInflater.java:471)
03-22 15:54:18.558: E/AndroidRuntime(11597):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
03-22 15:54:18.558: E/AndroidRuntime(11597):    ... 21 more
like image 297
wdziemia Avatar asked Mar 22 '12 21:03

wdziemia


1 Answers

Go to Project->Properties->Java Build Path than select Order and export tab. Set android-support-v4.jar library checked and up it into top of the list. And then clean and rebuild project.

like image 57
Vladimir Avatar answered Nov 03 '22 22:11

Vladimir