Android各种报错
Android格调小窝
啦啦啦
展开
-
解决recycleView.addItemDecoration方法随着布局刷新间隔不断增大
记录下错误!!!好记性不如烂笔头!!!每次刷新的时候recyclerview都会重复调用addItemDecoration方法。导致每一次刷新recyclerview的间隔都会增大。解决办法如下,使用ItemDecoration的时候先判空就行了,==0就设置,不为0就不设置/**分割线判空*/if (holder.mRecyclerView.getItemDecorationCount() == 0) { holder.mRecyclerView.addItemDe..原创 2020-11-17 15:19:04 · 1308 阅读 · 0 评论 -
Unsupported Modules Detected: Compilation is not supported for following modules
打开AS时出现了Unsupported Modules Detected: Compilation is not supported for following modules: app, KeyboardView. Unfortunately you can’t have non-Gradle Java modules and Android-Gradle modules in one project的错误,解决步骤如下:(1)关闭as(2)删除.idea目录(3)删除app/build目录(4)原创 2020-10-14 14:08:45 · 830 阅读 · 0 评论 -
androidStudio分包引起的系统崩溃,报错ClassNotFoundException: Didn‘t find class “XXXView“ on path: DexPath../.apk
原先跑得好好的项目,在studio3里面build出来后居然在好几台Android 4.2的机器上运行不了。(Android 5以上的机器就没发现问题。)都是一启动就爆错误:java.lang.RuntimeException: Unable to get provider com.alibaba.sdk.android.feedback.util.FBFileProvider: java.lang.ClassNotFoundException: Didn't find class "com.ali原创 2020-08-05 09:22:30 · 769 阅读 · 0 评论 -
Android出现java.lang.RuntimeException: Can‘t toast on a thread that has not called Looper.prepare()
今天又是写代码的美好一天>_<往常运行的好好的程序,今天运行在弹出吐司(Toast)时却出现了java.lang.RuntimeException: Can’t toast on a thread that has not called Looper.prepare(),ε=(´ο`*)))唉 Process: com.qdsg.screen, PID: 23288 java.lang.RuntimeException: Can't toast on a thread tha...原创 2020-07-16 15:46:03 · 598 阅读 · 0 评论 -
遇到的问题- All WebView methods must be called on the same thread
此问题出现的原因是:在js调用后的Java回调线程并不是主线程;解决上述的异常,将webview操作放在主线程中即可:webView.post(new Runnable() { @Override public void run() { webView.loadUrl(YOUR_URL). }});引申:JavaScript和Java的交互是在子线程上面进行的因为JavaScript和Java交互是在子线程上面进行的,所以如果..原创 2020-06-30 16:53:23 · 1288 阅读 · 0 评论 -
* What went wrong: Execution failed for task ':app:lintVitalRelease'. > Lint found fatal errors whil
打包报错:* What went wrong:Execution failed for task ':app:lintVitalRelease'.> Lint found fatal errors while assembling a release target.解决办法:在build.gradle里面加入以下代码:android { lintOptions { checkReleaseBuilds false // Or,原创 2020-05-13 13:29:25 · 2542 阅读 · 1 评论 -
输入法引起的内存泄漏
/***用于输入法管理*/publicclassInputMethodUtils{publicstaticvoidfixInputMethodManagerLeak(ActivitydestContext){if(destContext==null){return;}Inp...原创 2020-04-20 15:43:39 · 572 阅读 · 1 评论 -
Invoke-customs are only supported starting with Android O (--min-api 26) Message{kind=ERROR,……
在gradle.build中添加以下内容:compileOptions {sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8}原创 2019-09-24 20:37:00 · 186 阅读 · 0 评论 -
【Problem】java.net.ProtocolException: Expected ':status' header not present
java.net.ProtocolException: Expected ‘:status’ header not present解决方法:将okhttp版本修改为3.9.0以上亲测有用原创 2019-08-26 18:51:11 · 4844 阅读 · 0 评论 -
Error:No such property: GradleVersion for class: JetGradlePlugin
错误原因:IDE 版本(GradlePlugin)和 Gradle 版本不匹配导致这个错误。GradlePlugin 版本和 AndroidStudio 版本一致,与 Gradle 版本有一张对应表。在文章末尾。作为一个 Android 开发人员,平时都要和 Gradle 打交道,却也仅仅是在简单的知道状态。于是很多时候都被其搞得十分难受,修改gradle-wrapper.propertie...原创 2019-07-25 10:43:01 · 34890 阅读 · 0 评论 -
Gradle sync failed: Another 'refresh project' task is currently running for,手动下载gradle
一.修改gradle-wrapper.properties修改gradle-wrapper.properties 中的 distributionUrl,改成我们想要的版本,只改后面的版本就可以了,前面的部分不要改。具体版本看下面链接:Gradle下载地址:二.下载之后,打开C:\Users\Administrator目录找到.gradle目录 打开到.gradle\wrapper\dis...原创 2019-07-19 17:12:27 · 1401 阅读 · 0 评论