NullPointerException:int android.support.v4.app.FragmentManagerImpl.mCurState null对象引用

时间:2015-01-05 15:45:29

标签: android android-fragments nullpointerexception android-5.0-lollipop android-support-library

我已经使用Android L更新了我的应用,我有这个例外,我无法理解:

NullPointerException:尝试读取字段' int android.support.v4.app.FragmentManagerImpl.mCurState'在空对象引用上

有人可以帮助我吗?

build.gradle中的

dependencies {
    compile files('libs/libGoogleAnalyticsServices.jar')
    compile 'com.android.support:support-v4:21.0.3'
    compile 'com.android.support:appcompat-v7:21.0.3'
    compile 'com.google.android.gms:play-services:6.5.87'
}

堆栈跟踪:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lucagrillo.myapp/com.lucagrillo.myapp.MainActivity}: android.view.InflateException: Binary XML file line #23: Error inflating class fragment
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
    at android.app.ActivityThread.access$800(ActivityThread.java:144)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5221)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Caused by: android.view.InflateException: Binary XML file line #23: Error inflating class fragment
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:763)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
    at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:229)
    at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:103)
    at com.lucagrillo.myapp.MainActivity.onCreate(MainActivity.java:153)
    at android.app.Activity.performCreate(Activity.java:5933)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
    ... 10 more
Caused by: java.lang.NullPointerException: Attempt to read from field 'int android.support.v4.app.FragmentManagerImpl.mCurState' on a null object reference
    at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2182)
    at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:297)
    at android.support.v7.app.ActionBarActivity.onCreateView(ActionBarActivity.java:547)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
    ... 20 more   

非常感谢

0 个答案:

没有答案