简体   繁体   English

Android Studio,将Gradle项目迁移到1.0版

[英]Android studio, migrating gradle project to version 1.0

I want to migrate gradle project in Android Studio to version 1.0. 我想将Android Studio中的gradle项目迁移到1.0版。 I have the next problem: 我有下一个问题:

Warning:Project app: Only Jar-type local dependencies are supported. Cannot handle: /home/jaume/android-studio-0.8.14/projects/Rutacomandero/app/libs/google-gson-1.7.1-release.zip

Assuming "google-gson-1.7.1-release.zip" is just the gson dependency, then include it in your dependencies section of your build.gradle file, like so: 假设“ google-gson-1.7.1-release.zip”只是gson依赖项,然后将其包含在build.gradle文件的“ dependencies部分中,如下所示:

compile 'com.google.code.gson:gson:1.7.1'

You should be depending on jar files, not zips, and in the case of gson, grab it from central rather than keeping a copy in libs. 您应该依靠的是jar文件,而不是zip;对于gson,请从中央获取而不是将副本保存在libs中。

Also, 1.7.1 is old, since you're upgrading anyway, try 2.3.1 另外,1.7.1很旧,因为您仍然要升级,请尝试2.3.1

Had the same problem and I was able to resolve it by adding 遇到同样的问题,我可以通过添加解决

repositories {
    mavenCentral()
}

so use: 因此使用:

repositories {
    mavenCentral()
}

dependencies {
    compile 'com.google.code.gson:gson:2.5' 
}

I exampled version 2.5 but you should check for updates. 我以版本2.5为例,但您应该检查更新。 see https://github.com/google/gson/releases 参见https://github.com/google/gson/releases

My answer was found at http://www.javacodegeeks.com/2013/08/getting-started-with-google-gson.html 我的答案位于http://www.javacodegeeks.com/2013/08/getting-started-with-google-gson.html

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

相关问题 使用AndroidAnnotations从Android Studio 0.8到1.0版本迁移android应用程序项目 - Migrating android application project using AndroidAnnotations from Android Studio 0.8 to 1.0 version 将项目升级到Android Studio 1.0(Gradle问题) - Upgrading project to Android Studio 1.0 (Gradle problems) 将LibGdx项目生成到Android Studio版本1.0中? - Generating a LibGdx project into android studio version 1.0? 使用较新版本的Android Gradle Android Studio 1.0 - Use newer version of Android Gradle Android Studio 1.0 使用gradle插件0。*。*在Android Studio 1.0+中打开项目 - Open project in Android Studio 1.0+ using gradle plugin 0.*.* android studio 项目迁移到 gradle 构建系统警告 - android studio project migrating to gradle build system warning Android Studio项目的Gradle版本不正确 - Incorrect Gradle version for Android Studio project Android Studio Gradle问题升级到版本0.5.0-Gradle从0.8迁移到0.9-Android Studio也升级到0.8.1 - Android Studio Gradle issue upgrading to version 0.5.0 - Gradle Migrating From 0.8 to 0.9 - Also Android Studio upgrade to 0.8.1 在Android Studio 1.0中导入项目 - Import project in android studio 1.0 使用 android studio 1.0 创建了一个项目,它不会在新版本的 android studio 上工作 - Created a project using android studio 1.0 and it wont work on the new version of android studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM