我正在浏览Android开发人员培训,但我目前卡住here。我无法弄清楚如何在没有gradle break的情况下导入sample project。这些是我使用File > New > Import Project
/path/to/activity-lifecycle$ ./gradlew assembleDebug
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> failed to find target with hash string 'android-14' in: /home/user/Android/Sdk
* Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 3.273 secs
编辑:Android Studio 1.5.1,Gradle 2.8,Java 1.8.0_65,Debian 8.2
EDIT2 :确保更新activity-lifecycle/app/build.gradle
而不是activity-lifecycle/build.gradle
答案 0 :(得分:3)
在build.grandle中,请确保您有
compileSdkVersion 22
如果仍无效,请打开“SDK Manager”并安装SDK。
缩短:
打开“模块设置”,转到“属性”标签,选择构建版本和目标。