更新Android Studio后出现NullpointerException

时间:2014-11-06 13:47:48

标签: android nullpointerexception android-studio

所以我刚刚更新了Android工作室,想继续使用我的应用程序,应用程序一直在崩溃..

我正在使用最新的Android Studio和SDK .. 摇篮:

   apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion '21.0.1'
    defaultConfig {
        applicationId "android.com.dada.packers"
        minSdkVersion 9
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.google.android.gms:play-services:6.1.71'
    compile 'me.dm7.barcodescanner:zbar:1.5'
    compile 'com.android.support:support-v4:21.0.0'
    compile 'com.android.support:appcompat-v7:21.0.0'
}

*错误*

11-06 14:39:51.890  29743-29743/android.com.dada.packers E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.NullPointerException
        at android.widget.ArrayAdapter.createViewFromResource(ArrayAdapter.java:392)
        at android.widget.ArrayAdapter.getView(ArrayAdapter.java:362)
        at android.widget.AbsListView.obtainView(AbsListView.java:2627)
        at android.widget.ListView.makeAndAddView(ListView.java:1852)
        at android.widget.ListView.fillDown(ListView.java:682)
        at android.widget.ListView.fillFromTop(ListView.java:748)
        at android.widget.ListView.layoutChildren(ListView.java:1667)
        at android.widget.AbsListView.onLayout(AbsListView.java:2447)
        at android.view.View.layout(View.java:15204)
        at android.view.ViewGroup.layout(ViewGroup.java:4793)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
        at android.view.View.layout(View.java:15204)
        at android.view.ViewGroup.layout(ViewGroup.java:4793)
        at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:911)
        at android.view.View.layout(View.java:15204)
        at android.view.ViewGroup.layout(ViewGroup.java:4793)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
        at android.view.View.layout(View.java:15204)
        at android.view.ViewGroup.layout(ViewGroup.java:4793)
        at android.support.v7.internal.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:502)
        at android.view.View.layout(View.java:15204)
        at android.view.ViewGroup.layout(ViewGroup.java:4793)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
        at android.view.View.layout(View.java:15204)
        at android.view.ViewGroup.layout(ViewGroup.java:4793)
        at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1677)
        at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1531)
        at android.widget.LinearLayout.onLayout(LinearLayout.java:1440)
        at android.view.View.layout(View.java:15204)
        at android.view.ViewGroup.layout(ViewGroup.java:4793)
        at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
        at android.view.View.layout(View.java:15204)
        at android.view.ViewGroup.layout(ViewGroup.java:4793)
        at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2260)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2007)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1249)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6364)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:791)
        at android.view.Choreographer.doCallbacks(Choreographer.java:591)
        at android.view.Choreographer.doFrame(Choreographer.java:561)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:777)
        at android.os.Handler.handleCallback(Handler.java:730)
        at android.os.Handler.dispatchMessage(Handler.java:92)
        at android.os.Looper.loop(Looper.java:176)
        at android.app.ActivityThread.main(ActivityThread.java:5419)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:525)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1046)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:862)
        at dalvik.system.NativeStart.main(Native Method)


-11-06 14:39:52.035    2359-2820/? I/WindowManager﹕ Screenshot Window{43cc4d30 u0 

android.com.dada.packers/android.dad.startingpoint.nl.MyActivity} was all black! mSurfaceLayer=21020 minLayer=21020 maxLayer=21020
11-06 14:39:52.045    2359-2474/? D/CrashAnrDetector﹕ processName: android.com.dada.packers
11-06 14:39:52.050    2359-2474/? D/CrashAnrDetector﹕ broadcastEvent : android.com.dada.packers data_app_crash
11-06 14:40:01.565    1929-2180/? E/Vold﹕ isAsecInDirectory: asecName (android.com.dada.packers-1.asec) not in '/data/app-asec'
11-06 14:40:01.570    2359-2491/? D/MountService﹕ :::: getSecureContainerFilesystemPath :: id = android.com.dada.packers-1, result = /mnt/secure/asec/android.com.dada.packers-1.asec
11-06 14:41:29.305    2359-3219/? I/ActivityManager﹕ Process android.com.dada.packers (pid 29743) (adj 15) has died.

正如你所看到我使用的是最新版本21,它只是一直崩溃和崩溃..我希望你们能帮忙


EDIT   这是阵列表吗?因为我似乎没有另一个/./

 protected JSONObject doInBackground(String... args) {
            List<NameValuePair> params = new ArrayList<NameValuePair>();
            params.add(new BasicNameValuePair(TAG_ID, xyz));
            params.add(new BasicNameValuePair("productgroep", xyz));

            JSONParser jParser = new JSONParser();

0 个答案:

没有答案