简体   繁体   English

Ionic App Android SDK问题-无法创建目录/usr/local/Cellar/android-sdk/23.0.2/temp

[英]Ionic App Android SDK Issue - Failed to create directory /usr/local/Cellar/android-sdk/23.0.2/temp

I'm trying to build an Android app through Terminal. 我正在尝试通过终端构建一个Android应用程序。 I'm not massively familiar with Terminal commands, however I've managed to build the iOS version successfully. 我对终端命令不是很熟悉,但是我已经成功构建了iOS版本。 When I try to compile for Android, I'm getting the following error: 当我尝试为Android编译时,出现以下错误:

Error: Please install Android target: "android-23".

Hint: Open the SDK manager by running: /usr/local/Cellar/android-sdk/23.0.2/bin/android
You will require:
1. "SDK Platform" for android-23
2. "Android SDK Platform-tools (latest)
3. "Android SDK Build-tools" (latest)

If I open SDK Manager and try to install Android 6.0 (API 23), nothing installs - 如果我打开SDK Manager并尝试安装Android 6.0(API 23),则不会安装任何东西-

Done loading packages.
Preparing to install archives
Downloading Documentation for Android SDK, API 23, revision 1
Failed to create directory /usr/local/Cellar/android-sdk/23.0.2/temp
Downloading SDK Platform Android 6.0, API 23, revision 1
Failed to create directory /usr/local/Cellar/android-sdk/23.0.2/temp
Downloading Samples for SDK API 23, revision 2
Failed to create directory /usr/local/Cellar/android-sdk/23.0.2/temp
Downloading Sources for Android SDK, API 23, revision 1
Failed to create directory /usr/local/Cellar/android-sdk/23.0.2/temp
Skipping 'Android TV ARM EABI v7a System Image, Android API 23, revision 3'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Android TV Intel x86 Atom System Image, Android API 23, revision 4'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Android Wear ARM EABI v7a System Image, Android API 23, revision 5'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Android Wear Intel x86 Atom System Image, Android API 23, revision 5'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'ARM EABI v7a System Image, Android API 23, revision 3'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Intel x86 Atom_64 System Image, Android API 23, revision 9'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Intel x86 Atom System Image, Android API 23, revision 9'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Google APIs ARM EABI v7a System Image, Android API 23, revision 14'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Google APIs Intel x86 Atom_64 System Image, Android API 23, revision 14'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Google APIs Intel x86 Atom System Image, Android API 23, revision 14'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Google APIs, Android API 23, revision 1'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Done. Nothing was installed.
Preparing to install archives
Downloading Documentation for Android SDK, API 23, revision 1
Failed to create directory /usr/local/Cellar/android-sdk/23.0.2/temp
Downloading SDK Platform Android 6.0, API 23, revision 1
Failed to create directory /usr/local/Cellar/android-sdk/23.0.2/temp
Downloading Samples for SDK API 23, revision 2
Failed to create directory /usr/local/Cellar/android-sdk/23.0.2/temp
Downloading Sources for Android SDK, API 23, revision 1
Failed to create directory /usr/local/Cellar/android-sdk/23.0.2/temp
Skipping 'Android TV ARM EABI v7a System Image, Android API 23, revision 3'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Android TV Intel x86 Atom System Image, Android API 23, revision 4'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Android Wear ARM EABI v7a System Image, Android API 23, revision 5'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Android Wear Intel x86 Atom System Image, Android API 23, revision 5'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'ARM EABI v7a System Image, Android API 23, revision 3'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Intel x86 Atom_64 System Image, Android API 23, revision 9'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Intel x86 Atom System Image, Android API 23, revision 9'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Google APIs ARM EABI v7a System Image, Android API 23, revision 14'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Google APIs Intel x86 Atom_64 System Image, Android API 23, revision 14'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Google APIs Intel x86 Atom System Image, Android API 23, revision 14'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Google APIs, Android API 23, revision 1'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Done. Nothing was installed.
Preparing to install archives
Downloading Documentation for Android SDK, API 23, revision 1
Failed to create directory /usr/local/Cellar/android-sdk/23.0.2/temp
Downloading SDK Platform Android 6.0, API 23, revision 1
Failed to create directory /usr/local/Cellar/android-sdk/23.0.2/temp
Downloading Samples for SDK API 23, revision 2
Failed to create directory /usr/local/Cellar/android-sdk/23.0.2/temp
Downloading Sources for Android SDK, API 23, revision 1
Failed to create directory /usr/local/Cellar/android-sdk/23.0.2/temp
Skipping 'Android TV ARM EABI v7a System Image, Android API 23, revision 3'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Android TV Intel x86 Atom System Image, Android API 23, revision 4'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Android Wear ARM EABI v7a System Image, Android API 23, revision 5'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Android Wear Intel x86 Atom System Image, Android API 23, revision 5'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'ARM EABI v7a System Image, Android API 23, revision 3'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Intel x86 Atom_64 System Image, Android API 23, revision 9'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Intel x86 Atom System Image, Android API 23, revision 9'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Google APIs ARM EABI v7a System Image, Android API 23, revision 14'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Google APIs Intel x86 Atom_64 System Image, Android API 23, revision 14'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Google APIs Intel x86 Atom System Image, Android API 23, revision 14'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Skipping 'Google APIs, Android API 23, revision 1'; it depends on 'SDK Platform Android 6.0, API 23, revision 1' which was not installed.
Done. Nothing was installed.

I read a comment on another post ( Could not resolve all dependencies for configuration ':_armv7DebugCompile' ) where someone suggested posting the following (I'm guessing to check permissions), to help debug the problem: 我在另一篇文章( 无法解析配置':_armv7DebugCompile'的所有依赖项)上读到评论,其中有人建议发布以下内容(我想检查权限),以帮助调试问题:

Johns-iMac:Pastest johngoodwin$ sudo ls -ld /usr/local/Cellar
drwxr-xr-x  10 johngoodwin  admin  340 21 Nov  2014 /usr/local/Cellar
Johns-iMac:Pastest johngoodwin$ sudo ls -l /usr/local/Cellar/
total 0
drwxr-xr-x  3 johngoodwin  admin  102 21 Nov  2014 android-sdk
drwxr-xr-x  3 johngoodwin  admin  102 21 Nov  2014 autoconf
drwxr-xr-x  3 johngoodwin  admin  102 21 Nov  2014 ios-sim
drwxr-xr-x  3 johngoodwin  admin  102 21 Nov  2014 node
drwxr-xr-x  3 johngoodwin  admin  102 21 Nov  2014 openssl
drwxr-xr-x  3 johngoodwin  admin  102 21 Nov  2014 pkg-config
drwxr-xr-x  3 johngoodwin  admin  102 21 Nov  2014 rbenv
drwxr-xr-x  3 johngoodwin  admin  102 21 Nov  2014 ruby-build
Johns-iMac:Pastest johngoodwin$ sudo ls -l /usr/local/Cellar/android-sdk/
total 0
drwxr-xr-x  17 johngoodwin  admin  578 21 Nov  2014 23.0.2
Johns-iMac:Pastest johngoodwin$ sudo ls -l /usr/local/Cellar/android-sdk/23.0.2 
total 72
-rw-r--r--   1 johngoodwin  admin   187 23 Sep  2014 INSTALL_RECEIPT.json
-rw-rw-r--   1 johngoodwin  wheel  1158  2 Jul  2014 README
lrwxr-xr-x   1 johngoodwin  admin    36 23 Sep  2014 add-ons -> ../../../var/lib/android-sdk/add-ons
drwxr-xr-x  25 johngoodwin  admin   850 21 Nov  2014 bin
drwxr-xr-x   3 johngoodwin  admin   102 21 Nov  2014 build-tools
drwxr-xr-x  43 johngoodwin  admin  1462 21 Nov  2014 docs
drwxr-xr-x   3 johngoodwin  admin   102 21 Nov  2014 etc
lrwxr-xr-x   1 johngoodwin  admin    35 23 Sep  2014 extras -> ../../../var/lib/android-sdk/extras
drwxr-xr-x  12 johngoodwin  admin   408 21 Nov  2014 platform-tools
lrwxr-xr-x   1 johngoodwin  admin    38 23 Sep  2014 platforms -> ../../../var/lib/android-sdk/platforms
lrwxr-xr-x   1 johngoodwin  admin    36 23 Sep  2014 samples -> ../../../var/lib/android-sdk/samples
lrwxr-xr-x   1 johngoodwin  admin    36 23 Sep  2014 sources -> ../../../var/lib/android-sdk/sources
lrwxr-xr-x   1 johngoodwin  admin    42 23 Sep  2014 system-images -> ../../../var/lib/android-sdk/system-images
lrwxr-xr-x   1 johngoodwin  admin    33 23 Sep  2014 temp -> ../../../var/lib/android-sdk/temp
drwxr-xr-x  29 johngoodwin  wheel   986 21 Nov  2014 tools

Can anyone provide a solution to the problem please? 任何人都可以提供解决问题的方法吗? I'm tearing my hair out! 我正在撕头发!

Many thanks, 非常感谢,

John. 约翰。

Download Android SDK Tools from http://developer.android.com/sdk/installing/index.html?pkg=tools http://developer.android.com/sdk/installing/index.html?pkg=tools下载Android SDK工具

Extract in /home/{{user}}/build/ 解压缩到/ home / {{user}} / build /

Insert below code at ~/.profile (caution: do not remove anything from there, just append this code) 在〜/ .profile中插入以下代码(警告:请勿从此处删除任何内容,只需添加此代码)

 //set PATH so it includes android SDK toold
 if [ -d "$HOME/build" ] ; then
 ANDROID_HOME=$HOME/build/android-sdk
 PATH="ANDROID_HOME/tools:$PATH"
 fi

Please let me know if this suggestion solved your problem. 如果这个建议解决了您的问题,请告诉我。

尝试从/usr/local/Cellar/android-sdk/23.0.2/文件夹中删除现有的temp @符号链接

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Appium正在获取“错误:ENOENT:没有这样的文件或目录,scandir'/ usr / local / share / android-sdk / build-tools' - Appium Getting "Error: ENOENT: no such file or directory, scandir '/usr/local/share/android-sdk/build-tools' Android Travis CI错误:在/ usr / local / android-sdk中找不到带有哈希字符串'android-23'的目标 - Android Travis CI Error: failed to find target with hash string 'android-23' in: /usr/local/android-sdk Flutter:在 /usr/lib/android-sdk/platforms 中找不到有效的 Android SDK 平台。 目录为空 - Flutter : No valid Android SDK platforms found in /usr/lib/android-sdk/platforms. Directory was empty 将android-sdk目录移动到/ home分区? - Move android-sdk directory to /home partition? Facebook Android-SDK发布消息问题 - Facebook Android-SDK Posting Message Issue React-Native 尝试运行 android,出现关于 /bin/sh 的错误:/usr/local/share/android-sdk/platform-tools/adb: No such file or directory - React-Native trying to run android, getting an error about /bin/sh: /usr/local/share/android-sdk/platform-tools/adb: No such file or directory 安装Android-SDK数据包 - Installation Android-SDK packets 返回按钮android-sdk? - Back button android-sdk? 安装失败; 程序访问目录 android-sdk\platform-tools - Failed to Install; Program accessing directory android-sdk\platform-tools 原始错误:在 ["/usr/local/share/android-sdk/platform-tools/aapt"] Appium - Eclipse 中找不到“aapt” - Original error: Could not find 'aapt' in ["/usr/local/share/android-sdk/platform-tools/aapt"] Appium - Eclipse
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM