Android Studio LibGDX Gradle 同步错误 [英] Android Studio LibGDX Gradle Sync Error

查看:40
本文介绍了Android Studio LibGDX Gradle 同步错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试运行 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.

配置编译"已过时并已替换为实现"和API".它将在 2018 年底移除.对于更多信息见:http://d.android.com/r/tools/update-依赖配置.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 manifest 中声明 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 引入了新的 Java 库插件配置 允许您控制是否将依赖项发布到使用该库的项目的编译和运行时类路径.

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.

  • implementationapi 只能与 Android Plugin for Gradle 3.0.0 或更高版本一起使用.

  • implementation and api can only be used with Android 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 尚不支持 Gradle 4.x,存在一个问题 相同.

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

所以目前你不能在 libGDX 中使用 implementationapi所以坚持使用过时的 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆