Search code examples
androidgoogle-play-servicesgoogle-drive-android-api

Striping down google play services only to google drive related methods


I need to use google drive in my application but I have a problem with hitting the dex limit. So I am using: https://gist.github.com/dextorer/a32cad7819b7f272239b to strip down my google-play-services.

I am currently using this config for striping down:

actions=false
ads=false
analytics=false
appindexing=false
appstate=false
auth=true
cast=false
common=true
drive=true
dynamic=false
games=false
gcm=false
identity=false
internal=false
location=false
maps=false
panorama=false
plus=false
security=false
tagmanager=false
wallet=false
wearable=false

But my code (eaven tho it does not give me any errors) has problem with this:

GooglePlayServicesUtil.isGooglePlayServicesAvailable(this)

This results in this error:

11-12 09:10:51.739: E/AndroidRuntime(27941): FATAL EXCEPTION: main
11-12 09:10:51.739: E/AndroidRuntime(27941): java.lang.NoClassDefFoundError: com.google.android.gms.internal.jt
11-12 09:10:51.739: E/AndroidRuntime(27941):    at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
11-12 09:10:51.739: E/AndroidRuntime(27941):    at com.google.android.gms.drive.sample.quickstart.MainActivity.onCreate(MainActivity.java:50)
11-12 09:10:51.739: E/AndroidRuntime(27941):    at android.app.Activity.performCreate(Activity.java:5066)
11-12 09:10:51.739: E/AndroidRuntime(27941):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1101)
11-12 09:10:51.739: E/AndroidRuntime(27941):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2311)
11-12 09:10:51.739: E/AndroidRuntime(27941):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2391)
11-12 09:10:51.739: E/AndroidRuntime(27941):    at android.app.ActivityThread.access$600(ActivityThread.java:151)
11-12 09:10:51.739: E/AndroidRuntime(27941):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1335)
11-12 09:10:51.739: E/AndroidRuntime(27941):    at android.os.Handler.dispatchMessage(Handler.java:99)
11-12 09:10:51.739: E/AndroidRuntime(27941):    at android.os.Looper.loop(Looper.java:155)
11-12 09:10:51.739: E/AndroidRuntime(27941):    at android.app.ActivityThread.main(ActivityThread.java:5511)
11-12 09:10:51.739: E/AndroidRuntime(27941):    at java.lang.reflect.Method.invokeNative(Native Method)
11-12 09:10:51.739: E/AndroidRuntime(27941):    at java.lang.reflect.Method.invoke(Method.java:511)
11-12 09:10:51.739: E/AndroidRuntime(27941):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1029)
11-12 09:10:51.739: E/AndroidRuntime(27941):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:796)
11-12 09:10:51.739: E/AndroidRuntime(27941):    at dalvik.system.NativeStart.main(Native Method)

Can anyone tell me wich packages I need for this to work?


Solution

  • Try to change internal=true and run again.