Androis工作室 - APP在启动后不久中止

时间:2017-08-16 13:49:08

标签: android

早上好朋友, 我刚刚在android studio完成了一个项目,我在这里遇到了问题。当生成应用程序并在智能手机上安装(android nougat 7.1.1 oneplus3)时,它就会中止。在模拟器中,它给出了应用程序停止和中止的消息。我需要你更有经验的帮助。我是初学者。当您尝试打开应用程序时,下面是LOGCAT行:

    08-16 13:51:44.610 13313-13313/agdesenvolvimentoweb.projetopiloto I/art: Not late-enabling -Xcheck:jni (already on)
08-16 13:51:44.610 13313-13313/agdesenvolvimentoweb.projetopiloto W/art: Unexpected CPU variant for X86 using defaults: x86_64
08-16 13:51:45.249 13313-13313/agdesenvolvimentoweb.projetopiloto W/System: ClassLoader referenced unknown path: /data/app/agdesenvolvimentoweb.projetopiloto-1/lib/x86_64
08-16 13:51:45.281 13313-13313/agdesenvolvimentoweb.projetopiloto I/InstantRun: starting instant run server: is main process
08-16 13:51:45.576 13313-13313/agdesenvolvimentoweb.projetopiloto W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
08-16 13:51:45.647 13313-13313/agdesenvolvimentoweb.projetopiloto W/System: ClassLoader referenced unknown path: /system/app/Chrome/lib/x86_64
08-16 13:51:45.648 13313-13313/agdesenvolvimentoweb.projetopiloto D/ApplicationLoaders: ignored Vulkan layer search path /system/app/Chrome/lib/x86_64:/system/app/Chrome/Chrome.apk!/lib/x86_64:/system/lib64:/vendor/lib64 for namespace 0x7fcbeb8400f0
08-16 13:51:45.650 13313-13313/agdesenvolvimentoweb.projetopiloto I/WebViewFactory: Loading com.android.chrome version 55.0.2883.91 (code 288309162)
08-16 13:51:45.670 13313-13313/agdesenvolvimentoweb.projetopiloto I/cr_LibraryLoader: Time to load native libraries: 2 ms (timestamps 9774-9776)
08-16 13:51:45.670 13313-13313/agdesenvolvimentoweb.projetopiloto I/cr_LibraryLoader: Expected native library version number "55.0.2883.91", actual native library version number "55.0.2883.91"
08-16 13:51:45.678 13313-13313/agdesenvolvimentoweb.projetopiloto I/cr_LibraryLoader: Expected native library version number "55.0.2883.91", actual native library version number "55.0.2883.91"
08-16 13:51:45.678 13313-13313/agdesenvolvimentoweb.projetopiloto I/chromium: [INFO:library_loader_hooks.cc(163)] Chromium logging enabled: level = 0, default verbosity = 0
08-16 13:51:45.683 13313-13313/agdesenvolvimentoweb.projetopiloto I/cr_BrowserStartup: Initializing chromium process, singleProcess=true

                                                                                       [ 08-16 13:51:45.692 13313:13313 D/         ]
                                                                                       HostConnection::get() New Host Connection established 0x7fcbd18d6000, tid 13313


                                                                                       [ 08-16 13:51:45.694 13313:13313 W/         ]
                                                                                       Unrecognized GLES max version string in extensions: ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 
08-16 13:51:45.696 13313-13313/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglCreateContext: 0x7fcbde5c12a0: maj 2 min 0 rcv 2
08-16 13:51:45.697 13313-13313/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglMakeCurrent: 0x7fcbde5c12a0: ver 2 0 (tinfo 0x7fcbd18f1c20)
08-16 13:51:45.798 13313-13359/agdesenvolvimentoweb.projetopiloto W/cr_media: Requires BLUETOOTH permission
08-16 13:51:45.807 13313-13313/agdesenvolvimentoweb.projetopiloto I/cr_Ime: ImeThread is enabled.
08-16 13:51:45.885 13313-13368/agdesenvolvimentoweb.projetopiloto I/OpenGLRenderer: Initialized EGL, version 1.4
08-16 13:51:45.885 13313-13368/agdesenvolvimentoweb.projetopiloto D/OpenGLRenderer: Swap behavior 1

                                                                                    [ 08-16 13:51:45.885 13313:13368 D/         ]
                                                                                    HostConnection::get() New Host Connection established 0x7fcbcdea13c0, tid 13368


                                                                                    [ 08-16 13:51:45.888 13313:13368 W/         ]
                                                                                    Unrecognized GLES max version string in extensions: ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 
08-16 13:51:45.892 13313-13368/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglCreateContext: 0x7fcbcdf532c0: maj 2 min 0 rcv 2
08-16 13:51:45.904 13313-13368/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglMakeCurrent: 0x7fcbcdf532c0: ver 2 0 (tinfo 0x7fcbcdfb3920)
08-16 13:51:45.979 13313-13374/agdesenvolvimentoweb.projetopiloto E/libEGL: validate_display:99 error 3008 (EGL_BAD_DISPLAY)

                                                                            [ 08-16 13:51:45.980 13313:13374 D/         ]
                                                                            HostConnection::get() New Host Connection established 0x7fcbcd52f2e0, tid 13374


                                                                            [ 08-16 13:51:45.982 13313:13374 W/         ]
                                                                            Unrecognized GLES max version string in extensions: ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 
08-16 13:51:45.995 13313-13374/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglCreateContext: 0x7fcbcdf55ca0: maj 2 min 0 rcv 2
08-16 13:51:45.998 13313-13374/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglMakeCurrent: 0x7fcbcdf55ca0: ver 2 0 (tinfo 0x7fcbcd54d900)
08-16 13:51:46.018 13313-13313/agdesenvolvimentoweb.projetopiloto W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
08-16 13:51:46.050 13313-13313/agdesenvolvimentoweb.projetopiloto W/art: Attempt to remove non-JNI local reference, dumping thread
08-16 13:51:46.054 13313-13368/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglMakeCurrent: 0x7fcbcdf532c0: ver 2 0 (tinfo 0x7fcbcdfb3920)
08-16 13:51:46.067 13313-13374/agdesenvolvimentoweb.projetopiloto I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
08-16 13:51:46.088 13313-13324/agdesenvolvimentoweb.projetopiloto W/art: Suspending all threads took: 12.371ms
08-16 13:51:46.167 13313-13374/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglCreateContext: 0x7fcbcdf569c0: maj 2 min 0 rcv 2
08-16 13:51:46.169 13313-13374/agdesenvolvimentoweb.projetopiloto D/EGL_emulation: eglMakeCurrent: 0x7fcbcdf569c0: ver 2 0 (tinfo 0x7fcbcd54d900)
08-16 13:51:46.175 13313-13374/agdesenvolvimentoweb.projetopiloto E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
08-16 13:51:46.176 13313-13374/agdesenvolvimentoweb.projetopiloto E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824
08-16 13:51:46.176 13313-13374/agdesenvolvimentoweb.projetopiloto E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008cdf
08-16 13:51:46.176 13313-13374/agdesenvolvimentoweb.projetopiloto E/eglCodecCommon: glUtilsParamSize: unknow param 0x00008824
08-16 13:51:46.180 13313-13374/agdesenvolvimentoweb.projetopiloto E/libEGL: called unimplemented OpenGL ES API
08-16 13:51:46.707 13313-13313/agdesenvolvimentoweb.projetopiloto W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 13313
08-16 13:51:46.709 13313-13313/agdesenvolvimentoweb.projetopiloto I/Choreographer: Skipped 40 frames!  The application may be doing too much work on its main thread.
08-16 13:51:46.716 13313-13313/agdesenvolvimentoweb.projetopiloto W/art: Attempt to remove non-JNI local reference, dumping thread
08-16 13:51:46.752 13313-13313/agdesenvolvimentoweb.projetopiloto E/chromium: [ERROR:interface_registry.cc(104)] Failed to locate a binder for interface: autofill::mojom::PasswordManagerDriver
08-16 13:51:46.753 13313-13313/agdesenvolvimentoweb.projetopiloto D/AndroidRuntime: Shutting down VM


                                                                                    --------- beginning of crash
08-16 13:51:46.753 13313-13313/agdesenvolvimentoweb.projetopiloto E/AndroidRuntime: FATAL EXCEPTION: main
                                                                                    Process: agdesenvolvimentoweb.projetopiloto, PID: 13313
                                                                                    java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ProgressDialog.dismiss()' on a null object reference
                                                                                        at agdesenvolvimentoweb.projetopiloto.MainActivity$MyWebViewClient.onPageFinished(MainActivity.java:161)
                                                                                        at com.android.webview.chromium.WebViewContentsClientAdapter.onPageFinished(WebViewContentsClientAdapter.java:545)
                                                                                        at org.chromium.android_webview.AwContentsClientCallbackHelper$MyHandler.handleMessage(AwContentsClientCallbackHelper.java:201)
                                                                                        at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                        at android.os.Looper.loop(Looper.java:154)
                                                                                        at android.app.ActivityThread.main(ActivityThread.java:6119)
                                                                                        at java.lang.reflect.Method.invoke(Native Method)
                                                                                        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                                                                                        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

2 个答案:

答案 0 :(得分:0)

首先,只放置您的应用程序的日志。

其次,您尝试在未初始化时关闭进度对话框。

java.lang.NullPointerException: Attempt to invoke virtual 
method 'void android.app.ProgressDialog.dismiss()' on a null object reference

我开始使用MainActivity.java:161

进行检查

答案 1 :(得分:0)

您的代码中的某个位置的进度条上设置了dismiss(),但没有初始化它。

DO

 if(progress!= null)
     progress.dismiss()