错误:(51)评估项目':app'时出现问题。
无法在项目':app'上找到参数[com.google.android.gms:play-services-gcm:7.5.0]的方法complie()。
如何解决此错误?
请查看build.gradle文件
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "XYZ"
minSdkVersion 14
targetSdkVersion 22
versionCode 13
versionName "3.0.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.squareup.okio:okio:1.4.0'
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'com.akexorcist:RoundCornerProgressBar:1.2.0'
compile 'com.github.lzyzsd:circleprogress:1.1.0@aar'
compile 'com.android.support:cardview-v7:21.0.+'
compile 'com.android.support:recyclerview-v7:21.0.+'
compile 'joda-time:joda-time:2.7'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
compile 'com.facebook.android:facebook-android-sdk:4.1.0'
compile 'com.google.android.gms:play-services-analytics:7.5.0'
complie 'com.google.android.gms:play-services-gcm:7.5.0'
compile 'com.balysv:material-ripple:1.0.2'
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile('com.crashlytics.sdk.android:crashlytics:2.4.0@aar') {
transitive = true;
}
}
答案 0 :(得分:8)
替换
-(void) updateTimer{
NSInteger hours, minutes, seconds;
// increase the passed seconds
self.secondsPassed++;
// calculate the hours, minutes, seconds from the total number of seconds
hours = self.secondsPassed / 3600;
minutes = ( self.secondsPassed % 3600) / 60;
seconds = ( self.secondsPassed %3600) % 60;
// update the label with the time
self.myLabel.text = [NSString stringWithFormat:@"%02zd:%02zd:%02zd", hours, minutes, seconds];
}
与
complie 'com.google.android.gms:play-services-gcm:7.5.0'
错误基本上是说gradle不知道compile 'com.google.android.gms:play-services-gcm:7.5.0'
是什么。