compile 'com.google.android.gms:play-services:8.4.0' crashes on mobile

382 views
Skip to first unread message

Mauro Micó Ebro

unread,
Apr 13, 2016, 4:45:31 PM4/13/16
to Google Mobile Ads SDK Developers
Hello,
I am working with Android Studio 2.0

I import the library dependency: compile com.android.gms:play-services:8.4.0

Android Studio 2.0:
These are my devices:
Sony ST26i (Android 4.1.2, API 16) -> My project crashes!!!  :(((
Asus Nexus 7 (Android 5.1., API 22) -> My project works fine!!! :)))

Eclipse:
In eclipse I am using  play-services:8.3.0 as a library !!!!!
And my two devices works fine !!!!

Note:
I tested to use com.android.gms:play-services:8.3.0 on Android Studio, but it crashes on my mobile device (Sony)


Question1: How can I solve this issue, because I would like to use Android Studio 2.0 vs Eclipse !!!

Question2: How can I import Google_services_XX as a library on Android Studio 2.0 ? (I do not like this solution but ...)


This is my error, but it is not relevant,
E/AndroidRuntime: FATAL EXCEPTION: GLThread 917
 java.lang.NoClassDefFoundError: com.myproject.Assets
at com.myproject.Principal.create(Principal.java:54)
 at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:243)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1505)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

This project works fine on my Nexus 7 !!

Please, help !!









Vu Chau (Mobile Ads SDK Team)

unread,
Apr 13, 2016, 5:29:46 PM4/13/16
to Google Mobile Ads SDK Developers
Hi Mauro,

Are you able to update the local Play services on the Sony phone?  
What happens if you try com.google.android.gms:play-services-ads:8.4.0 to select only the ads portion of the Play services framework?  Would that still result in a crash as well?

Thanks,

Vu Chau
Mobile Ads SDK Team

Mauro Micó Ebro

unread,
Apr 14, 2016, 10:10:39 AM4/14/16
to Google Mobile Ads SDK Developers
SOLVED:
Adding on android Gradle:
defaultConfig {
        // Enabling multidex support.
        multiDexEnabled true
    }
and (multidex 1.0.1 to compile)
CODE: SELECT ALL
dependencies {
    compile 'com.android.support:support-v4:23.3.0'
    compile 'com.google.android.gms:play-services:8.4.0'
    compile 'com.android.support:multidex:1.0.1'
}


And in the manifest:
<application
...
android:name="android.support.multidex.MultiDexApplication">
...
</application>

Now the project works fine!!!


All the best !!!

Vu Chau (Mobile Ads SDK Team)

unread,
Apr 14, 2016, 10:35:16 AM4/14/16
to Google Mobile Ads SDK Developers
Hi Mauro,

That's great you figured out you needed to enable multidex for your application!  Also keep in mind that if you are not going to use the entire Google Play services framework, it'd be much more economical to import whichever portions of it you need (e.g. ads, maps, or location - see Table 1).  That way you would be able to keep your APK size in check, and your method count under 65K.

Cheers,

Vu Chau
Mobile Ads SDK Team

Mauro Micó Ebro

unread,
Apr 14, 2016, 10:38:06 AM4/14/16
to google-adm...@googlegroups.com
Ok Vu, 
thank you very much !!!

All the best!

--

---
You received this message because you are subscribed to a topic in the Google Groups "Google Mobile Ads SDK Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-admob-ads-sdk/FeZEmoAz-pQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-admob-ads...@googlegroups.com.
To post to this group, send email to google-adm...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
@MauroMEGames
Este mensaje y cualquier documento que lleve adjunto, es confidencial y destinado únicamente a la persona o entidad a quien ha sido enviado. El carácter confidencial, personal, e intransferible de la misma está protegido legalmente. Cualquier revelación, uso o reenvío no autorizado, total o parcial, está prohibido. Si Usted ha recibido este mensaje por error, le informamos que el contenido en el mismo es reservado y el uso no autorizado está prohibido legalmente, por ello, por favor, ruego lo notifique al e-mail: mmi...@gmail.com
Reply all
Reply to author
Forward
0 new messages