我刚刚将CompileSDKVersion和TargetSDK版本更新为27,并相应地更新了依赖项,现在我的应用程序无法运行,它收到此错误:
Program type already present: com.android.vending.billing.IInAppBillingService
Message{kind=ERROR, text=Program type already present: com.android.vending.billing.IInAppBillingService, sources=[Unknown source file], tool name=Optional.of(D8)}
我正在使用名为checkout的结算库。我已经尝试恢复到26并禁用某些依赖项,但似乎没有任何工作。
我的应用级别Build.Gradle
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "me.paxana.cwnet"
minSdkVersion 16
targetSdkVersion 27
versionCode 9
versionName "2.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.google.android.gms:play-services-ads:15.0.0'
implementation 'com.google.firebase:firebase-messaging:15.0.0'
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.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:gridlayout-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:support-media-compat:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support:animated-vector-drawable:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.squareup.okhttp3:okhttp:3.9.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.firebase:firebase-core:15.0.0'
implementation 'com.google.firebase:firebase-auth:15.0.0'
implementation 'com.google.firebase:firebase-database:15.0.0'
implementation 'com.google.firebase:firebase-ads:15.0.0'
implementation 'com.google.firebase:firebase-crash:15.0.0'
implementation 'com.firebaseui:firebase-ui-auth:3.3.0'
implementation 'com.firebaseui:firebase-ui-database:3.0.0'
implementation 'org.solovyev.android:checkout:1.2.1'
implementation 'com.google.android.gms:play-services-auth:15.0.0'
implementation 'com.facebook.android:facebook-android-sdk:4.29.0'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.daimajia.slider:library:1.1.5@aar'
implementation 'me.zhanghai.android.materialratingbar:library:1.2.0'
implementation 'com.squareup.moshi:moshi:1.5.0'
implementation('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') {
transitive = true
}
implementation 'com.anthonymandra:ToggleButtons:2.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.mikepenz:iconics-core:3.0.3@aar'
implementation 'com.mikepenz:fontawesome-typeface:5.0.6.0@aar'
implementation 'com.anjlab.android.iab.v3:library:1.0.44'
testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
我的项目级别build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
google()
maven {
url 'https://maven.fabric.io/public'
}
maven { url 'https://repo.spring.io/plugins-snapshot' }
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
classpath 'com.google.gms:google-services:3.2.1'
classpath 'io.fabric.tools:gradle:1.24.4'
classpath 'io.spring.gradle:dependency-management-plugin:1.0.6.BUILD-SNAPSHOT'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url "https://jitpack.io" }
jcenter()
maven {
url "https://maven.google.com" // Google's Maven repository
}
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}