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. 或者提示網路連線異常。 有效。確實是因為只設了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圖至少要做左邊和上邊, 如果這兩個邊有一個沒做就會報錯。詳細描述可以參見:
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 解決:我的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'
}
}
|
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提示:
解決: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>