android studio使用中遇到的问题记录

倒叙记录

13、fresco 几个库  在gradle下一直更新不下来
原因 做了 12 步的处理。设置了代理,但是队友 并没有代理软件  导致有几个包下不下来。典型的就是 fresco。
所以该配置可以忽略不上传





12、Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle.
或者提示网络连接异常。

就是被墙了gradle下载不下来,抓狂掉。我是有代理的,确是也一直下载不下来,查了很久参考: http://blog.csdn.net/zhengdan66/article/details/48158523
有效。确实是因为只设了http代理 没有设置https的代理
gradle.properties 文件中添加。(注意,我是有用shadowsockets 有代理)
systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=1080
systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=1080




11、 INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
xml文件有错


10、 as 上一run app 设备就重启,代码上没问题

参考9里的:rm -rf  data/debug  这下面的文件可能太大满了


9、设备install app 不成功 这个是设备的faq
提示:C:\Users\yefs>adb install D:\xxx.apk
failed to copy 'xxxx.apk' to '/data/local/tmp/xxxxx.apk':
rm failed for /data/local/tmp/xxxxxxx.apk, No such file or directory

解决:是app 装太多了 删除一些,还有就是adb shell进去   rm -rf  data/debug  这下面的文件可能太大满了


8、 ERROR: 9-patch image D:\test\res\drawable-hdpi\slot_reward_item_mask.9.png malformed.

as 对于图片要求的格式比较严格,命名为.9的图 必须是严格的.9图 如果不是就会报错,或者不够严格也会报错,比如.9图至少要做左边和上边, 如果这两个边有一个没做就会报错。详细描述可以参见: http://blog.csdn.net/msn465780/article/details/50072945


7、as 代码修改了 没有run到 device里  这个问题遇到了蛮多次
原因是因为我的build.gradle文件是写的自动打包,以包的版本号为包名的一部分,要是这样的话,当修改了mainFest 里的版本号后,点击run run的其实是上次的apk 
实际中是要跑大盘build.gradle文件里 稍微动下(比如打个空格) 让它重新构建下项目  才能把新的代码run到 device里 这是一个需要注意的地方


6、library的引入:问题把主干的library copy到分支,自动识别不了是 library 工程

得在settings.gradle 里加上 
include ':library'

Ps: import的不需要这步。手动copy的要


5、

Error:Unable to load class ‘org.codehaus.groovy.runtime.typehandling.ShortTypeHandling’.
Possible causes for this unexpected error include:You are using JDK version ‘java version “1.7.0_71”’. Some versions of JDK 1.7 (e.g. 1.7.0_10) may cause class loading errors in Gradle. 
Please update to a newer version (e.g. 1.7.0_67).

明明用的就是jdk1.7.0_71[比1.7.0_67还新] 却提示不对,问题起始不在jdk这而是 gradle-wrapper.properties

distributionUrl=http://services.gradle.org/distributions/gradle-1.12-all.zip 估计用的是jdk1.7.0.10

把 distributionUrl=http://services.gradle.org/distributions/gradle-1.12-all.zip 
修改为 distributionUrl=https://services.gradle.org/distributions/gradle-2.2.1-all.zip

ok 经过上面两步,从studio导入eclipse项目的正常使用。

参考:http://www.bkjia.com/Androidjc/1003637.html




4、

解决:
参考:http://jingyan.baidu.com/article/da1091fb3fd989027849d63b.html
找到  \Android\Android Studio\bin 目录下idea.properties该文件打开最后一行添加:disable.android.first.run=true

3、打开android studio提示does not point to a valid jvm

解决:我的JAVA_HOME 设置为了C:\Program Files\Java\jdk1.7.0_67\bin 只要去掉bin 设成C:\Program Files\Java\jdk1.7.0_67\就可以了


2、android studio

引用的包用重复:

Duplicate files copied in APK META-INF/LICENSE.txt

解决:

按提示的

build.gradle加入

?
1
2
3
4
5
6
7
8
android 
{
     packagingOptions {
         exclude 
'META-INF/LICENSE.txt'
 
     }
}
我的studio不够要:

packagingOptions{  

exclude'META-INF/DEPENDENCIES'  

exclude'META-INF/NOTICE'  

exclude'META-INF/LICENSE'  

exclude'META-INF/LICENSE.txt'  

exclude'META-INF/NOTICE.txt'  

}


1、jdk找不到红一片

String提示:

incompatible types required java.lang.String found java.lang.String

解决:close project 和重启studio都没用。
最后:
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;"><span class="typ" style="margin: 0px; padding: 0px; border: 0px; color: rgb(43, 145, 175);">File</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);"> </span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);">></span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);"> </span><span class="typ" style="margin: 0px; padding: 0px; border: 0px; color: rgb(43, 145, 175);">Invalidate</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);"> </span><span class="typ" style="margin: 0px; padding: 0px; border: 0px; color: rgb(43, 145, 175);">Caches</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);"> </span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);">&</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);"> </span><span class="typ" style="margin: 0px; padding: 0px; border: 0px; color: rgb(43, 145, 175);">Restart</span></code>
<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;"><span class="typ" style="margin: 0px; padding: 0px; border: 0px; color: rgb(43, 145, 175);">参考:<a target=_blank target="_blank" href="http://stackoverflow.com/questions/26572331/android-studio-incompatible-types-required-java-lang-string-found-java-lang-stri" style="color: rgb(51, 102, 153); text-decoration: none;">http://stackoverflow.com/questions/26572331/android-studio-incompatible-types-required-java-lang-string-found-java-lang-stri</a></span></code>
意思就是studio意外退出然后要清除下缓存

感觉:

<code style="margin: 0px; padding: 0px; border: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif; white-space: inherit;"><span class="typ" style="margin: 0px; padding: 0px; border: 0px; color: rgb(43, 145, 175);">File</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);"> </span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);">></span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);"> </span><span class="typ" style="margin: 0px; padding: 0px; border: 0px; color: rgb(43, 145, 175);">Invalidate</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);"> </span><span class="typ" style="margin: 0px; padding: 0px; border: 0px; color: rgb(43, 145, 175);">Caches</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);"> </span><span class="pun" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);">&</span><span class="pln" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 0, 0);"> </span><span class="typ" style="margin: 0px; padding: 0px; border: 0px; color: rgb(43, 145, 175);">Restart 这个还是比较牛</span></code>

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值