![](/img/trans.png)
[英]Problem "Could not get unknown property 'mergeResourcesProvider' for object of type com.android.build.gradle.internal.api.ApplicationVariantImpl."
[英]Could not get unknown property 'javaVersion' for object of type com.android.build.gradle.internal.CompileOptions
我在運行我的項目時收到此錯誤。 我在這兩行中遇到錯誤 sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility javaVersion.VERSION_1_8 並且我將這些行更改為 sourceCompatibility JavaVersion.VERSION_1_2 targetCompatibility javaVersion.VERSION_1_2 但面臨同樣的錯誤。 我有 android studio 2.2.3,這是我的 Gradle 文件。
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "com.fcih.gp.furniturego"
minSdkVersion 17
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
debuggable true
}
}
compileOptions{
sourceCompatibility JavaVersion.VERSION_1_2
targetCompatibility javaVersion.VERSION_1_2
}
// compileOptions {
// sourceCompatibility JavaVersion.VERSION_1_8
// targetCompatibility JavaVersion.VERSION_1_8
// }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile(name: 'wikitudesdk', ext: 'aar')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',
{
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:25.4.0'
compile 'com.android.support:exifinterface:25.4.0'
compile 'com.android.support:appcompat-v7:25.4.0'
compile 'com.android.support:customtabs:25.4.0'
compile 'com.android.support:support-v4:25.4.0'
compile 'com.android.support:recyclerview-v7:25.4.0'
compile 'com.android.support:cardview-v7:25.4.0'
compile 'com.google.firebase:firebase-database:11.0.1'
compile 'com.google.firebase:firebase-auth:11.0.1'
compile 'com.google.firebase:firebase-storage:11.0.1'
compile 'com.firebaseui:firebase-ui-database:2.0.1'
compile 'com.google.android.gms:play-services-auth:11.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.23.0'
compile 'com.twitter.sdk.android:twitter:3.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.makeramen:roundedimageview:2.3.0'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.7'
compile 'me.grantland:autofittextview:0.2.1'
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.6'
compile 'com.koushikdutta.ion:ion:2.2.1'
}
repositories {
jcenter()
flatDir { dirs 'libs' }
}
apply plugin: 'com.google.gms.google-services'
將 JavaVersion.VERSION_1_8 更改為 1.8
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.