Android Studio LibGDX Gradle Sync Error

こ雲淡風輕ζ 提交于 2019-12-02 10:35:04

问题


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.

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

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.

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.


回答1:


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 and api can only be used with Android Plugin for Gradle 3.0.0 or later version.

  • Android plugin 3.0.0 requires Gradle version 4.1 or higher.

  • Gradle 4.x is not supported yet in LibGDX, there is an issue for the same.


So currently you can't use implementation or api with libGDX so stick with obsoleted api and use compile.



来源:https://stackoverflow.com/questions/51143740/android-studio-libgdx-gradle-sync-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!