我在Android上构建了一个具有最低SDK版本24的演示应用程序。完成后,我被告知我们只有带有SDK 23的测试设备(我正在使用自己的设备进行开发),因此需要降级。为此,我将我的app.gradle中的minSdkVersion从24更改为23。 Java 8功能。据我所知,我还没有在项目中添加Retrolambda之类的东西。
这是我的app.gradle文件:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.myfirm.rocketchatdemo"
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// RocketChat SDK
compile('com.rocketchat.core:rocketchat-core:0.7.1') {
exclude group: 'org.json', module: 'json'
}
// https://mvnrepository.com/artifact/io.reactivex.rxjava2/rxandroid
// Reactive Java
compile group: 'io.reactivex.rxjava2', name: 'rxandroid', version: '2.0.1'
compile 'io.reactivex.rxjava2:rxjava:2.1.1'
// Chat Kit
// compile 'com.github.stfalcon:chatkit:0.2.2'
// ChatMessageView
compile 'com.github.bassaer:chatmessageview:1.3.5'
// Google Firebase
compile 'com.google.firebase:firebase-core:11.4.2' // this line must be included to integrate with Firebase
compile 'com.google.firebase:firebase-messaging:11.4.2'
}
这对我来说非常令人困惑,要么两者都应该起作用,要么都不起作用!此外,我的应用程序无法正常运行,我认为可能是某些残留的Java 8代码造成的。这就是我偶然发现的方式。
我是否可能错过了一些配置,无法将我的应用正确转换为SDK 23?
根据支持的Java 8语言功能和API文档,Lambda表达式不需要特定的minSdkVersion版本。
这也适用于:
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句