Android Studio問題彙總

1、git.exe問題

今天用android studio從git下載項目的時候遇到一個問題,提示說Can't run Git: git.exe。下了一個git windows版本後,在studio的設置裏面有一個設置。 java

設置git.exe的路徑爲本地的有效路徑,點擊apply後,搞定。 android

 

2、attach source code

android studio貌似有個bug,若是第一次設置的SDK路徑裏不包含source,那麼後期使用SDK Manager下載了source後,仍是沒法查看。 git

解決辦法: windows

一、close all project

    具體close方法:File -> Close Project android-studio

二、Welcome to Android Studio screen, go to Configure > Project Defaults > Project Structure > SDKs

從新選擇SDK路徑,固然咱們能夠選擇上次的路徑 app

三、從新打開project

說明:在從新設置上次的SDK路徑後,再次打開項目就有source code了。 ide

若是還不行的話,能夠參考下面的方法: gradle

  • Close all open projects
  • From the Welcome to Android Studio screen, go to Configure > Project Defaults > Project Structure > SDKs
  • Choose the appropriate Android API SDK that you installed source for, and go to Sourcepathpanel
  • Press the + button, and choose the source directory.

或者 ui

Another approach would be to blow away all of Android Studio's auto-created SDKs and let it rebuild them. To do that google

  • Exit Android Studio
  • Delete the jdk.table.xml file, which on MacOS will be in your home directory underLibrary/Preferences/AndroidStudioPreview
  • Relaunch Android Studio
  • Go into Project Structure (either from the Welcome screen or from a project), and choose theAndroid SDK tab
  • Make sure the Android SDK location and JDK location are correct.

 

3、Google Play商店沒法上傳應用

提示上傳了可調試 APK文件。因爲使用的是studio開發,一度懷疑是gradle的問題。後來發現是依賴的第三方庫在manifest.xml文件定義了debugger=true,坑爹!

 

4、導入其餘樣式設置文件

File - Import Settings

 

5、檢查更新失敗

升級時提示 Connection failed. Please check your network connection and try again

修改安裝目錄下bin\studio.exe.vmoptions文件,如E:\Android\android-studio\bin\studio.exe.vmoptions

若是是64位系統,那就應該修改bin\studio64.exe.vmoptions文件

-Djava.net.preferIPv4Stack=true
-Didea.updates.url=http://dl.google.com/android/studio/patches/updates.xml
-Didea.patches.url=http://dl.google.com/android/studio/patches/

 

6、debug模式沒法運行

編譯提示:

android studio execution failed for task dexdebug...

輸入行太長...

等等語句

解決:

懷疑是依賴的項目有問題,仔細檢查發現依賴的一個項目library-a裏面有

dependencies {
    compile 'com.android.support:support-v4:13.0.0'
    compile 'com.android.support:gridlayout-v7:21.0.3'
}



 

實際上這個庫裏面又沒有用到gridlayout,也就是說第二個depend是無效的,刪掉

 
相關文章
相關標籤/搜索