无法使用gradle为移动设备构建胶子项目 [英] Can't build a gluon project for mobile using gradle

查看:117
本文介绍了无法使用gradle为移动设备构建胶子项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照



和选定的Gradle任务


  • gradle任务视图与教程不同:





    我选择了 GluonTest /应用程序/ run 任务,它在桌面上运行良好。但是我找不到 androidInstall launchIOSDevice 任务,如图所示。


  • 这是我的gradle.build文件:

      buildscript {
    repositories {
    jcenter()
    }
    dependencies {
    classpath'org.javafxports:jfxmobile-plugin:1.1.1'
    }
    }

    申请插件:'org.javafxports.jfxmobile'

    存储库{
    jcenter()
    maven {
    url'http://nexus.gluonhq.com/nexus/content/repositories/releases'
    }
    }

    mainClassName ='gluon.main.GluonApplication'

    依赖项{
    compile'c​​om.gluonhq:charm:4.0.1'
    }

    jfxmobile {
    downConfig {
    version ='3.0.0'
    插件'显示','生命周期','状态栏','存储'
    }
    android {
    manifest ='src / android / AndroidMani fest.xml'
    androidSdk ='C:/ Users / Mark / AppData / Local / Android / sdk'
    }
    ios {
    infoPList = file('src / ios / Default-Info.plist')
    forceLinkClasses = [
    'com.gluonhq。**。*',
    'javax.annotations。**。*',
    'javax .inject。**。*',
    'javax.json。**。*',
    'org.glassfish.json。**。*'
    ]
    }
    }

    我唯一改变的是添加 androidSdk ='C:/ Users / Mark / AppData / Local / Android / sdk'。



    我知道我无法构建iOS项目,但我应该能够为Android构建。我该怎么做?

    解决方案

    更新Eclipse Mars后我可以重现你的问题,以及解决所有任务的方法很简单:



    基于此



    点击任务视图右侧的向下箭头图标:





    选择显示所有任务





    你会有一个新的组合p:其他,缺少任务,如 android launchIOSDevice




    I followed the instructions on http://docs.gluonhq.com/charm/4.0.1/#_getting_started. I'm using eclipse 4.5.2 and JDK 1.8.0_102. I also downloaded Android Studio with the 24/25 API level SDK from https://developer.android.com/studio/index.html#Other. Here is what I did:

    1. downloaded gradle 3.1 and set up the environment variables so gradle -v returns the correct information.
    2. installed the eclipse gluon plugin version 2.4.0 from http://download.gluonhq.com/tools/eclipse/release
    3. installed Buildship 1.0.21 from Buildship - http://download.eclipse.org/buildship/updates/e45/releases/1.0
    4. created the gluon project as shown in the tutorial and checked platforms: android, iOS and desktop. Project was created successfully.
    5. opened the Show View menu

      and selected Gradle Tasks

    6. the gradle task view looks different from the tutorial:

      I selected the GluonTest/application/run task and it runs on desktop well. But I can't find the androidInstall and launchIOSDevice tasks as you can see in the picture.

    Here is my gradle.build file:

    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'org.javafxports:jfxmobile-plugin:1.1.1'
        }
    }
    
    apply plugin: 'org.javafxports.jfxmobile'
    
    repositories {
        jcenter()
        maven {
            url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
        }
    }
    
    mainClassName = 'gluon.main.GluonApplication'
    
    dependencies {
        compile 'com.gluonhq:charm:4.0.1'
    }
    
    jfxmobile {
        downConfig {
            version = '3.0.0'
            plugins 'display', 'lifecycle', 'statusbar', 'storage'
        }
        android {
            manifest = 'src/android/AndroidManifest.xml'
            androidSdk = 'C:/Users/Mark/AppData/Local/Android/sdk'
        }
        ios {
            infoPList = file('src/ios/Default-Info.plist')
            forceLinkClasses = [
                    'com.gluonhq.**.*',
                    'javax.annotations.**.*',
                    'javax.inject.**.*',
                    'javax.json.**.*',
                    'org.glassfish.json.**.*'
            ]
        }
    }
    

    The only thing I changed there was to add the line androidSdk = 'C:/Users/Mark/AppData/Local/Android/sdk'.

    I understand I can't build the iOS project yet but I should be able to build for android. How do I do that?

    解决方案

    After updating Eclipse Mars I can reproduce your issue, and the solution to get all the tasks back is easy:

    Based on this thread, it seems there are public and private tasks.

    So only the public tasks (those added to any kind of group) are visible by default:

    Click on the down arrow icon on the right of the Tasks View:

    Select Show All Tasks:

    And you will have a new group: other, with the missing tasks like android, launchIOSDevice:

    这篇关于无法使用gradle为移动设备构建胶子项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆