导入InteliJ项目到Android工作室
问题描述:
我不得不在Intelij 12.1.4编译的罚款项目,但我想用,因为XML编辑器的机器人工作室。我的问题是这样的,当我试图将项目导入到Android的工作室1.0 RC 4的第一个错误我得到的是:“你必须使用Android摇篮插件的更新版本支持的最低版本为0.14.0”导入InteliJ项目到Android工作室
我原来的build.gradle文件包含:
dependencies {
classpath 'com.android.tools.build:gradle:0.5+'
}
现在只是将其更改为阅读:
dependencies {
classpath 'com.android.tools.build:gradle:0.14.0'
}
导致此错误:
Error:(17, 0) Could not find property 'files' on org.gradle.api.interna[email protected]2e93ad.
点
什么尝试任何建议?我的整个Build.gradle文件低于
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.14.0'
}
}
apply plugin: 'android'
dependencies {
compile files('libs/android-support-v4.jar')
compile files('libs/android-support-v7.jar')
//compile files('libs/GoogleAdMobAds.jar')
compile files('libs/libGoogleAnalyticsV2')
compile files('libs/google-play-services.jar')
compile files 'com.android.support:appcompat-v7:+'
compile files 'com.google.android.gms:play-services:4.0.30'
compile files('libs/amazon-ads-5.4.46.jar')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 16
}
}
答
此错误消息是因为您的两个依赖性语句无效。
compile files 'com.android.support:appcompat-v7:+'
compile files 'com.google.android.gms:play-services:4.0.30'
应该是:
compile 'com.android.support:appcompat-v7:+'
compile 'com.google.android.gms:play-services:4.0.30'
不过,我会强烈建议您返工支持和谷歌图书馆的其他依赖。最好的做法是不要将这些文件作为jar文件包含进来,而应该像通过appcompat和Play Services库一样通过Maven坐标访问它们。 (事实上,因为你已经包含了这里展示的Play服务库,所以你不需要包含它的jar)。
如果您删除这些依赖性语句并转至项目结构>(您的模块)>依赖项> +>库依赖项它应该可以帮助您。
另外,使用+
符号的程序兼容性依赖性应劝阻;如果库更新在您的下面,它可能会导致意外的构建损坏。 “项目结构”对话框可以帮助您提供此依赖项的显式版本号。