写一下省的又忘记了~~~
1、eclipse 导出sdk为studio所用
2、删除studio无用文件 /bin, /gen等~~~
3、替换fastjson为最新版本~~~~不知道为什么~~~eclipse ok~~~studio出错~~~
4、修改build.gradle 修改buildscript,sourceSets等, 示例
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0+'
}
}
apply plugin: 'android-library'
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile 'com.android.support:support-v4:21.0.3'
compile files('libs/baseproject.jar')
compile files('libs/mAppTracker.jar')
compile files('libs/playerBase.jar')
compile files('libs/tracking.jar')
compile files('libs/YoukuAnalytics.jar')
compile files('libs/fastjson-1.2.4.jar')
}
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
// 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')
}
}
5、删除AndroidManifest没必要的文件
6、哦,三个9.png文件在studio会出错,需要替换, 具体错误编译的时候可以看到
6、其余按文档做基本ok了~~