如何在我的Codename One Android应用程序的根级别build.gradle文件中添加依赖项?

我已经在android.gradleDep构建提示中添加了正确的编译...。要集成的第三方库的提示。 (在这种情况下为Firebase)。

I already added the android.gradleDep build hint with the proper "compile'....' " hint for the 3rd party library I want to integrate. (In this case, Firebase).

在一个Codename One Android应用的根级别build.gradle文件中,我如何:

In the root-level build.gradle file in a Codename One Android app, how can I:


  1. 将classpath依赖项添加到buildscript部分?

  2. 将maven依赖项添加到allprojects部分?

编辑
3。添加一个插件,例如:应用插件:'com.google.gms.google-services'

3. Add a plugin, such as: apply plugin: 'com.google.gms.google-services'

一个直观的示例:

    buildscript {
         dependencies {
             classpath 'com.google.gms:google-services:3.1.0' // google-services plugin
         }
    }

    allprojects {
        dependencies {
            maven {
                url "https://maven.google.com" // Google's Maven repository
           } 
        }
    }

我看过构建提示上的CN1页面,但不知道该怎么做导入该库。没有这些更改,我将收到以下构建错误:

I have looked at CN1's page on Build hints but don't know what to do next to import this library. Without these changes, I get the following build error:

Resource missing. [HTTP GET: https://jcenter.bintray.com/com/google/firebase/firebase-
core/11.2.0/firebase-core-11.2.0.pom]
Resource missing. [HTTP HEAD: https://jcenter.bintray.com/com/google/firebase/firebase-
core/11.2.0/firebase-core-11.2.0.jar]

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'MyApp'.
> Could not resolve all dependencies for configuration ':_debugCompile'.
> Could not find com.google.firebase:firebase-core:11.2.0.
 Searched in the following locations:
     https://jcenter.bintray.com/com/google/firebase/firebase-core/11.2.0/firebase-core-11.2.0.pom
     https://jcenter.bintray.com/com/google/firebase/firebase-core/11.2.0/firebase-core-11.2.0.jar
     file:/tmp/build1801628445736809063xxx/MyApp/libs/firebase-core-11.2.0.jar
     file:/tmp/build1801628445736809063xxx/MyApp/libs/firebase-core.jar
     file:/home/ec2-user/android-sdk/extras/android/m2repository/com/google/firebase/firebase-core/11.2.0/firebase-core-11.2.0.pom
     file:/home/ec2-user/android-sdk/extras/android/m2repository/com/google/firebase/firebase-core/11.2.0/firebase-core-11.2.0.jar
     file:/home/ec2-user/android-sdk/extras/google/m2repository/com/google/firebase/firebase-core/11.2.0/firebase-core-11.2.0.pom
     file:/home/ec2-user/android-sdk/extras/google/m2repository/com/google/firebase/firebase-core/11.2.0/firebase-core-11.2.0.jar

EDIT ng>在.properties文件中,我有:

EDIT In the .properties file, I have:

  codename1.arg.android.repositories=maven { url "https\://maven.google.com" };

  codename1.arg.android.gradleDep=compile 'com.google.gms\:google-services\:3.1.0', compile 'com.google.firebase\:firebase-core\:11.2.0'

我收到以下错误消息:

FAILURE: Build failed with an exception.

* Where:
 Build file '/tmp/build1791213618910744158xxx/MyApp/build.gradle' line: 78

* What went wrong:
A problem occurred evaluating root project 'MyApp'.
 > Could not find property 'compile' on org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated@59ed76e3.




 1 条回答