Android GCM, gradle can't sync properly -
i'm new gcm , trying first time. followed documentation google guide to. tried build , run project gradle files set followed:
dependencies { classpath 'com.android.tools.build:gradle:1.3.0' classpath 'com.google.gms:google-services:2.0.0-beta2' }
dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:23.0.0' compile 'com.google.android.gms:play-services:8.4.0' }
but i'm getting next error:
error:execution failed task ':app:processdebuggoogleservices'. please fix version conflict either updating version of google-services plugin (information latest version available @ https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating version of com.google.android.gms 8.3.0."
when tried change 8.3.0 or 8.3+ error:
error:execution failed task ':app:processdebugresources'. com.android.ide.common.process.processexception: org.gradle.process.internal.execexception: process 'command '/users/sarigbrand/library/android/sdk/build-tools/23.0.0/aapt'' finished non-zero exit value 1
error:(18) tag attribute name has invalid character '>'.
error:(14) tag attribute name has invalid character '>'."
this issue make debug.manifest red , full of errors , project won't sync @ all
other things tried:
- google-services versions - 2.0.0-alpha9, 1.5.0-beta2, 1.5.0, 1.3.0.
- i tried delete android studio , reinstall (old version - 1.3, new version 1.5)
i tried download gradle 2.10 or run wrapper file (i asked to before reinstalled):
distributionurl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.sarigbrand.pushnotification" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="16" android:targetsdkversion="23" /> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.wake_lock" /> <permission android:name="com.example.sarigbrand.pushnotification>.permission.c2d_message" android:protectionlevel="signature" /> <uses-permission android:name="com.example.sarigbrand.pushnotification>.permission.c2d_message" /> <uses-permission android:name="android.permission.access_network_state" /> <uses-feature android:glesversion="0x00020000" android:required="true" /> <!-- permissions required gcm --> <uses-permission android:name="com.google.android.c2dm.permission.receive" /> <application android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name="com.example.sarigbrand.pushnotification.mainactivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> <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="com.example.gcm" /> </intent-filter> </receiver> <service android:name="com.example.sarigbrand.pushnotification.mygcmlistenerservice" android:exported="false" > <intent-filter> <action android:name="com.google.android.c2dm.intent.receive" /> </intent-filter> </service> <service android:name="com.example.sarigbrand.pushnotification.myinstanceidlistenerservice" android:exported="false" > <intent-filter> <action android:name="com.google.android.gms.iid.instanceid" /> </intent-filter> </service> <!-- include adactivity , inapppurchaseactivity configchanges , themes. --> <activity android:name="com.google.android.gms.ads.adactivity" android:configchanges="keyboard|keyboardhidden|orientation|screenlayout|uimode|screensize|smallestscreensize" android:theme="@android:style/theme.translucent" /> <activity android:name="com.google.android.gms.ads.purchase.inapppurchaseactivity" android:theme="@style/theme.iaptheme" /> <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> <activity android:name="com.google.android.gms.appinvite.previewactivity" android:exported="true" android:theme="@style/theme.appinvite.preview" > <intent-filter> <action android:name="com.google.android.gms.appinvite.action_preview" /> <category android:name="android.intent.category.default" /> </intent-filter> </activity> <activity android:name="com.google.android.gms.auth.api.signin.internal.signinhubactivity" android:excludefromrecents="true" android:exported="false" android:theme="@android:style/theme.translucent.notitlebar" /> <service android:name="com.google.android.gms.auth.api.signin.revocationboundservice" android:exported="true" android:permission="com.google.android.gms.auth.api.signin.permission.revocation_notification" /> <provider android:name="com.google.android.gms.measurement.appmeasurementcontentprovider" android:authorities="com.example.sarigbrand.pushnotification.google_measurement_service" android:exported="false" /> <receiver android:name="com.google.android.gms.measurement.appmeasurementreceiver" android:enabled="true" > <intent-filter> <action android:name="com.google.android.gms.measurement.upload" /> </intent-filter> </receiver> <service android:name="com.google.android.gms.measurement.appmeasurementservice" android:enabled="true" android:exported="false" /> </application>
remove project-level build.gradle
:
classpath 'com.google.gms:google-services:2.0.0-beta2'
use reference gcm service in app build.gradle
:
compile 'com.google.android.gms:play-services-gcm:8.4.0'
this working me
Comments
Post a Comment