If using Android Studio with remote dependency libraries then use the following in the build.gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.gms:play-services-basement:8.4.0'
}
If you want to remove GPS from an existing project and just use the jar then here are the steps required.
Removing GPS from an existing project to just include google-play-services-basement.jar. For example the out of the box Tapjoy EasyApp sample includes the entire GPS library. Listed below are the steps showing how to remove this and just use the required google-play-services-basement.jar.
Remove references to GPS in the following locations
//include ':Libraries:google-play-services_lib'
include ':TapjoyEasyApp'
#android.library.reference.1=../Libraries/google-play-services_lib
dependencies {
compile fileTree(include: '*.jar', dir: 'libs')
// compile project(':Libraries:google-play-services_lib')
compile files('libs/google-play-services-basement.jar')
}
<application
android:icon="@drawable/icon"
android:label="@string/app_name" >
<!-- <meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />-->
Another method is to include an entry into the gradle.build that allows for multidex support. See the following link for more details on this:
http://developer.android.com/tools/building/multidex.html
Here are a couple of links on the Unity forums that talk about workarounds for this issue.
http://answers.unity3d.com/questions/816708/too-many-method-references-when-i-export-android-b.html http://forum.unity3d.com/threads/dex-64k-method-limit-get-unity-to-use-gradle-build-options.323852/
Unity has an option to create an android project instead of .apk. Then you can make the modifications suggested above.