简体   繁体   English

自己编译/构建Gluon Charm-Down

[英]Compile/Build Gluon Charm-Down itself

I would like to add some features to gluon charm-down I am currently missing. 我想为我目前缺少的胶子魅力添加一些功能。 Too bad that no documentation exisits about how to do that. 太糟糕了,没有文档提供有关该操作的信息。 All the steps I describe here are done on my development computer where I also develop a test-app using gluon mobile (incl. charm-down). 我在此描述的所有步骤都是在开发计算机上完成的,在该计算机上我还使用gluon mobile(包括charm-down)开发了一个测试应用程序。 Compiling/deploying this app I have no problem under iOS, Android, Desktop/Windows Surface. 编译/部署此应用程序在iOS,Android,桌面/ Windows Surface下,我没有问题。

My Development Environment is Windows 10 /x64 Intel i7 32GB. 我的开发环境是Windows 10 / x64 Intel i7 32GB。 Java 8u121 (some others too), installed Android SDK For the iPhone I also have a Macbook here (which I do not use for development, only for compile/deployment/tests). Java 8u121(也有其他一些),已安装Android SDK对于iPhone,我在这里还有一台Macbook(我不用于开发,仅用于编译/部署/测试)。

In order to be able to make my addons to charm-down I checked out the source from BitBucket via Mercurial. 为了使我的插件魅力四射,我通过Mercurial从BitBucket中检出了源代码。

hg clone https://bitbucket.org/gluon-oss/charm-down 汞克隆https://bitbucket.org/gluon-oss/charm-down

Then I changed the working directory to the checked out root (with build.gradle, gradle.properties etc.) and called gradlew clean install 然后我将工作目录更改为检出的根目录(使用build.gradle,gradle.properties等),并命名为gradlew clean install

After a short while I am informed that ANDROID_HOME is not set. 片刻之后,我被告知未设置ANDROID_HOME。 Well, it is set, but as Windows Enviroment. 好吧,它已设置,但作为Windows环境。 To enable gradle to have it, I added it to gradle.properties (ANDROID_HOME=C:/.....) The directory I gave is the one containing the directories (add-ons, build-tools etc.) 为了使gradle拥有它,我将其添加到gradle.properties(ANDROID_HOME = C:/ .....)我给的目录是包含目录的目录(附加组件,构建工具等)。

No more complaints from gradle about the missing ANDROID_HOME, but now I get compile errors for missing Android Classes gradle不再抱怨缺少ANDROID_HOME,但是现在我因缺少Android类而收到编译错误

C:\projects\Gluon-Charm\charm-down\plugins\plugin-lifecycle\android\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidLifecycleService.java:30: error: package android.app does not exist
import android.app.Activity;
              ^
C:\projects\Gluon-Charm\charm-down\plugins\plugin-lifecycle\android\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidLifecycleService.java:31: error: package android.app does not exist
import android.app.Application;
              ^
C:\projects\Gluon-Charm\charm-down\plugins\plugin-lifecycle\android\src\main\java\com\gluonhq\charm\down\plugins\android\AndroidLifecycleService.java:32: error: package android.os does not exist
import android.os.Bundle;

.... many more

What am I missing ? 我想念什么?

If you have a look at the core/android module's build.gradle file, there is a dependency on the android.jar: 如果您查看core/android模块的build.gradle文件,则对android.jar有依赖性:

dependencies {
    compile project(":core")
    compile files("$ANDROID_HOME/platforms/android-$androidPlatformVersion/android.jar")
    compile "org.javafxports:jfxdvk:$javafxportsVersion"
}

You have already defined your ANDROID_HOME path, but there is another variable: $androidPlatformVersion . 您已经定义了ANDROID_HOME路径,但是还有另一个变量: $androidPlatformVersion

This one is defined in the gradle.properties file that you will find in the root of the Charm Down project, with these two properties set: 这是在gradle.properties文件中定义的,您可以在Charm Down项目的根目录中找到该文件,并设置以下两个属性:

androidPlatformVersion=24
javafxportsVersion=8.60.8

You'll need to install Android SDK 24, so the dependency is resolved and android.jar is added. 您需要安装Android SDK 24,以便解决依赖关系并添加android.jar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM