[英]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.