2015-06-24 98 views
0

我创建这需要我发送推送通知到我的用户? 我使用从下面的链接的例子应用程序:
http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/无法编译APK与GCM

的错误我得到是

Error:Execution failed for task ':app:processDebugManifest'. 
> Manifest merger failed : uses-sdk:minSdkVersion 8 cannot be smaller than version 9 declared in library C:\Users\VLSI-9\Desktop\Android\AndroidPushNotificationsUsingGCM\app\build\intermediates\exploded-aar\com.google.android.gms\play-services\7.5.0\AndroidManifest.xml 
    Suggestion: use tools:overrideLibrary="com.google.android.gms.all" to force usage 

,这里是我的build.gradle

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 'Google Inc.:Google APIs:8' 
    buildToolsVersion "22.0.1" 

    defaultConfig { 
     applicationId "com.androidhive.pushnotifications" 
     minSdkVersion 8 
     targetSdkVersion 16 
    } 

    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 
     } 
    } 
} 

dependencies { 
    compile 'com.android.support:support-v4:18.0.0' 
    compile 'com.google.android.gms:play-services:+' 
} 

我已经安装了所有的临时演员。

+0

我建议你只包含Play Lib所需的部分,GCM引用足够编译com.google.android.gms:play-services-gcm:7.5.0' –

+0

已经尝试使用com.google.android.gms: play-services-gcm:7.5.0 无法正常工作 –

+0

您已经回答了问题,请将您的minSdkVersion增加到9 –

回答

1

转到您的build.gradle,改变你的应用程序的minSdkVersion9

+0

这应该在build.gradle中更改,而不是清单 – drewi

+0

我使用蚀,这就是为什么 –

+0

错误:(8,5)使用-SDK:8的minSdkVersion不能比在库C宣告版本9更小:\ AndroidPushNotificationsUsingGCM \应用\构建\中间体\分解-AAR \ com.google.android .gms \ play-services \ 7.5.0 \ AndroidManifest.xml –

0

打开谷歌播放服务的清单,并检查最低SDK是9,如果它试图通过改变降级它8和重建如果不成功,则将应用程序的最小SDK更改为9并重建它。

+0

试图在以下目录中更改 C:\ Android \ AndroidPushNotificationsUsingGCM \ app \ build \中间体\爆炸-AAR \ com.google.android.gms \播放服务\ 7.5.0 \ AndroidManifest.xml中 每次我尝试COMPLE,它由最小的SDK会被替换9 –

+0

尝试将项目更改为9和检查它是否工作... – Proxytype

+0

已尝试...不工作 –