error: package com.google.android.gcm does not exist - After migrating to Gradle

前端 未结 3 1258
北海茫月
北海茫月 2020-12-18 00:03

I have a problem with an old project which was developed in IntelliJ without Gradle. I wanted to migrate it to Android Studio and Gradle, but I am experiencing a lot of prob

相关标签:
3条回答
  • 2020-12-18 00:43

    You can download gcm.jar by this path

    http://www.java2s.com/Code/Jar/g/Downloadgcmjar.htm

    or this

    http://www.java2s.com/Code/JarDownload/gcm/gcm.jar.zip

    After you download it, unzip it, it should have extention .jar not .jar.zip

    Then copy and paste it to libs dir in your project

    Then right click on gcm.jar and click on add as lib

    That is it

    0 讨论(0)
  • 2020-12-18 00:48

    GCMRegistrar is not part of Google Play Services, but is part of the now entirely deprecated gcm.jar file.

    You'll need to add gcm.jar to your dependencies if you'd like to temporarily keep using it until you migrate to Google Play Services' GCM implementation:

    compile files('libs/gcm.jar')
    
    0 讨论(0)
  • 2020-12-18 00:51

    You need to add these both lines in your build.gradle file of your application :

    dependencies {
        ...
        compile 'com.google.maps:google-maps-services:0.1.3'
        compile 'com.google.android.gms:play-services:6.5.87'
    }
    
    0 讨论(0)
提交回复
热议问题