Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
484 views
in Technique[技术] by (71.8m points)

android - Binary XML file line #12: Error inflating class fragment

I have a strange error. I was working on a project that implement google map v2. everythings work fine until one day I got error in my eclipse. somehow I can not clean the project. so I delete the project and I check out agin from svn. after that I try to clean it and it works. When I want to run the project I got these error:

08-05 00:45:21.636: E/AndroidRuntime(16997): FATAL EXCEPTION: main
08-05 00:45:21.636: E/AndroidRuntime(16997): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.travelbook/com.example.travelbook.MainActivity}: android.view.InflateException: Binary XML file line #12: Error inflating class fragment
08-05 00:45:21.636: E/AndroidRuntime(16997):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2077)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2104)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at android.app.ActivityThread.access$600(ActivityThread.java:134)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1247)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at android.os.Handler.dispatchMessage(Handler.java:99)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at android.os.Looper.loop(Looper.java:137)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at android.app.ActivityThread.main(ActivityThread.java:4624)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at java.lang.reflect.Method.invokeNative(Native Method)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at java.lang.reflect.Method.invoke(Method.java:511)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at  com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:809)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at dalvik.system.NativeStart.main(Native Method)
08-05 00:45:21.636: E/AndroidRuntime(16997): Caused by: android.view.InflateException: Binary XML file line #12: Error inflating class fragment
08-05 00:45:21.636: E/AndroidRuntime(16997):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:699)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:741)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at android.view.LayoutInflater.inflate(LayoutInflater.java:491)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:252)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at android.app.Activity.setContentView(Activity.java:1837)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at com.example.travelbook.MainActivity.onCreate(MainActivity.java:63)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at android.app.Activity.performCreate(Activity.java:4479)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1050)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2041)
08-05 00:45:21.636: E/AndroidRuntime(16997):    ... 11 more
08-05 00:45:21.636: E/AndroidRuntime(16997): Caused by: android.app.Fragment$InstantiationException: Unable to instantiate fragment com.google.android.gms.maps.MapFragment: make sure class name exists, is public, and has an empty constructor that is public
08-05 00:45:21.636: E/AndroidRuntime(16997):    at android.app.Fragment.instantiate(Fragment.java:581)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at android.app.Fragment.instantiate(Fragment.java:549)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at android.app.Activity.onCreateView(Activity.java:4249)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:675)
08-05 00:45:21.636: E/AndroidRuntime(16997):    ... 21 more
08-05 00:45:21.636: E/AndroidRuntime(16997): Caused by: java.lang.ClassNotFoundException: com.google.android.gms.maps.MapFragment
08-05 00:45:21.636: E/AndroidRuntime(16997):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
08-05 00:45:21.636: E/AndroidRuntime(16997):    at android.app.Fragment.instantiate(Fragment.java:571)
08-05 00:45:21.636: E/AndroidRuntime(16997):    ... 24 more

It doesn't make sence to me because I don't change nothing to my code and as I said the project was working. someone know why is this happening? and how to solve it? I am using eclipse Juno

thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...