java - Migration from Eclipse to Android Studio issues -


i trying move project eclipse android studio. have tries 2 methods:

  • importing current project using import in android studio ide.

  • exporting current project grade project

(although not have grade set in eclipse project) , importing android studio.

with first method got gradle , api errors such us:

no versions available com.android.support:support-v4:jar (i installed 22 , 23 sdk, none of them fixed issue).

error:(15, 0) gradle dsl method not found: 'android()' possible causes: project may using version of gradle not contain method. gradle settings.the build file may missing gradle plugin. apply gradle plugin

with second method in project explorer see java src file without res folders.

here gradle code:

buildscript {     repositories {         jcenter()     }     dependencies {         classpath 'com.android.tools.build:gradle:0.12.+'     } } apply plugin: 'com.android.application'  dependencies {     compile filetree(include: '*.jar', dir: 'libs') }  android {     compilesdkversion 23     buildtoolsversion '23.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 tests tests/java, tests/res, etc...         instrumenttest.setroot('tests')          // move build types build-types/<type>         // instance, build-types/debug/java, build-types/debug/androidmanifest.xml, ...         // moves them out of them default location under src/<type>/...         // conflict src/ being used main source set.         // adding new build types or product flavors should accompanied         // similar customization.         debug.setroot('build-types/debug')         release.setroot('build-types/release')     }     compileoptions {         sourcecompatibility javaversion.version_1_7         targetcompatibility javaversion.version_1_7     } } 

what correct way go? doing in order add gradle project.

thank you!

you go first way , change android support version.

step: go open module setting remove old dependency. , select below support file sync project.

version 23: support-v4 (com.android.support:support-v4:23.0.1)


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -