I'm trying to migrate my Eclipse ADT project to Android Studio and it's not working.
Here is the thing:
- My project include android support v4 and v7, and play services and other .jars
What do I use:
- ADT 22.0.1
- Android Studio 0.3.6
What have I done:
- Set my ANDROID_HOME var to my android sdk path
- Exported ADT project to Gradle (as explained on Android website)
- Replace some parameters, like absolute path to relative path (see below in gradles)
- Some Stack Overflow answers tricks (but not useful for now)
Here are the Gradle specs:
settings.gradle
include ':Project'
gradle\wrapper\gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-all.zip
Project\build.gradle
buildscript { repositories { mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:0.6.+' } } apply plugin: 'android' dependencies { compile 'com.android.support:support-v4:18.0.0' compile 'com.android.support:appcompat-v7:18.0.+' compile 'com.google.android.gms:play-services:3.1.36' compile fileTree(dir: 'libs', include: '*.jar') } android { compileSdkVersion 17 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'] } instrumentTest.setRoot('tests') } }
Now when I (try to) import the project in Android Studio, I got an error message:
Could not execute build using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.8-all.zip'. Task 'wrapper' not found in project ':Project'.
What now ?:
How can I progress this further?
This is not a great solution, is not a clean one, but it worked for me: Create a new project from scratch and copy all the files do you need from eclipse to android studio. This was the way I did it and it worked. It is a pain in the ass to migrate from eclipse to android studio and vice-versa