一、git.exe問題
今天用android studio從git下載項目的時候遇到一個問題,提示說Can't run Git: git.exe。下了一個git windows版本後,在studio的設定裡面有一個設定。
設定git.exe的路徑為本地的有效路徑,點擊apply後,搞定。
二、attach source code
android studio貌似有個bug,如果第一次設定的SDK路徑裡不包含source,那麼後期使用SDK Manager下載了source後,還是無法查看。
解決辦法:
1、close all project
具體close方法:File -> Close Project
2、Welcome to Android Studio screen, go to Configure > Project Defaults > Project Structure > SDKs
重新選擇SDK路徑,當然我們可以選擇上次的路徑
3、重新開啟project
說明:在重新設定上次的SDK路徑後,再次開啟項目就有source code了。
如果還不行的話,可以參考下面的方法:
- 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.
或者
Another approach would be to blow away all of Android Studio's auto-created SDKs and let it rebuild them. To do that
- 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.
三、Google Play商店無法上傳應用
提示上傳了可調試 APK檔案。由於使用的是studio開發,一度懷疑是gradle的問題。後來發現是依賴的第三方庫在manifest.xml檔案定義了debugger=true,坑爹!