Android-日常问题汇总

  1. 小米手机显示安卓失败之类
    开发者选项允许usb安卓

  2. java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
    https://bbs.csdn.net/topics/392342785?page=1
    http://bbs.bugcode.cn/t/8920

3.This Gradle plugin requires Studio 3.0 minimum
https://blog.csdn.net/shenggaofei/article/details/78165940

4.Could not find com.android.tools.build:gradle:3.0.0.
https://blog.csdn.net/zhouxianling233/article/details/78359217

5.Error:Unable to find method 'com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;'.
https://blog.csdn.net/p576518762/article/details/78356137

6.微信登录 支付分享
https://www.cnblogs.com/yishaochu/p/7531638.html
微信登录.分享
https://www.cnblogs.com/shen-hua/p/6343736.html

7.Error:Failed to resolve: com.android.support:appcompat-v7:27.+
https://blog.csdn.net/qq_31344665/article/details/79283979

8.解决Android Studio Gradle Build Running慢的问题
https://www.cnblogs.com/oukunqing/p/5864671.html?utm_source=itdadao&utm_medium=referral
https://blog.csdn.net/dabaoonline/article/details/50550423
https://blog.csdn.net/a549742320/article/details/52525257

9.Error:The module 'app' is an Android project without build variants, and cannot be built.
Please fix the module's configuration in the build.gradle file and sync the project again.
https://stackoverflow.com/questions/49834961/the-module-app-is-an-android-project-without-build-variants
项目最后用 gradle 文件点击的运行

10.unable to access android sdk add-on list的解决方法
https://blog.csdn.net/u014471160/article/details/78505653

The specified Android SDK Build Tools version (27.0.1) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.2.
Android SDK Build Tools 27.0.3 will be used.

11.Android studio 提示 module not specified
Build项目还是不行,那么就重启了as( File->Invalidate Caches/Restart)

12Android Studio修改字体大小
https://www.cnblogs.com/diyishijian/p/6824328.html
https://blog.csdn.net/niaonao/article/details/51378596

13.> Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory.

https://blog.csdn.net/sky_castle/article/details/53606929

buid 配置 java
14.Error:Could not find com.android.tools.build:gradle:3.1.2.
build 配置 少了 goole

15.android-apt plugin is incompatible with the Android Gradle plugin. Please use 'annotationProcessor' configuration instead.
https://blog.csdn.net/sxk874890728/article/details/78367726

16.如何更改android Studio logcat字体大小?
https://blog.csdn.net/ykttt1/article/details/46291029

17.Error:Jack is required to support java 8 language features. Either enable Jack or remove sourceCompatibility JavaVersion.VERSION_1_8.
https://blog.csdn.net/fullstackdeveloper/article/details/52701707

18.The version of Gradle you are using (3.3) does not support the forTasks() method on BuildActionExecuter. Support for this is available in Gradle 3.5 and all later

https://blog.csdn.net/baidu_38291700/article/details/80263294

19. org.gradle.internal.resource.transport.http.HttpRequestException: Could not HEAD
https://blog.csdn.net/yuanxw44/article/details/80061381
google()

20.Annotation processors must be explicitly declared now. The following dependencies on the compile cl (7.0.1)
https://blog.csdn.net/keep_holding_on/article/details/76188657
javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }

21.design editor is unavailable until a successful build
https://blog.csdn.net/zhs966877/article/details/78466884?locationNum=6&fps=1
Rebuild Project

22.studio 中 新文件直接提交svn项目中
https://blog.csdn.net/acmen99/article/details/76825426

23.listview 数据回调监听
https://blog.csdn.net/belyxiong/article/details/46819671

24 动画实现的overridePendingTransition 注意点
https://blog.csdn.net/u010015108/article/details/49616003

25 Call requires API level 24 (current min is 15): java.util.stream.Stream#map less... (Ctrl+F1)
This check scans through all the Android API calls in the application and warns about any calls that are not available on all versions targeted by this application (according to its minimum SDK attribute in the manifest). If you really want to use this API and don't need to support older devices just set the minSdkVersion in your build.gradle or AndroidManifest.xml files. If your code is deliberately accessing newer APIs, and you have ensured (e.g. with conditional execution) that this code will only ever be called on a supported platform, then you can annotate your class or method with the @TargetApi (忽略)

25.决“com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536”问题
https://www.cnblogs.com/yeahgis/p/4660873.html

26.Failed to find byte code for java/util/function/Predicate
https://blog.csdn.net/qq_31433709/article/details/80969761

27,oppo 极光推送收不到
https://community.jiguang.cn/t/topic/29762

28无法访问https://developer.android.com相应的网站
https://blog.csdn.net/saywhat_sayhello/article/details/78989077

29.Could not find method google() for arguments [] on repository container of type
gradle 的版本配置太低
distributionUrl=https://services.gradle.org/distributions/gradle-4.6-all.zip
classpath 'com.android.tools.build:gradle:3.1.4'

30.import io.reactivex.android.schedulers.AndroidSchedulers 类找不到
io.reactivex.rxjava2:rxandroid:2.0.2版本 改成 2.0.1 然后build

31.dialog dismiss failed : java.lang.IllegalArgumentException: no dialog with id 1 was ever shown via Activity#showDialog
app 中 build.grale 配置 multiDexEnabled true 配置
加 apllication中 代码
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(base);
}

32 极光推送 web推送 可以,api推送不可以
ok了 web 自定义推送 可以成功。 api 推送不成功。 要debug 模式true下

33. studio 占用 c盘太大的问题 可选的
C:\Users\Administrator\AppData\Local\Temp 删除 处理( 可能导致studio 所有项目的结构发生变化)

34.提示安装包已损坏
1.点击应用里。。所有用户卸载。
2.我的AS是3.2版本的,gradle版本是4.1的,前面自己写了demo,签名打包之后用应用宝安装,提示包已损坏,请重新下载。。。使用adb安装命令是可以正常安装,本地运行也是可以正常运行,但是用应用宝安装就出问题,尝试了各种网上说的方法,还是没有效果,最后看到一个帖子,里面提到“把build tools 版本改成27.0.2就行了”,我就试了一下,确实可行,这里只要修改在27以上就OK了,我的是27.0.3,在这里记录一下,下次碰到这个问题,就不怕忘记怎么处理了。
https://blog.csdn.net/chenhan0719/article/details/79738821

35.GPBI: {"kind":"error","text":"error: resource android:attr/ttcIndex not found.","sources":[{"file":"C:\Users\Administrator\.gradle\caches\transforms-1\files-1.1\support-compat-28.0.0.aar\6010d9958d2330d28494eb2d1ce90f89\res\values\values.xml","position":{"startLine":132,"startColumn":4,"startOffset":7725,"endColumn":69,"endOffset":7790}}],"original":"","tool":"AAPT"}
rxandroidVersion = "2.0.1" 2.0.2 改成2.0.1
还有 support 配置没有不对

36.这个问题是由于操作 33导致。studio project structure 目录结构发生变化
因为c盘空间不够啊 。按33操作导致。studio 有关插件失效 。

37. The following dependencies on the compile classpath are found to contain annotation processor
annotationProcessor 'com.google.dagger:dagger-compiler:2.16'

38.java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xsy.xcodeutil/com.xsy.demo.ui.LoginAct}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or

39.studio Failed resolution of: Landroid/support/v8/renderscript/RenderScript;
https://blog.csdn.net/fancylovejava/article/details/38558761
https://blog.csdn.net/x13945/article/details/51500849

40 PopupWindow全屏显示
https://blog.csdn.net/zuo_er_lyf/article/details/79446283poo

41.定时器
https://blog.csdn.net/lihenair/article/details/50386442
第三方底部菜单
https://blog.csdn.net/ss1168805219/article/details/53465885
https://github.com/roughike/BottomBar
地址选择器
https://github.com/ywp0919/AddressPickerLib
仿微博底部菜单
https://blog.csdn.net/silenceoo/article/details/78976477
https://github.com/DuShuYuan/PlusMenu

42.IllegalStateException: Can not perform this action after onSaveInstanceState
https://blog.csdn.net/edisonchang/article/details/49873669

43.Gson 解析空的
https://blog.csdn.net/jdsjlzx/article/details/51566536
https://blog.csdn.net/gengqiquan/article/details/52473334

44.If your code works fine without the missing classes, you can suppress the warnings with '
混淆打包问题 -dontwarn
https://blog.csdn.net/u012432755/article/details/46622043

45.Generate Signed APK: Errors while building APK. You can find the errors
转 https://blog.csdn.net/daojian5173/article/details/68951716
转 https://blog.csdn.net/zhuobattle/article/details/50251033
lintOptions {
checkReleaseBuilds false
abortOnError false
}

46.app瘦身
https://blog.csdn.net/luckyleaf666/article/details/60572736

47.studio 删除无效的引用
https://www.jianshu.com/p/0eee7fe083c2
https://jingyan.baidu.com/article/95c9d20d612a1dec4e7561c4.html

48.定时功能
http://www.cnblogs.com/xzf158/archive/2009/09/04/1560042.html
https://www.jianshu.com/p/dd5de8dbbe81

49.andrid 启动模式
https://blog.csdn.net/lvxiangan/article/details/42120951
https://www.cnblogs.com/claireyuancy/p/7387696.html

50.gridview 居中
https://www.oschina.net/question/72663_154704

51.android 9.0网络请求
build 配置成 28换成27的
https://www.cnblogs.com/renhui/p/9921790.html

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 159,716评论 4 364
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 67,558评论 1 294
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 109,431评论 0 244
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 44,127评论 0 209
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 52,511评论 3 287
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,692评论 1 222
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,915评论 2 313
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,664评论 0 202
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,412评论 1 246
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,616评论 2 245
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 32,105评论 1 260
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,424评论 2 254
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 33,098评论 3 238
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,096评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,869评论 0 197
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,748评论 2 276
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,641评论 2 271

推荐阅读更多精彩内容