3

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?

Chen
  • 3,760
  • 1
  • 17
  • 21

1 Answers1

2

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"
Chen
  • 3,760
  • 1
  • 17
  • 21
  • where to add this in netbeans project? – Devashish Mamgain Apr 08 '16 at 08:50
  • add this in the project build hints http://www.codenameone.com/manual/advanced-topics.html#_sending_arguments_to_the_build_server – Chen Apr 08 '16 at 10:16
  • Do you need to use a NativeInterface to access these libs? I added a gradle dependency like you said and also like in [this answer](https://stackoverflow.com/a/52196145/5095571) and cannot access the library. Yes, it's a library for Android only. Thank you! – app-dev Oct 29 '18 at 17:16