问题:
Packages to install:
- Android SDK Platform 29 (platforms;android-29)
- Android Emulator (emulator)
- Android SDK Platform-Tools (platform-tools)
Preparing "Install Android SDK Platform 29 (revision: 5)".
Failed to read or create install properties file.
Preparing "Install Android Emulator (revision: 30.1.5)".
Failed to read or create install properties file.
Preparing "Install Android SDK Platform-Tools (revision: 30.0.5)".
Failed to read or create install properties file.
Failed packages:
- Android SDK Platform 29 (platforms;android-29)
- Android Emulator (emulator)
- Android SDK Platform-Tools (platform-tools)
有什么想法要解决吗?
背景:
检查网络: Clash已连接,我可以通过Mac上的Chrome浏览器访问google.com
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7890
我读了一个问题: Android Studio fails to install update (error : Failed to read or create install properties file.)
在Mac上,Android Studio似乎已经具有管理员权限。
Android Studio权限
ls -la /Applications/Android\ Studio\ 4.1.0.app/Contents/MacOS
total 128
drwxrwxr-x@ 3 gongzelong admin 96 Sep 24 04:21 .
drwxrwxr-x@ 12 gongzelong admin 384 Sep 24 04:40 ..
-rwxr-xr-x@ 1 gongzelong admin 65312 Sep 24 04:21 studio
sdkmanager权限:
ls -la $ANDROID_HOME/tools/bin
total 128
drwxr-xr-x 11 gongzelong staff 352 Jul 29 2018 .
drwxr-xr-x 15 gongzelong staff 480 Oct 26 21:18 ..
-rwxr-xr-x 1 gongzelong staff 6742 Jul 29 2018 apkanalyzer
-rwxr-xr-x 1 gongzelong staff 5253 Jul 29 2018 archquery
-rwxr-xr-x 1 gongzelong staff 6040 Jul 29 2018 avdmanager
-rwxr-xr-x 1 gongzelong staff 5250 Jul 29 2018 jobb
-rwxr-xr-x 1 gongzelong staff 6834 Jul 29 2018 lint
-rwxr-xr-x 1 gongzelong staff 3323 Jul 29 2018 monkeyrunner
-rwxr-xr-x 1 gongzelong staff 5613 Jul 29 2018 screenshot2
-rwxr-xr-x@ 1 gongzelong staff 6047 Jul 29 2018 sdkmanager
-rwxr-xr-x 1 gongzelong staff 3076 Jul 29 2018 uiautomatorviewer
android sdk目录权限:
ls -la $ANDROID_HOME/
total 56
drwxr-xr-x@ 26 gongzelong staff 832 Nov 3 01:51 .
drwx------@ 104 gongzelong staff 3328 Nov 6 17:55 ..
-rw-r--r--@ 1 gongzelong staff 18436 Oct 26 21:17 .DS_Store
drwxr-xr-x 2 gongzelong staff 64 Nov 4 01:47 .downloadIntermediates
-rw-r--r-- 1 gongzelong staff 16 Nov 6 17:46 .knownPackages
drwxr-xr-x 41 gongzelong staff 1312 Nov 4 23:08 .temp
-rw-r--r--@ 1 gongzelong staff 1158 Aug 30 2018 SDK Readme.txt
drwxr-xr-x@ 2 gongzelong staff 64 Aug 29 2016 add-ons
drwxr-xr-x@ 34 gongzelong staff 1088 Nov 3 01:47 build-tools
drwxr-xr-x@ 6 gongzelong staff 192 Apr 24 2019 cmake
drwxr-xr-x@ 51 gongzelong staff 1632 Oct 24 2016 docs
drwxr-xr-x 17 root wheel 544 Nov 12 2019 emulator
drwxr-xr-x@ 8 gongzelong staff 256 Jul 31 2018 extras
drwxr-xr-x@ 3 gongzelong staff 96 Nov 7 2017 fonts
drwxr-xr-x@ 9 gongzelong staff 288 Apr 21 2020 licenses
drwxr-xr-x@ 6 gongzelong staff 192 Apr 24 2019 lldb
drwxr-xr-x 7 gongzelong staff 224 Nov 4 22:47 ndk
drwxr-xr-x@ 20 gongzelong staff 640 Sep 29 2018 ndk-bundle
drwxr-xr-x@ 5 gongzelong staff 160 Dec 15 2016 patcher
drwxr-xr-x 19 root wheel 608 Nov 12 2019 platform-tools
drwxr-xr-x@ 16 gongzelong staff 512 Nov 3 01:47 platforms
drwxr-xr-x@ 33 gongzelong staff 1056 Feb 17 2020 skins
drwxr-xr-x@ 14 gongzelong staff 448 Nov 3 01:51 sources
drwxr-xr-x@ 13 gongzelong staff 416 Apr 8 2019 system-images
drwxr-xr-x@ 2 gongzelong staff 64 Feb 4 2018 temp
drwxr-xr-x 15 gongzelong staff 480 Oct 26 21:18 tools
平台许可:
➜ bin ls -la $ANDROID_HOME/platforms
total 24
drwxr-xr-x@ 16 gongzelong staff 512 Nov 3 01:47 .
drwxr-xr-x@ 26 gongzelong staff 832 Nov 3 01:51 ..
-rw-r--r--@ 1 gongzelong staff 10244 Dec 3 2018 .DS_Store
drwxr-xr-x@ 13 gongzelong staff 416 Dec 3 2018 android-16
drwxr-xr-x@ 12 gongzelong staff 384 Dec 16 2016 android-19
drwxr-xr-x@ 12 gongzelong staff 384 Dec 18 2016 android-21
drwxr-xr-x@ 12 gongzelong staff 384 Dec 8 2016 android-22
drwxr-xr-x@ 14 gongzelong staff 448 Oct 19 2016 android-23
drwxr-xr-x@ 15 gongzelong staff 480 Oct 19 2016 android-24
drwxr-xr-x@ 14 gongzelong staff 448 Dec 16 2016 android-25
drwxr-xr-x@ 14 gongzelong staff 448 Sep 28 2017 android-26
drwxr-xr-x 14 gongzelong staff 448 Jul 30 2018 android-27
drwxr-xr-x 14 gongzelong staff 448 Mar 29 2019 android-28
drwxr-xr-x 14 root staff 448 Nov 12 2019 android-29
drwxr-xr-x 15 gongzelong staff 480 Nov 3 01:47 android-30
drwxr-xr-x 14 gongzelong staff 448 Apr 24 2019 android-Q
$ ANDROID_HOME / platform-tools
➜ bin ls -la $ANDROID_HOME/platform-tools
total 22584
drwxr-xr-x 19 root wheel 608 Nov 12 2019 .
drwxr-xr-x@ 26 gongzelong staff 832 Nov 3 01:51 ..
-rw-r--r-- 1 root wheel 274638 Nov 12 2019 NOTICE.txt
-rwxr-xr-x 1 root wheel 3552684 Nov 12 2019 adb
drwxr-xr-x 4 root wheel 128 Nov 12 2019 api
-rwxr-xr-x 1 root wheel 60544 Nov 12 2019 dmtracedump
-rwxr-xr-x 1 root wheel 1581128 Nov 12 2019 e2fsdroid
-rwxr-xr-x 1 root wheel 309988 Nov 12 2019 etc1tool
-rwxr-xr-x 1 root wheel 1785900 Nov 12 2019 fastboot
-rwxr-xr-x 1 root wheel 17480 Nov 12 2019 hprof-conv
drwxr-xr-x 3 root wheel 96 Nov 12 2019 lib64
-rwxr-xr-x 1 root wheel 242532 Nov 12 2019 make_f2fs
-rwxr-xr-x 1 root wheel 829668 Nov 12 2019 mke2fs
-rwxr-xr-x 1 root wheel 1170 Nov 12 2019 mke2fs.conf
-rw-r--r-- 1 root wheel 17783 Nov 12 2019 package.xml
-rwxr-xr-x 1 root wheel 1532436 Nov 12 2019 sload_f2fs
-rw-r--r-- 1 root wheel 38 Nov 12 2019 source.properties
-rwxr-xr-x 1 root wheel 1315132 Nov 12 2019 sqlite3
drwxr-xr-x 6 root wheel 192 Nov 12 2019 systrace
我在Dock中打开Android Studio图标,这是否意味着我以管理员身份运行AS?
我可以下载ndk,这是我当前的sdk:
答案 0 :(得分:0)
解决方案1:
使用:sudo chown $USER: $ANDROID_HOME -R
我的解决方案是设置文件夹权限(以及使用-R的子文件夹)。
根本原因:
我的Android SDK目录的权限设置为仅由root用户写入,因此android-studio无法写入任何更改。
详细过程:
以$ ANDROID_HOME / platform-tools为例:
sudo chown $USER: $ANDROID_HOME/platform-tools
在执行命令行之前:
bin ls -la $ANDROID_HOME/
total 56
drwxr-xr-x@ 26 gongzelong staff 832 Nov 3 01:51 .
drwx------@ 104 gongzelong staff 3328 Nov 6 17:55 ..
-rw-r--r--@ 1 gongzelong staff 18436 Oct 26 21:17 .DS_Store
drwxr-xr-x 2 gongzelong staff 64 Nov 4 01:47 .downloadIntermediates
-rw-r--r-- 1 gongzelong staff 16 Nov 6 17:46 .knownPackages
drwxr-xr-x 41 gongzelong staff 1312 Nov 4 23:08 .temp
-rw-r--r--@ 1 gongzelong staff 1158 Aug 30 2018 SDK Readme.txt
drwxr-xr-x@ 2 gongzelong staff 64 Aug 29 2016 add-ons
drwxr-xr-x@ 34 gongzelong staff 1088 Nov 3 01:47 build-tools
drwxr-xr-x@ 6 gongzelong staff 192 Apr 24 2019 cmake
drwxr-xr-x@ 51 gongzelong staff 1632 Oct 24 2016 docs
drwxr-xr-x 17 root wheel 544 Nov 12 2019 emulator
drwxr-xr-x@ 8 gongzelong staff 256 Jul 31 2018 extras
drwxr-xr-x@ 3 gongzelong staff 96 Nov 7 2017 fonts
drwxr-xr-x@ 9 gongzelong staff 288 Apr 21 2020 licenses
drwxr-xr-x@ 6 gongzelong staff 192 Apr 24 2019 lldb
drwxr-xr-x 7 gongzelong staff 224 Nov 4 22:47 ndk
drwxr-xr-x@ 20 gongzelong staff 640 Sep 29 2018 ndk-bundle
drwxr-xr-x@ 5 gongzelong staff 160 Dec 15 2016 patcher
**drwxr-xr-x 19 root wheel 608 Nov 12 2019 platform-tools**
drwxr-xr-x@ 16 gongzelong staff 512 Nov 3 01:47 platforms
drwxr-xr-x@ 33 gongzelong staff 1056 Feb 17 2020 skins
drwxr-xr-x@ 14 gongzelong staff 448 Nov 3 01:51 sources
drwxr-xr-x@ 13 gongzelong staff 416 Apr 8 2019 system-images
drwxr-xr-x@ 2 gongzelong staff 64 Feb 4 2018 temp
drwxr-xr-x 15 gongzelong staff 480 Oct 26 21:18 tools
执行命令行后:
➜ bin ls -la $ANDROID_HOME/
total 56
drwxr-xr-x@ 26 gongzelong staff 832 Nov 3 01:51 .
drwx------@ 104 gongzelong staff 3328 Nov 6 17:55 ..
-rw-r--r--@ 1 gongzelong staff 18436 Oct 26 21:17 .DS_Store
drwxr-xr-x 2 gongzelong staff 64 Nov 4 01:47 .downloadIntermediates
-rw-r--r-- 1 gongzelong staff 16 Nov 6 17:46 .knownPackages
drwxr-xr-x 41 gongzelong staff 1312 Nov 4 23:08 .temp
-rw-r--r--@ 1 gongzelong staff 1158 Aug 30 2018 SDK Readme.txt
drwxr-xr-x@ 2 gongzelong staff 64 Aug 29 2016 add-ons
drwxr-xr-x@ 34 gongzelong staff 1088 Nov 3 01:47 build-tools
drwxr-xr-x@ 6 gongzelong staff 192 Apr 24 2019 cmake
drwxr-xr-x@ 51 gongzelong staff 1632 Oct 24 2016 docs
drwxr-xr-x 17 root wheel 544 Nov 12 2019 emulator
drwxr-xr-x@ 8 gongzelong staff 256 Jul 31 2018 extras
drwxr-xr-x@ 3 gongzelong staff 96 Nov 7 2017 fonts
drwxr-xr-x@ 9 gongzelong staff 288 Apr 21 2020 licenses
drwxr-xr-x@ 6 gongzelong staff 192 Apr 24 2019 lldb
drwxr-xr-x 7 gongzelong staff 224 Nov 4 22:47 ndk
drwxr-xr-x@ 20 gongzelong staff 640 Sep 29 2018 ndk-bundle
drwxr-xr-x@ 5 gongzelong staff 160 Dec 15 2016 patcher
**drwxr-xr-x 19 gongzelong wheel 608 Nov 12 2019 platform-tools**
drwxr-xr-x@ 16 gongzelong staff 512 Nov 3 01:47 platforms
drwxr-xr-x@ 33 gongzelong staff 1056 Feb 17 2020 skins
drwxr-xr-x@ 14 gongzelong staff 448 Nov 3 01:51 sources
drwxr-xr-x@ 13 gongzelong staff 416 Apr 8 2019 system-images
drwxr-xr-x@ 2 gongzelong staff 64 Feb 4 2018 temp
drwxr-xr-x 15 gongzelong staff 480 Oct 26 21:18 tools
安装sdk结果屏幕截图前后
解决方案2:
以管理身份运行Android Studio。
sudo /Applications/Android\ Studio\ 4.1.0.app/Contents/MacOS/studio
它也可以成功安装android sdk更新