我是Intellij的新用户,我想使用这个IDE来创建android项目。
之前我使用的是scala SDK for Linux,一切都很简单直观。
现在我跟随Jet Brains的Create a New Android Project。
我使用了为eclipse创建的android sdk。
但是当我创建卡住的项目时,它无法解析import语句:
我尝试在设置中配置但是没有成功:
如何正确配置此intellij设置(使用模拟器和已安装的版本)?
答案 0 :(得分:1)
请使用gradle构建文件来配置项目。较新的Intellij 13.0.2有文件>新项目> Gradle:Android模块
gradle wrapper
这应该适合你。
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')
}
}