我有一个较旧的项目,该项目使用较旧的播放服务,我想保持较旧的播放服务和Firebase版本相同。我正在尝试使用SDK级别27和最新的gradle来构建它。但是Android Studio无法定位Google Play服务模块和Firebase模块并引发错误。
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'io.fabric'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId ''
minSdkVersion 23
targetSdkVersion 27
versionCode 2
versionName '1.0.1'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
signingConfig signingConfigs.Prod
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.Prod
}
debug {
signingConfig signingConfigs.Dev
}
}
defaultConfig {
multiDexEnabled true
}
dexOptions {
javaMaxHeapSize "4g"
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
productFlavors {
}
}
kapt {
generateStubs = true
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
transitive = true
}
implementation('com.crashlytics.sdk.android:answers:1.3.13@aar') {
transitive = true
}
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation "org.jetbrains.anko:anko:$anko_version"
implementation "org.jetbrains.anko:anko-cardview-v7:$anko_version"
implementation "com.android.support:appcompat-v7:$android_lib_version"
implementation "com.android.support:support-v13:$android_lib_version"
implementation "com.android.support:design:$android_lib_version"
implementation "com.android.support:recyclerview-v7:$android_lib_version"
implementation "com.android.support:cardview-v7:$android_lib_version"
implementation "com.android.support:support-emoji:$android_lib_version"
implementation "com.android.support:support-emoji-bundled:$android_lib_version"
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-moshi:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.8.1'
implementation "com.google.firebase:firebase-database:$firebase_version"
implementation "com.google.firebase:firebase-auth:$firebase_version"
implementation "com.google.firebase:firebase-messaging:$firebase_version"
implementation "com.google.firebase:firebase-storage:$firebase_version"
implementation "com.google.android.gms:play-services-auth:$firebase_version"
implementation "com.google.android.gms:play-services-location:$firebase_version"
implementation 'com.facebook.android:facebook-android-sdk:4.33.0'
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
implementation 'com.github.faruktoptas:FancyShowCaseView:0.1.7'
implementation 'com.github.hotchemi:khronos:0.9.0'
implementation 'com.github.bumptech.glide:glide:4.7.1'
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.9.0'
implementation 'com.github.clans:fab:1.6.4'
implementation "com.google.firebase:firebase-dynamic-links:$firebase_version"
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support:exifinterface:27.1.1'
implementation 'com.google.code.gson:gson:2.8.2'
kapt 'com.github.bumptech.glide:compiler:4.7.1'
testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
版本在其他构建文件中定义如下
ext.kotlin_version ='1.2.50' ext.anko_version ='0.10.5' ext.android_lib_version = '27 .1.1' ext.firebase_version = '11 .8.0'
但是它总是抛出错误,并且永远找不到播放服务。
任何帮助表示赞赏