intellij IDEA - 创建Android应用程序失败
当我尝试在 intellij idea 中创建 android 应用程序时,我得到以下
The project wasn't generated by 'android' tool
: can't find sdkmanager.jar
/Users/timon/development/android-sdk-mac_x86/tools/android: line 30: dirname: command not found
/Users/timon/development/android-sdk-mac_x86/tools/android: line 33: basename: command not found
/Users/timon/development/android-sdk-mac_x86/tools/android: line 40: dirname: command not found
/Users/timon/development/android-sdk-mac_x86/tools/android: line 44: dirname: command not found
/Users/timon/development/android-sdk-mac_x86/tools/android: line 48: basename: command not found
显示窗口:
我尝试设置PATH 变量定位 android SDK 但它没有帮助。 Android SDK 已正确安装,我可以在 Eclipse 中创建并运行 Android 项目。我做错了什么?这似乎是一个很常见的错误。请帮忙!
When I'm trying to create android application in intellij idea I get the following
The project wasn't generated by 'android' tool
: can't find sdkmanager.jar
/Users/timon/development/android-sdk-mac_x86/tools/android: line 30: dirname: command not found
/Users/timon/development/android-sdk-mac_x86/tools/android: line 33: basename: command not found
/Users/timon/development/android-sdk-mac_x86/tools/android: line 40: dirname: command not found
/Users/timon/development/android-sdk-mac_x86/tools/android: line 44: dirname: command not found
/Users/timon/development/android-sdk-mac_x86/tools/android: line 48: basename: command not found
showing the window:
I tried to set up PATH variables locating android SDK but it doesn't help. Android SDK is installed correctly and I can create and run android projects in Eclipse. What am I doing wrong? It seems like very common error. Please help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这看起来像是路径问题。我不知道到底发生了什么,但您可能想尝试从命令行而不是通过 Finder 打开应用程序。这样它将继承您的 PATH - 当您从 Finder 启动时则不会。一般来说,即使我没有遇到问题,我也会确保从命令行运行 Intellij。
This looks like a path problem. I don't know exactly what's going on but you might want to try opening the app from the command line rather than through Finder. This way it will inherit your PATH - it doesn't when you launch from Finder. In general, even when I don't have problems, I make sure to run Intellij from the command line.
我在 Mac 上使用 IntelliJ Idea 11 时遇到了同样的问题。
添加导出
PATH=/Users/myhomedir/Downloads/android-sdk-macosx:$PATH
并从命令行终端启动 idea 有所帮助。I had the same problem with IntelliJ Idea 11 on mac.
Adding export
PATH=/Users/myhomedir/Downloads/android-sdk-macosx:$PATH
and starting idea from command line terminal helped.