vijayrawatsan / android-json-form-wizard

Android Material Json Form Wizard is a library for creating beautiful form based wizards within your app just by defining json in a particular format.
MIT License
356 stars 98 forks source link

java.lang.NullPointerException #7

Closed Ofiro closed 9 years ago

Ofiro commented 9 years ago
java.lang.RuntimeException: Unable to start activity ComponentInfo{www.simonpanel.co.il.simonpanel/com.vijay.jsonwizard.activities.JsonFormActivity}: java.lang.NullPointerException: Null pointer exception during instruction 'monitor-enter v2'
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2305)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2367)
            at android.app.ActivityThread.access$800(ActivityThread.java:148)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5274)
            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:909)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704)
     Caused by: java.lang.NullPointerException: Null pointer exception during instruction 'monitor-enter v2'
            at com.vijay.jsonwizard.activities.JsonFormActivity.getStep(JsonFormActivity.java:54)
            at com.vijay.jsonwizard.fragments.JsonFormFragment.getStep(JsonFormFragment.java:162)
            at com.vijay.jsonwizard.presenters.JsonFormFragmentPresenter.addFormElements(JsonFormFragmentPresenter.java:43)
            at com.vijay.jsonwizard.fragments.JsonFormFragment.onViewCreated(JsonFormFragment.java:69)
            at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:973)
            at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1138)
            at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:740)
            at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1501)
            at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:551)
            at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1220)
            at android.app.Activity.performStart(Activity.java:5993)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2367)
            at android.app.ActivityThread.access$800(ActivityThread.java:148)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1283)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5274)
            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:909)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:704)
vijayrawatsan commented 9 years ago

Hi @Ofiro Did you pass correct json in intent extra? intent.putExtra("json", "Your complete json"); Did you get below exception? Initialization error. Json passed is invalid :

Ofiro commented 9 years ago

You were right,the JSON was invalid. But I didn't get any related exception.