Manuals
Manuals




This translation is community contributed and may not be up to date. We only maintain the English version of the documentation. Read this manual in English

Android的Gradle

与Android应用程序的典型构建方式不同,Defold在整个构建过程中不使用Gradle。相反,Defold在本地构建中直接使用Android命令行工具,如aapt2bundletool,仅在构建服务器上解析依赖项时利用Gradle。

解析依赖项

原生扩展可以在manifests/android文件夹中包含一个build.gradle文件来指定扩展依赖项。示例:

repositories {
    mavenCentral()
}

dependencies {
    implementation 'com.google.firebase:firebase-installations:17.2.0'
    implementation 'com.google.android.gms:play-services-base:18.2.0'
}

构建服务器将收集所有扩展中的build.gradle文件,并使用这些文件解析所有依赖项,并在构建原生代码时包含它们。

示例: