Gradle 找不到 Android 支持存储库 - Eclipse Neon、Gradle 3.5、javafxpo



这是我的第一篇文章。 我已经通过Stackoverflow和其他来源广泛搜索了四天的问题,但尚未找到解决方案。 这个真的让我绞尽脑汁。

使用 Eclipse NEON、Gradle 3.5、JavaFXPorts 1.3.5、最新的 Android SDK

在 Windows 10 x64 上开发

对于简单的单类"Hello World"项目,所有预期的 Gradle 任务都不会显示。 (例如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 管理器 --列表(显示已安装的存储库):

C:androidSDKtoolsbin>sdkmanager.bat --list
Warning: File C:UsersKent.androidrepositories.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-tools25.0.3
emulator                          | 26.0.0  | Android Emulator                  | emulator
extras;android;m2repository       | 47.0.0  | Android Support Repository        | extrasandroidm2repository
extras;intel;Ha...ecution_Manager | 6.0.6   | Intel x86 Emulator Accelerator... | extrasintelHa...cution_Manager
patcher;v4                        | 1       | SDK Patch Applier v4              | patcherv4
platform-tools                    | 25.0.5  | Android SDK Platform-Tools        | platform-tools
platforms;android-25              | 3       | Android SDK Platform 25           | platformsandroid-25
sources;android-25                | 1       | Sources for Android 25            | sourcesandroid-25
tools                             | 26.0.2  | Android SDK Tools                 | tools

=======

格拉德鲁安卓输出:

C:UsersKentworkspaceTestJavaFXPorts3>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

=======

安卓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

@JoséPereda以下评论中解决了我的问题:

我的意思是ANDROID_HOME=c/:androidSDK应该是c:/androidSDK – José Pereda

最新更新