这是我的第一篇文章。我已经通过Stackoverflow和其他问题广泛搜索了四天,并且尚未找到解决方案。这个真的让我绞尽脑汁。
使用Eclipse NEON,Gradle 3.5,JavaFXPorts 1.3.5,最新的Android SDK
在Windows 10 x64上开发
所有预期的Gradle任务都不适用于简单的单级" Hello World"项目。 (例如,android,androidRelease,androidInstall等所有缺失的任务)。
从命令行,我可以运行gradlew android,但我收到一条错误,指出无法找到Android支持存储库。
正确设置AFAIK android SDK路径并安装Android支持存储库。
请注意," gradlew run"确实正确地构建和执行项目的桌面版本。
以下是关键配置文件和输出。我可以按要求发布任何其他内容。
======
gradle.build:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.3.5'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
jcenter()
}
dependencies {
implementation 'com.google.guava:guava:21.0'
}
jfxmobile {
android {
compileSdkVersion = 25
targetSdkVersion = 19
minSdkVersion = 17
}
}
mainClassName = 'Main'
=======
gradle.properties:
org.gradle.jvmargs=-Xms128m -Xmx1g
ANDROID_HOME=c/:androidSDK
=======
SDK Manager --list(显示已安装的存储库):
C:\androidSDK\tools\bin>sdkmanager.bat --list
Warning: File C:\Users\Kent\.android\repositories.cfg could not be loaded.
Installed packages:
Path | Version | Description | Location
------- | ------- | ------- | -------
build-tools;25.0.3 | 25.0.3 | Android SDK Build-Tools 25.0.3 | build-tools\25.0.3\
emulator | 26.0.0 | Android Emulator | emulator\
extras;android;m2repository | 47.0.0 | Android Support Repository | extras\android\m2repository\
extras;intel;Ha...ecution_Manager | 6.0.6 | Intel x86 Emulator Accelerator... | extras\intel\Ha...cution_Manager\
patcher;v4 | 1 | SDK Patch Applier v4 | patcher\v4\
platform-tools | 25.0.5 | Android SDK Platform-Tools | platform-tools\
platforms;android-25 | 3 | Android SDK Platform 25 | platforms\android-25\
sources;android-25 | 1 | Sources for Android 25 | sources\android-25\
tools | 26.0.2 | Android SDK Tools | tools\
=======
gradlew android输出:
C:\Users\Kent\workspace\TestJavaFXPorts3>gradlew android
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
* What went wrong:
You must install the Android Support Repository. Open the Android SDK Manager and choose the Android Support Repository from the Extras category at the bottom of the list of packages.
* 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: 7.627 secs
=======
Android SDK目录:
C:\androidSDK>dir
Volume in drive C is Acer
Volume Serial Number is C492-4415
Directory of C:\androidSDK
2017-05-06 08:55 PM <DIR> .
2017-05-06 08:55 PM <DIR> ..
2017-05-08 06:27 PM 16 .knownPackages
2017-05-06 08:54 PM <DIR> build-tools
2017-05-06 08:42 PM <DIR> emulator
2017-05-08 06:27 PM <DIR> extras
2017-05-06 08:47 PM <DIR> licenses
2017-05-06 08:42 PM <DIR> patcher
2017-05-06 08:42 PM <DIR> platform-tools
2017-05-06 08:56 PM <DIR> platforms
2017-05-06 08:49 PM <DIR> sources
2017-05-06 08:43 PM <DIR> tools
答案 0 :(得分:1)
@JoséPereda在以下评论中解决了我的问题:
我的意思是ANDROID_HOME = c /:androidSDK应该是c:/ androidSDK - JoséPereda