How to add gradle library dependency to a codename

2020-07-19 14:56发布

问题:

Normally in android I can just edit the build.gradle file and place my compile dependencies like this:

dependencies {
    compile 'com.android.support:support-v4:23.+'
    compile 'com.google.android.gms:play-services-plus:8.3.0'
    compile 'com.google.android.gms:play-services-auth:8.3.0'
    compile 'com.google.android.gms:play-services-base:8.3.0'
 } 

How can I add a compile dependency in a codenameone project?

回答1:

The generated project utilizes the jcenter() repository. In order to add a compile dependency you will need to use the 'gradleDependencies' build hint, for example:

gradleDependencies=" compile 'com.facebook.android:facebook-android-sdk:4.7.0'\n"