
Android异常
旺仔大牛
专注Android、Flutter开发,偶尔涉猎web、后端
展开
-
解决Android集成Firebase报错Didn‘t find class “com.google.firebase.iid.FirebaseInstanceId“
出现场景使用ionic开发跨平台app时,需要使用推送,所以集成了push-notifications,但是在Android编译时出现以下错误。Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.iid.FirebaseInstanceId"error:java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/fi原创 2021-08-26 09:06:05 · 2976 阅读 · 0 评论 -
解决You need to use a Theme.AppCompat theme (or descendant) with this activity
错误信息2019-07-24 15:35:40.385 18490-18490/com.adojayfan.rntest E/AndroidRuntime: FATAL EXCEPTION: main Process: com.adojayfan.rntest, PID: 18490 java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activ原创 2020-05-24 16:07:57 · 12648 阅读 · 5 评论 -
Android NDK: APP_STL stlport_static is no longer supported
编译ndk项目时,出现以下错误*** Android NDK: APP_STL stlport_static is no longer supported. Please switch to either c++_static or c++_shared. See https://developer.android.com/ndk/guides/cpp-support.html for more...原创 2019-08-10 16:31:12 · 4701 阅读 · 4 评论 -
Caused by:java.lang.UnsupportedOperationException: Can't convert to dimension:type=0x1
场景在一台手机上是正常的,换了一个不同尺寸分辨率的手机后运行时崩溃了。查看异常日志09-2 17:52:57.342: E/AndroidRuntime(9935):Caused by:java.lang.UnsupportedOperationException: Can't convert to dimension:type=0x1经过分析,是因为适配分辨率的问题。一般在res中创...原创 2019-03-27 13:01:08 · 566 阅读 · 0 评论 -
cleartext HTTP traffic not permitted
异常描述在使用Android P(9.0)的机型上,如果我们的app使用的是Okhttp或HttpUrlConnection做网络请求时,会在logcat中报以下的错误.原因从android 9.0开始,网络请求默认不支持没有加密的明文传输.解决方法在res/xml目录创建一个资源文件.如果没有xml目录,先创建一个.network_security_config.xml<...原创 2019-02-24 22:28:17 · 2514 阅读 · 0 评论 -
java.lang.unsatisfiedlinkerror解决方法
有时候我们接入第三方sdk的时候,同时导入了一些so库。编译运行后发生会报以下异常。java.lang.unsatisfiedlinkerror。 解决方法在主工程app的build.gradle中加入以下代码。作用是指定so库的位置。android { ............ sourceSets{ main{原创 2018-02-06 16:49:38 · 4334 阅读 · 0 评论 -
You need to use a Theme.AppCompat theme (or descendant) with this activity
报错场景在使用AlertDialog时产生此异常。原因Activity继承的是FragmentActivity, 而使用AlertDialog导入的包是android.support.v7.app.AlertDialog,造成不兼容import android.support.v7.app.AlertDialog;解决方法使用AlertDialog时导入的包更改为android.app.Alert原创 2016-12-03 02:11:13 · 359 阅读 · 0 评论