Android的工作室0.8.2 - 摇篮工程同步失败摇篮、工作室、工程、Android

2023-09-07 14:20:39 作者:你占据了我整整一个曾经

在事后我不应该启用大号建立的东西。

In hindsight I should not have enabled L build stuff.

我是新来的编程和我创建了被扔摇篮errror马上一个新的Andr​​oid Studio项目。

I am new to programming and I created a new Android Studio project which is throwing the Gradle errror right away.

错误是:

在顶部的黄色栏 - 摇篮工程同步失败。基本功能(例如编辑,调试)将无法正常工作。再次尝试打开事件日志显示日志在Finder中

yellow bar at the top - Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly. Try again Open Event Log Show Log in Finder

信息同步的gradle - compileSdkVersion的android-L需要与JDK-7编译。开放式的SDK设置,打开的文件。

messages gradle sync - compileSdkVersion android-L requires compiling with JDK-7. open sdk settings, open file.

试图寻找通过谷歌和其他堆栈溢出的意见,但并没有找到太多我可以做的意义,除了的 Android的工作室 - 摇篮同步项目不合格

tried looking through google and other stack overflow comments but did not find much I could make sense of except for Android Studio - Gradle sync project failed

尝试转换URL到1.10,而不是1.12和同步,但同步后失败

tried converting URL to 1.10 instead of 1.12 and syncing but that failed after syncing

我需要帮助,或者让l工作或删除它,这样一个新的工作室项目被编译到设备没有错误。

I need help either getting L working or removing it so that a new studio project can compile to device without errors.

推荐答案

我也面临着同样的问题和麻烦天后我想通了。只是检查是否安装了Java

I too faced the same issue and after days of trouble I figured it out. Just check if Java is installed

打开一个终端窗口,输入:

Java的版本的

java -version

以上JDK 6的任何版本是确定

Any version above JDK 6 is OK

在终端中输入

打开文本编辑-a〜/ .bash_profile中的

open -a TextEdit ~/.bash_profile

复制及以下行粘贴到文本编辑

的出口JAVA_HOME = $(在/ usr / libexec中/ JAVA_HOME)的

的出口JDK_HOME = $(在/ usr / libexec中/ JAVA_HOME)的

保存,关闭编辑器,键入以下命令来更改应用

源在〜/ .bash_profile 的

source ~/.bash_profile

现在现在的gradle尝试同步,你必须能够完成同步

Now try gradle sync now, you must be able to complete sync

 
精彩推荐