gpt4 book ai didi

Android:Gradle generateDebugSources 问题

转载 作者:行者123 更新时间:2023-12-03 04:29:06 26 4
gpt4 key购买 nike

我正在运行 Android Studio 2.2 Ubuntu 15.04 .每当“ generateDebugSources ”运行时,它都会提示机器不包含 Mac Android SDK 库。
这是我得到的错误

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
The SDK directory '/Applications/adt-bundle-mac-x86_64-20140321/sdk' does not exist.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

这是对应的堆栈跟踪
Caused by: java.lang.RuntimeException: The SDK directory '/Applications/adt-bundle-mac-x86_64-20140321/sdk' does not exist.
at com.android.build.gradle.internal.SdkHandler.getSdkLoader(SdkHandler.java:119)
at com.android.build.gradle.internal.SdkHandler.initTarget(SdkHandler.java:86)
at com.android.build.gradle.BasePlugin.ensureTargetSetup(BasePlugin.java:673)
at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:610)
at com.android.build.gradle.BasePlugin$10$1.call(BasePlugin.java:566)
at com.android.build.gradle.BasePlugin$10$1.call(BasePlugin.java:563)
at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:55)
at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:47)
at com.android.build.gradle.BasePlugin$10.execute(BasePlugin.java:562)
at com.android.build.gradle.BasePlugin$10.execute(BasePlugin.java:559)
at org.gradle.listener.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:109)
at org.gradle.listener.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:98)
at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:83)
at org.gradle.listener.BroadcastDispatch.dispatch(BroadcastDispatch.java:31)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy14.afterEvaluate(Unknown Source)
at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:79)

ANDROID_HOME JAVA_HOME env 变量按预期设置。
$ echo $ANDROID_HOME
/home/xxx/Android/Sdk/
$ echo $JAVA_HOME
/usr/lib/jvm/java-8-oracle/

我不确定它为什么要在 ubuntu 机器上寻找 Mac SDK。

最佳答案

试试这些建议:

1)检查sdk文件夹是否有权限

2)

a - 右键单击​​您的项目并在 SDK 位置下选择“打开模块设置”,为您的 SDK 放置您的位置。

b - 粘贴到 '/Applications/adt-bundle-mac-x86_64-20140321/sdk'

c - 清理并重建您的项目

3)

a - 尝试删除您的 local.properties 文件并创建一个新文件,但不要将其检入版本控制。

b - 右键单击​​项目的顶层并创建新文件“local.properties”,然后添加:“/Applications/adt-bundle-mac-x86_64-20140321/sdk”

c - 清理和构建

关于Android:Gradle generateDebugSources 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41969523/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com