Google Cloud Messaging API -Error in Pom.xml file for Maven Environment(Android Studio)

20 views
Skip to first unread message

rishabja...@gmail.com

unread,
Jan 28, 2016, 3:37:01 PM1/28/16
to Maven Android Developers

I am beginner to maven and finding it difficult to migrate my project from gradle to Maven. For Push notification code, that I have using from below link in gradle environment is working fine:

But when I am trying to use it in my Maven and adding the following dependency to my pom.xml file. As suggested by following GITHUB link:
Dependency :
<dependency>
        <groupId>com.google.gcm</groupId>
        <artifactId>gcm-server</artifactId>
        <version>1.0.0</version>
 </dependency>
And when I am trying to define receiver in my manifest file, I am getting the error.Not able to import any of the Cloud Messaging API in my code.

<receiver android:name="com.google.android.gms.gcm.GcmReceiver"
                android:exported="true"
                android:permission="com.google.android.c2dm.permission.SEND" >
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            <category android:name="gcm.play.android.samples.com.gcmquickstart" />
        </intent-filter>
 </receiver>

Able to run in Gradle environment successfully but now due to some client requirement I need to migrate my project to Maven. And using the below version for GCM in my Gradle:
compile 'com.google.android.gms:play-services-gcm:8.3.0'
compile 'com.android.support:support-v4:19.1.0'
Please help me to resolve the error.If you need any more clarification, please do let me know. Thanks in Advance. Thanks for the help.
Reply all
Reply to author
Forward
0 new messages