gradle 出错,使用 gluon mobile

Posted

技术标签:

【中文标题】gradle 出错,使用 gluon mobile【英文标题】:Error with gradle, using gluon mobile 【发布时间】:2018-06-08 04:24:35 【问题描述】:

大家好。

我在 eclipse 中测试 gluon 移动插件,它工作正常,但是,在尝试添加依赖项后,我遇到了以下错误:

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':AppTesteApp:compileClasspath'.
> Could not download charm.jar (com.gluonhq:charm:4.4.1)
   > Could not get resource 'http://nexus.gluonhq.com/nexus/content/repositories/releases/com/gluonhq/charm/4.4.1/charm-4.4.1.jar'.
      > Could not GET 'http://nexus.gluonhq.com/nexus/content/repositories/releases/com/gluonhq/charm/4.4.1/charm-4.4.1.jar'. Received status code 503 from server: Service Unavailable
> Could not download glisten-afterburner.jar (com.gluonhq:glisten-afterburner:1.2.1)
   > Could not get resource 'http://nexus.gluonhq.com/nexus/content/repositories/releases/com/gluonhq/glisten-afterburner/1.2.1/glisten-afterburner-1.2.1.jar'.
      > Could not GET 'http://nexus.gluonhq.com/nexus/content/repositories/releases/com/gluonhq/glisten-afterburner/1.2.1/glisten-afterburner-1.2.1.jar'. Received status code 503 from server: Service Unavailable
> Could not download charm-glisten-connect-view.jar (com.gluonhq:charm-glisten-connect-view:4.4.1)
   > Could not get resource 'http://nexus.gluonhq.com/nexus/content/repositories/releases/com/gluonhq/charm-glisten-connect-view/4.4.1/charm-glisten-connect-view-4.4.1.jar'.
      > Could not GET 'http://nexus.gluonhq.com/nexus/content/repositories/releases/com/gluonhq/charm-glisten-connect-view/4.4.1/charm-glisten-connect-view-4.4.1.jar'. Received status code 503 from server: Service Unavailable
> Could not download charm-glisten.jar (com.gluonhq:charm-glisten:4.4.1)
   > Could not get resource 'http://nexus.gluonhq.com/nexus/content/repositories/releases/com/gluonhq/charm-glisten/4.4.1/charm-glisten-4.4.1.jar'.
      > Could not GET 'http://nexus.gluonhq.com/nexus/content/repositories/releases/com/gluonhq/charm-glisten/4.4.1/charm-glisten-4.4.1.jar'. Received status code 503 from server: Service Unavailable
> Could not download charm-cloudlink-client.jar (com.gluonhq:charm-cloudlink-client:4.4.4)
   > Could not get resource 'http://nexus.gluonhq.com/nexus/content/repositories/releases/com/gluonhq/charm-cloudlink-client/4.4.4/charm-cloudlink-client-4.4.4.jar'.
      > Could not GET 'http://nexus.gluonhq.com/nexus/content/repositories/releases/com/gluonhq/charm-cloudlink-client/4.4.4/charm-cloudlink-client-4.4.4.jar'. Received status code 503 from server: Service Unavailable

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

我换了IDE试了一下,遇到了同样的错误,之后就没有运行了。

有人发现这个错误并更正了吗?有灯吗?

我正在使用 InteliJ IDE 和 eclipse,在带有 JDK 1.8、gradle 4 的 fedora 26 上运行。

我的 build.gradle:

buildscript 
    repositories 
        jcenter()
    
    dependencies 
        classpath 'org.javafxports:jfxmobile-plugin:1.3.10'
    


apply plugin: 'org.javafxports.jfxmobile'

repositories 
    jcenter()
    maven 
        url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
    


mainClassName = 'com.gluonapplication.GluonApplication'

dependencies 
    compile 'com.gluonhq:charm:4.4.1'


jfxmobile 
    downConfig 
        version = '3.6.0'
        // Do not edit the line below. Use Gluon Mobile Settings in your project context menu instead
        plugins 'display', 'lifecycle', 'statusbar', 'storage'
    
    android 
        manifest = 'src/android/AndroidManifest.xml'
    
    ios 
        infoPList = file('src/ios/Default-Info.plist')
        forceLinkClasses = [
                'com.gluonhq.**.*',
                'javax.annotations.**.*',
                'javax.inject.**.*',
                'javax.json.**.*',
                'org.glassfish.json.**.*'
        ]
    

控制台错误:

12:26:52: Executing task 'build'...

:assemble UP-TO-DATE
:check UP-TO-DATE
:build UP-TO-DATE
:GluonMobile-MultiViewProjectApp:compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Could not resolve all files for configuration ':GluonMobile-MultiViewProjectApp:compileClasspath'.
> Could not download charm.jar (com.gluonhq:charm:4.4.1)
   > Could not get resource 'http://nexus.gluonhq.com/nexus/content/repositories/releases/com/gluonhq/charm/4.4.1/charm-4.4.1.jar'.
      > Could not GET 'http://nexus.gluonhq.com/nexus/content/repositories/releases/com/gluonhq/charm/4.4.1/charm-4.4.1.jar'. Received status code 503 from server: Service Unavailable
> Could not download charm-glisten-connect-view.jar (com.gluonhq:charm-glisten-connect-view:4.4.1)
   > Could not get resource 'http://nexus.gluonhq.com/nexus/content/repositories/releases/com/gluonhq/charm-glisten-connect-view/4.4.1/charm-glisten-connect-view-4.4.1.jar'.
      > Could not GET 'http://nexus.gluonhq.com/nexus/content/repositories/releases/com/gluonhq/charm-glisten-connect-view/4.4.1/charm-glisten-connect-view-4.4.1.jar'. Received status code 503 from server: Service Unavailable
> Could not download charm-glisten.jar (com.gluonhq:charm-glisten:4.4.1)
   > Could not get resource 'http://nexus.gluonhq.com/nexus/content/repositories/releases/com/gluonhq/charm-glisten/4.4.1/charm-glisten-4.4.1.jar'.
      > Could not GET 'http://nexus.gluonhq.com/nexus/content/repositories/releases/com/gluonhq/charm-glisten/4.4.1/charm-glisten-4.4.1.jar'. Received status code 503 from server: Service Unavailable
> Could not download charm-cloudlink-client.jar (com.gluonhq:charm-cloudlink-client:4.4.4)
   > Could not get resource 'http://nexus.gluonhq.com/nexus/content/repositories/releases/com/gluonhq/charm-cloudlink-client/4.4.4/charm-cloudlink-client-4.4.4.jar'.
      > Could not GET 'http://nexus.gluonhq.com/nexus/content/repositories/releases/com/gluonhq/charm-cloudlink-client/4.4.4/charm-cloudlink-client-4.4.4.jar'. Received status code 503 from server: Service Unavailable

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

* Get more help at https://help.gradle.org

BUILD FAILED in 4s
1 actionable task: 1 executed
Could not GET 'http://nexus.gluonhq.com/nexus/content/repositories/releases/com/gluonhq/charm/4.4.1/charm-4.4.1.jar'. Received status code 503 from server: Service Unavailable
12:26:56: Task execution finished 'build'.

【问题讨论】:

发布您的build.gradle 文件。错误Received status code 503 from server: Service Unavailable 可能意味着nexus 服务器已关闭,但它现在对我有用。你能再检查一下吗? 嗨何塞 =D 我的 build.gradle buildscript dependencies classpath 'org.javafxports:jfxmobile-plugin:1.1.0' repositories jcenter() maven url 'http://nexus.gluonhq.com/nexus/content/repositories/releases' dependencies compile 'com.gluonhq:charm:4.0.0' jfxmobile downConfig version = '3.0.0' plugins 'display', 'lifecycle', 'statusbar', 'storage' android manifest = 'src/android/AndroidManifest.xml' 我看到你回答了这个,并更改了我的 gradle,但错误仍然存​​在。 [***.com/questions/41519348/… 你的依赖真的过时了。到目前为止,jfxmobile 版本是 1.3.10,charm 使用 4.4.1,downConfig 使用 3.6.0。也许您可以更新它们,然后再次运行./gradlew clean build 出现同样的错误:* What went wrong: Could not resolve all files for configuration ':GluonMobile-MultiViewProjectApp:compileClasspath'.我做了一个新项目进行测试,还是同样的问题。 【参考方案1】:

错误解决,我下载了GradleIdePack 3.8.x + 1.0.x plugin并成功执行。非常感谢大家的支持。

【讨论】:

如果您在您提到的问题中选中answers 之一,则有一个新的插件版本,因此您只需更新您当前的插件即可。 @JoséPereda,您知道如何添加诸如 firebase 之类的依赖项吗?我正在尝试使用 api,但不要写下我的库。 请创建一个新问题。 对不起,*** 只允许我在 3 天内提出另一个问题。

以上是关于gradle 出错,使用 gluon mobile的主要内容,如果未能解决你的问题,请参考以下文章

使用 Bluemix Mobile Services 仪表板和基础下载代码会出错

注册客户 IBM Mobile First 时出错

使用 Jenkins 构建 Gradle 项目时出错

在 Android 设备上安装 gluonfx:install 命令失败,找不到文件

Gluon 默认使用啥 CDI 机制?

使用 clean() 方法在我的 build.gradle 中出错