[英]can't create android project at intellij
I'm newly user at Intellij, and I want to use this IDE for creating android project. 我是Intellij的新用户,我想使用此IDE创建android项目。
I used scala SDK for Linux before and all was easy and intuitively. 之前,我使用过用于Linux的scala SDK,并且一切都很简单直观。
Now I followed Create a New Android Project by Jet Brains. 现在,我跟随Jet Brains 创建Create a New Android Project 。
I used android sdk that was created for eclipse. 我使用了为Eclipse创建的android sdk。
But when I created stuck project it can't resolve import statement: 但是,当我创建卡住的项目时,它无法解析导入语句:
I tried configure at settings but it wasn't successfully: 我尝试在设置中进行配置,但未成功:
How to configure this intellij settings on right way (with emulators and installed version)? 如何正确配置intellij设置(使用模拟器和已安装的版本)?
Please use gradle build file to configure your project. 请使用gradle构建文件来配置您的项目。 The newer Intellij 13.0.2 has File > New Project > Gradle: Android Module
较新的Intellij 13.0.2具有“ 文件”>“新建项目”>“ Gradle:Android模块”
gradle wrapper
gradle wrapper
This should work for you. 这应该为您工作。
build.gradle file (customize the below text as per your requirement): build.gradle文件 (根据需要自定义以下文本):
apply plugin: 'android'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
android {
compileSdkVersion 19
buildToolsVersion "19.0.0"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.