Android Studio 在控制台中找不到 cocoapods
Android Studio does not find cocoapods in console
不知何故 Android Studio 找不到 cocoapods,即使它已通过 brew install coocapods
正确安装在系统中。 Android Studio 控制台似乎没有获得正确的路径。
注意:使用
通过终端/iTerm 启动 Android Studio
open /Applications/Android\ Studio.app
确实缓解了这个问题,Android Studio 然后以某种方式找到了正确的路径。但我想知道我如何才能直接从应用程序目录/spotlight-search 获得相同的结果?为什么 Android Studio 无法解析正确的路径?
Android Studio 版本 2021.1.1,macOS
点击“Flutter doctor”后的控制台输出:
/Users/[...]/flutter/bin/flutter doctor --verbose
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-x64, locale de-DE)
• Flutter version 2.8.1 at /Users/[...]/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (6 weeks ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/[...]/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
• All Android licenses accepted.
[!] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
...
在 Android Studio 中启动终端或启动 iTerm,输出:
flutter doctor -v
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-x64, locale de-DE)
• Flutter version 2.8.1 at /Users/[...]/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (6 weeks ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/[...]/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2
...
@scrimau 写了这个问题的最佳描述。
这里有一些进一步的信息:
echo $PATH
(使用 Android Studio 的终端)产生不同的结果,具体取决于使用两种方法中的哪一种来启动 Android Studio。
相同的目录出现在两个 echo $PATH
结果中,但目录被打乱了顺序。
似乎目录的顺序(如 echo $PATH
所示)可能与不同的行为有关。
(抱歉:这应该是评论。我找不到更改评论答案的方法。下次我会更加小心。)
我刚刚为 Mac Intel 安装了最新的 ANDROID STUDIO Bumblebee 2021.1.1.1.21 补丁 1。我将一个较旧的 FLUTTER 应用程序加载到其中 运行,(来自 IDE 中的 运行 箭头),它针对 iPhone 8 模拟器设备。 CocoaPods 错误没有出现,应用程序在模拟器设备中启动。在我看来,此更新已修复该错误。
已在 Android Studio Bumblebee 2021.1.1.1.21 补丁 1 中修复 Mac。
Android Studio Bumblebee 2021.1.1.1.21 补丁 1 似乎已修复此问题。 release notes中提到了类似的问题:
Issue #216364005: Env variables not sourced when launched from Mac OS X to Monterey Dock
不知何故 Android Studio 找不到 cocoapods,即使它已通过 brew install coocapods
正确安装在系统中。 Android Studio 控制台似乎没有获得正确的路径。
注意:使用
通过终端/iTerm 启动 Android Studioopen /Applications/Android\ Studio.app
确实缓解了这个问题,Android Studio 然后以某种方式找到了正确的路径。但我想知道我如何才能直接从应用程序目录/spotlight-search 获得相同的结果?为什么 Android Studio 无法解析正确的路径?
Android Studio 版本 2021.1.1,macOS
点击“Flutter doctor”后的控制台输出:
/Users/[...]/flutter/bin/flutter doctor --verbose
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-x64, locale de-DE)
• Flutter version 2.8.1 at /Users/[...]/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (6 weeks ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/[...]/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
• All Android licenses accepted.
[!] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
...
在 Android Studio 中启动终端或启动 iTerm,输出:
flutter doctor -v
[✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-x64, locale de-DE)
• Flutter version 2.8.1 at /Users/[...]/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 77d935af4d (6 weeks ago), 2021-12-16 08:37:33 -0800
• Engine revision 890a5fca2e
• Dart version 2.15.1
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/[...]/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2
...
@scrimau 写了这个问题的最佳描述。
这里有一些进一步的信息:
echo $PATH
(使用 Android Studio 的终端)产生不同的结果,具体取决于使用两种方法中的哪一种来启动 Android Studio。
相同的目录出现在两个 echo $PATH
结果中,但目录被打乱了顺序。
似乎目录的顺序(如 echo $PATH
所示)可能与不同的行为有关。
(抱歉:这应该是评论。我找不到更改评论答案的方法。下次我会更加小心。)
我刚刚为 Mac Intel 安装了最新的 ANDROID STUDIO Bumblebee 2021.1.1.1.21 补丁 1。我将一个较旧的 FLUTTER 应用程序加载到其中 运行,(来自 IDE 中的 运行 箭头),它针对 iPhone 8 模拟器设备。 CocoaPods 错误没有出现,应用程序在模拟器设备中启动。在我看来,此更新已修复该错误。
已在 Android Studio Bumblebee 2021.1.1.1.21 补丁 1 中修复 Mac。
Android Studio Bumblebee 2021.1.1.1.21 补丁 1 似乎已修复此问题。 release notes中提到了类似的问题:
Issue #216364005: Env variables not sourced when launched from Mac OS X to Monterey Dock