草庐IT

runtimeexception

全部标签

android - java.lang.RuntimeException : Unable to start activity ComponentInfo {. 。}

在下面的代码中,我尝试从Activity中调用一个fragment主要ActivitypublicclassWalletActivityextendsAppCompatActivity{privateButtonmBankAccount;privateButtonmCreditCard;privateButtonmPassport;privateButtonmLicence;privateButtonmIdentity;privateButtonmWifiRouter;@OverrideprotectedvoidonCreate(BundlesavedInstanceState){su

Android - RuntimeException,哪里出错了?

在这个应用程序中,我有3个按钮和1个TextView。在现阶段,我基本上留了很多东西空白。例如我还没有实现按钮功能。但是现在里面出现了运行时错误。连元素都显示不出来。你能帮忙吗?importandroid.hardware.Sensor;importandroid.hardware.SensorEvent;importandroid.hardware.SensorEventListener;importandroid.hardware.SensorManager;importandroid.os.Bundle;importandroid.app.Activity;importandro

android - GoogleAuthUtil.getToken() 抛出 : RuntimeException: Can't create handler inside thread that has not called Looper. prepare()

这个GoogleAuthUtilgetToken()调用:Stringtoken=GoogleAuthUtil.getToken(appContext,accountName,scope);偶尔会因以下异常而失败:java.lang.RuntimeException:Can'tcreatehandlerinsidethreadthathasnotcalledLooper.prepare():ak:GooglePlayServicesNotAvailableatcom.google.android.gms.auth.GoogleAuthUtil.a(UnknownSource)atcom

android - java.lang.RuntimeException : An error occured while executing doInBackground() 错误

我正在使用下面的代码。它在AndroidStudio中出错。你能帮忙吗?根据我的理解,args[0]没有填充某些值。这是为什么?如果args[0]没有为此选择任何其他实现的任何值。importandroid.app.Activity;importandroid.content.Intent;importandroid.os.AsyncTask;importandroid.os.Bundle;importandroid.provider.DocumentsContract;importandroid.renderscript.Element;importandroid.util.Log;

android - 如何解决致命异常java.lang.RuntimeException : An error occured while executing doInBackground()

我正在开发与聊天相关的类似应用程序我正在使用后台同步类有时会出现强制关闭我正在使用.netwebservices后台我正在接收更新到ui的消息和图像后台下载过程错误是:05-1705:24:17.925:ERROR/AndroidRuntime(1618):FATALEXCEPTION:AsyncTask#105-1705:24:17.925:ERROR/AndroidRuntime(1618):java.lang.RuntimeException:AnerroroccuredwhileexecutingdoInBackground()05-1705:24:17.925:ERROR/A

android - java.lang.RuntimeException : Unable to instantiate activity 错误

我已经尝试了所有可能的解决方案来解决这个问题,但似乎没有任何效果......当我将我的SDK工具版本从r16更新到r19并将SDK平台工具更新到r11时,问题就出现了。我将所有类都包含在list中,并且在此更新之前一切正常。你知道如何解决这个问题吗?(我从这个网站和其他网站尝试了很多解决方案......)这是我的错误日志:05-1723:29:10.888:E/AndroidRuntime(20945):FATALEXCEPTION:main05-1723:29:10.888:E/AndroidRuntime(20945):java.lang.RuntimeException:Unab

java - Robolectric 测试抛出 RuntimeException : java. lang.ClassNotFoundException

我用Robolectric写了简单的hello-world测试。我已将适当的依赖项添加到build.gradle中:testCompile'junit:junit:4.12'testCompile"org.robolectric:robolectric:3.0"这是我要测试的简单CartModel.java:publicclassCartModel{publicfloattotalAmount;publicintproducts;publicvoidaddToCart(floatproductPrice){products++;totalAmount+=productPrice;}}C

android - KSOAP2 java.lang.RuntimeException : Cannot serialize 错误

我正在尝试使用来自.net网络服务的方法。Web服务的代码在namespace末尾有一个“/”[WebService(Namespace="http://www.mynamespace.com/")][WebServiceBinding(ConformsTo=WsiProfiles.BasicProfile1_1)]这是.net方法调用POST/TelematicsWebService/Service.asmxHTTP/1.1Host:localhostContent-Type:text/xml;charset=utf-8Content-Length:lengthSOAPAction:

android - RuntimeException 在 Android 中导致 ANR 而不是崩溃

我两次都遇到ANR:thrownewNullPointerException("randomnullpointer");和while(true){}只有在异常部分VM才会真正关闭(D/AndroidRuntime:ShuttingdownVM)。第二个问题是:如何强制应用程序崩溃而不是ANR并在logcat中获取堆栈跟踪?更新从ANR和崩溃之间的区别更改标题。更新它仅发生在大约3-4个月前。从那时起,找到崩溃的唯一方法就是毫无理由地将trycatchboxes放在各处。 最佳答案 我遇到了同样的问题,在调试时遇到了代码“throwR

android - catch "RuntimeException: Canvas: trying to draw too large..."

我有一个应用程序,它从文件系统绘制图像到屏幕,如下所示:Bitmapimage=BitmapFactory.decodeFile(file.getPath());imageView.setImageBitmap(image);如果图像非常大,我会看到此错误:java.lang.RuntimeException:Canvas:tryingtodrawtoolarge(213828900bytes)bitmap.atandroid.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCanvas.java:260)atandroid.gr