简体   繁体   English

将LibGdx项目生成到Android Studio版本1.0中?

[英]Generating a LibGdx project into android studio version 1.0?

I followed the instructions on here http://www.programmingmoney.com/setup-libgdx-android-studio/ for installing and using LibGdx on Android Studio 1.0(official release). 我按照此处http://www.programmingmoney.com/setup-libgdx-android-studio/上的说明在Android Studio 1.0(正式发行版)上安装和使用LibGdx。 I am on step 4, the actual generation step. 我在第4步,实际的生成步骤。 When I tried import project, I got this exception 当我尝试导入项目时,出现此异常

Gradle version 2.1 is required. Current version is 2.2.1. If using the gradle wrapper, try editing the distributionUrl in C:\Users\chris\AndroidStudioProjects\SetUpGame\gradle\wrapper\gradle-wrapper.properties to gradle-2.1-all.zip.

This was a similar error to what this person got in this thread - Upgrading project to Android Studio 1.0 (Gradle problems) . 这与该人员在此线程中遇到的错误类似- 将项目升级到Android Studio 1.0(Gradle问题)

When i went to view gradle-wrapper.properties with notepad ++, this was what i saw 当我用记事本++查看gradle-wrapper.properties时,这就是我所看到的

distributionUrl=http\://services.gradle.org/distributions/gradle-2.1-all.zip

which meant that this didn't have to be changed. 这意味着不必对此进行更改。 (the answer that was given in the other thread) (在另一个线程中给出的答案)

Does anyone know what the issue is? 有人知道这个问题是什么吗? Is Android studio version 1.0 too new for Libgdx? 对于Libgdx,Android Studio 1.0版是否太新? I m not that familiar with Gradle. 我对Gradle不太熟悉。

Look through all your build.gradle files and update the version of the Android Gradle plugin that's specified. 浏览所有build.gradle文件,并更新指定的Android Gradle插件的版本。 If you see buildscript --> dependencies blocks, update them to version 1.0.0 of the Android Gradle plugin like so: 如果看到buildscript > dependencies块,则将其更新为Android Gradle插件的1.0.0版本,如下所示:

buildscript {
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'
    }
}

I think there may be a bug where if you have the wrong version of the plugin, it gives you a bogus error about having the wrong version of Gradle, and you get ping-ponging error messages when you change it back and forth because it's not fixing the root cause of the error, which is this different version number. 我认为可能存在一个错误,即如果您使用了错误的插件版本,它会为您提供有关错误版本的Gradle的虚假错误,并且当您来回更改它时,您会收到类似错误的消息,因为它不是修复错误的根本原因,这是不同的版本号。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM