有沒有一種方法來禁用約Retrolambda - 傑克需要支持Java 8 - 警告修復
傑克需要支持Java 8個語言特性的警告。
while using Retrolambda?
我現在不需要插孔支持,因爲它還沒有編譯我們的項目。
有沒有一種方法來禁用約Retrolambda - 傑克需要支持Java 8 - 警告修復
傑克需要支持Java 8個語言特性的警告。
while using Retrolambda?
我現在不需要插孔支持,因爲它還沒有編譯我們的項目。
機器人工作室
添加以下代碼在您的應用程序gradle這個是做synck
// ----- add
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'me.tatarka:gradle-retrolambda:3.2.4'
}
}
repositories {
mavenCentral()
}
// ----- end
apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda' // ----- add
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
//----add
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
這並沒有回答這個問題 –
您可以直接從您的build.gradle
文件中刪除以下配置後:
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
的retrolambda
插件會照顧到這一點,並設置Java編譯器任務具有正確的源和目標兼容性設置。
我確認在build.gradle中刪除VERSION_1_8引用是安全的。 此外,如果在Java版本設置爲1.8,並使用Retrolambda,以下錯誤踢在同一時間真一層接口的支持:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "io.github.rxandroid"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
jackOptions {
enabled true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'io.reactivex:rxjava:1.3.0'
compile 'com.jakewharton:butterknife:8.6.0'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.2.0'
compile 'com.squareup.retrofit2:adapter-rxjava:2.2.0'
}
您不應該使用這個 'jackOptions {0}啓用true } Jack項目已關閉,當Android Studio 3.0進入穩定通道時,您可以從項目中刪除retrolambda,因爲這已經在那裏完美運行了! – miszmaniac
它不是一個警告,它只是一個信息。那爲什麼還要把它關掉? – Lovis
當事情乾淨時你難道不愛嗎?其實它在詹金斯看起來很糟糕,因爲它有30條線。 我知道這不是什麼大不了的事情,但如果它快速解決,爲什麼不打擾呢? – miszmaniac
30行?這很有趣,我只有「8」。無論如何。不,我真的不關心這些事情。 (如果這是一個真正的警告,會有所不同) – Lovis