扫一扫,无锡餐饮小程序,手机访问
摘要:🔥 java.lang.RuntimeException: Unable to start activity ComponentInfo 🔥 E/AndroidRuntime: FATAL EXCEPTION: mainProcess: org.kotlin.async.task, PID: 6571java.lang.RuntimeException: Unable to start activity ComponentInfo{org.kotlin.asy…
🔥 java.lang.RuntimeException: Unable to start activity ComponentInfo 🔥 E/AndroidRuntime: FATAL EXCEPTION: main Process: org.kotlin.async.task, PID: 6571 java.lang.RuntimeException: Unable to start activity ComponentInfo{org.kotlin.async.task/org.kotlin.async.task.DownLoadActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ProgressBar.setProgress(int)' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3539) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3699) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2135) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:236) at android.app.ActivityThread.main(ActivityThread.java:8037) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ProgressBar.setProgress(int)' on a null object reference at org.kotlin.async.task.DownLoadActivity.onCreate(DownLoadActivity.java:36) at android.app.Activity.performCreate(Activity.java:8157) at android.app.Activity.performCreate(Activity.java:8129) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1310) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3512) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3699) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2135) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:236) at android.app.ActivityThread.main(ActivityThread.java:8037) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967) I/Process: Sending signal. PID: 6571 SIG: 9
出现成绩的缘由
onCreate函数里面加载的规划文件activity_main.xml不存在ProgressBar组件
处理计划?
在activity_main.xml里面定义ProgressBar的组件规划
?🔥? java.io.IOException: Cleartext HTTP traffic to download.sj.qq.com not permitted 🔥 W/System.err: java.io.IOException: Cleartext HTTP traffic to download.sj.qq.com not permitted W/System.err: at com.android.okhttp.HttpHandler$CleartextURLFilter.checkURLPermitted(HttpHandler.java:127) W/System.err: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:462) W/System.err: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:411) W/System.err: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:248) W/System.err: at org.kotlin.async.task.DownLoadActivity$Myasynctask.doInBackground(DownLoadActivity.java:99) W/System.err: at org.kotlin.async.task.DownLoadActivity$Myasynctask.doInBackground(DownLoadActivity.java:47) W/System.err: at android.os.AsyncTask$3.call(AsyncTask.java:394) W/System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:266) W/System.err: at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:305) W/System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) W/System.err: at java.lang.Thread.run(Thread.java:923)出现成绩的缘由
Android9.0 默许是不容许网络申请http链接
处理计划