请解释一下,如何在我的 libgdx 项目中应用 Stream API?
我是如何尝试应用它的:
project(":android") {
apply plugin: "android"
apply plugin: 'me.tatarka.retrolambda'
configurations { natives }
dependencies {
compile project(":core")
compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
compile 'net.sourceforge.streamsupport:streamsupport:1.4.1'
compile 'me.tatarka:gradle-retrolambda:3.3.0-beta3'
}
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
}
这就是我得到的:
Error:(62, 0) Gradle DSL method not found: 'compileOptions()'
最佳答案
您不能将 compileOptions
block 放在这个特定的 block 中。 compileOptions
由 android 插件定义,您必须将其放在 android
block 中。在 LibGDX 项目中,您会在 android
模块中的 build.gradle 文件中找到 android
block 。
关于java - libgdx 中的流 API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36505545/