Android Studio LibGDX Gradle同步错误 [英] Android Studio LibGDX Gradle Sync Error
问题描述
尝试运行gradle同步后,出现此错误.我不确定这是否与libgdx有关,还是仅仅是Gradle问题.
After trying to run the gradle sync I get this error. I'm not sure if this is somehow related to libgdx or is it just a Gradle problem.
配置'compile'已过时,已被替换为 实现"和"api".它将在2018年底删除. 更多信息请参见: http://d.android.com/r/tools/update- dependency-configurations.html
Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
不应在android清单中声明minSdk版本 文件.您可以将版本从清单移动到defaultConfig 在build.gradle文件中.
The minSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file.
不应在android清单中声明targetSdk版本 文件.您可以将版本从清单移动到defaultConfig 在build.gradle文件中.
The targetSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file.
推荐答案
Gradle 3.4 introduced new Java Library plugin configurations that allow you to control whether a dependency is published to the compile and runtime classpaths of projects that consume that library.
-
implementation
和api
仅可用于Android Plugin for Gradle 3.0.0
或更高版本.
implementation
andapi
can only be used withAndroid Plugin for Gradle 3.0.0
or later version.
Android插件3.0.0需要Gradle 4.1或更高版本.
Android plugin 3.0.0 requires Gradle version 4.1 or higher.
LibGDX还不支持4.x版,有一个 issue 相同.
Gradle 4.x is not supported yet in LibGDX, there is an issue for the same.
所以,目前您不能将implementation
或api
与libGDX一起使用
因此请坚持使用过时的api并使用compile
.
So currently you can't use implementation
or api
with libGDX
so stick with obsoleted api and use compile
.
这篇关于Android Studio LibGDX Gradle同步错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!