Migrating from eclipse ADT to Android Studio - android

I have Updated my sdk and all things gone wrong
my Appcompat v7 and play services libraries are giving errors without any reason.
I cannot build my project to gradle
is there any easiest way to move my project to android studio without gradle project?

I dont think you need to worry about gradle.
Install any extra libs, sdks that you want.
Download/install AS 1.0.1 to somewhere in fileSys where you have RW privledges, and then get used to AS by just clone a git project like this
go to AS and follow "import non AS project" giving the folder of where you cloned the git proj.
Gradle builds on this cloned and imported project should just work ..... no gradle knowledge reqd.
then go back to your Appcompat V7 guy with the issues and try to import it as non AS .. the IDE will make a copy of the orig proj. and it should sync and build OK. Gradle wrapper stuff will be handled as part of the import process so you dont have to immediately know all kinds of gradle build trivia.
In long run , if u do android , you're going to need to pick up gradle. this

Related

Android Studio 0.4.3 Eclipse project without gradle

Prior to this version it seemed easy to open an eclipse project as-is in Android Studio without any conversion. I prefer the Android Studio environment, but am working on a project that uses eclipse as the main IDE. I'd rather not have to download the eclipse bundle just for this one project.
Is there any way to open an eclipse project as-is, without conversion to the gradle build system, in Android Studio 0.4.3?
EDIT:
It appears that if you use Android Studio's download from source control feature, it'll let you open the project that way. But what if I already have the source downloaded? I don't want to remove it just to redownload it again. It seems like this option has disappeared from the main 'import' wizard.
We're strongly encouraging users to move toward the Gradle build system, and we're in the slow process of making that the only way to create new projects in Android Studio -- you're seeing this now on importing Eclipse-based projects. We'd like to replace all other build systems in use with Gradle, including Ant and the Eclipse internal builder, though the latter two are farther out on the roadmap.
If your ultimate goal is to move to Android Studio, then you might want to reconsider and just set up a Gradle build file. You don't have to adopt the Gradle-style multimodule project structure (which the current Eclipse importer imposes upon you by making a copy of your project); you can rework your build.gradle file to use the Eclipse-structured project in-place. You can get a good start on this if from Eclipse you use the feature to export your project to Gradle build files. It will set up the project in that fashion, though that feature in ADT is a little out of date and you'll need to update the version of the Android Gradle plugin in the build file and the Gradle version in the wrapper that it outputs.
I think this may actually solve your problem. IntelliJ or Android Studio have never been able to use the Eclipse project directly -- they've always imported the Eclipse project and converted to an IntelliJ-style project, and if you later change the Eclipse project, you'll need to re-import into IntellilJ-land. I'm guessing your real desire is to use the Eclipse project in Android Studio without having it make a copy and converting into its preferred directory structure. (By the way, we'll eventually improve Eclipse-to-Gradle import to lift this restriction).
Once you have the Gradle build file in place, you can use it when working with the project in Android Studio, and you'll still have the Eclipse project files when working with it in Eclipse. The big drawback is that you'll have to keep them in sync as you change dependencies and project structure, but hopefully that doesn't happen too often. Even if you weren't using Gradle, you'd still need to keep both projects in sync anyway, so Gradle isn't costing you anything there.
Having said all that, it doesn't directly answer your question, which is how to use the your project without Gradle.
Once you have an IntelliJ-built project, you can open it in Android Studio and use it normally without migrating to Gradle (though I think it does show you a popup when opening the project recommending you do so; you can ignore that). What you need to do is to get that initial IntelliJ project, and once you have it, check all the .iml files into source control -- those .iml files contain all the project information. To get those files, you'll need to import the Eclipse project either in IntelliJ CE, or in Android Studio prior to 0.4.0. Then you'll have your .iml files -- hang on to them.
I'll point out that if you're using Gradle as your build system, we recommend that you don't check those .iml files into source control. There, the build.gradle files are the source of truth for project structure; the fact that Android Studio creates .iml files at all is an implementation detail that reflects that internally Android Studio is still treating this project as an import instead of deriving structure from the Gradle files directly (and we resynchronize state when we know we need to). But saving those .iml files into source control or modifying them directly will lead to confusion or loss of any changes you make there when it resynchronizes.
I think you should give a try to Intellij Idea with ADT Plugin instead of Android Studio, if such requirements are there. Intellij IDEA will support both type of Android projects.
What If I want to move to Android Studio completely sometime?
There is nothing new in Android Studio it is just an IDE based on Intellij IDEA. You can easily switch between Intellij IDE and AS anytime. The only thing is to learn in AS is the new gradle build system. IDE related most of the features are there in Intellij IDE as well.
If you want to move Android Studio start using gradle Build System. That is only the main power of new Tools.
As per your question you don't wanna move your project in gradle then you can have both IDE together like Intellij IDEA at place of Eclipse and Android Studio as well. Msot of the Developer including me having Eclipse along with Android Studio.
EDIT :
I found a workaround to import Eclipse project in Android Studio but I will not recommend you to do this
Look at my answer here
Not Use Gradle In Android Studio

Exporting an eclipse project as gradle

I have been trying to export my eclipse project as a gradle build file to use it with Android Studio but I can't seem to make it work correctly.
When I click "Finish" nothing happens. If I repeatedly click it, I can see a progress bar that shows for a millisecond and then vanishes.
My ADT is version 22.3 (which is the latest) and I have tried all of the solutions I found on google as well.
Similar questions can be found here:
Eclipse Gradle export of Android project does nothing
Cannot generate gradle.build files from Eclipse
As you can see, there is not really a solid solution for this problem, but people wrote they created it manually. I don't know how to do so though.
Is there any solution for this problem that I haven't heard of? If not, how can I create the file manually?
Apparently, the current edition of the export-to-Gradle support in Eclipse cannot handle a project that is attached to an Android library project. In that case, you would need to (temporarily) detach the Android library project, export the main project, then modify build.gradle to use the library project (manually or via Android Studio).
Generating build.gradle files FIRST FOR ALL of the projects in my dependencies ONE AFTER ANOTHER worked for me.
I generated build.gradle (with export wizrd for facebook, play and whatever other projects I imported and used in my project).
For not trivial Android project you should do it manually.
For the latest build.gradle template for classic Android project check gh.c/N/n-1/b/m/o.n.e.e.g/docs/android/build.gradle.
You can continue to develop in Eclipse with ADT and run Gradle build using Nodeclipse/Enide Gradle for Eclipse
(marketplace)
Some screenshots for Gradle for Eclipse:

Eclipse Gradle export of Android project does nothing

I'm trying to export my Android project from Eclipse (ADT 22.2.1) using the Gradle plugin.
I select my project in the initial Gradle dialog, click next
My project appears along with Android dependencies.
When I click on Finish, I can barely see a message "Creating Gradle Build files" BUT I never get a confirmation of Success. And build.gradle or settings.gradle ARE NOT in my projects root directory.
I can select each of the dependency libraries and they complete successfully
Any suggestions?
jb
I faced the same problem, my solution was install the lastest Eclipse from their page, (i was using Juno, now with Kepler didn't have that problem), and Android ADT plugin link. Seems that they have breaked compatibility with older eclipse version in newer ADTs
An ankward one, but...at least it works
You can try it "the hard way", creating required files (build.gradle, gradle wrapper et al) by hand, but you will got a lot of mistakes, didn't worth the time spent.
EDIT : Extracted from Android Tools Tech Docs : Open the project in Eclipse, and from there, export the project. NOTE: Make sure you are using the latest possible version of Eclipse since we have fixed issues related to export recently.

Updating to Android SDK Tools R22

I updated the SDK Tools to R22 and the ADT Plugin as well. Everything worked well before the update but since then, I have problems.
Basically I have 2 library projects and an app project. One of my library projects contains some jar files in the "libs" folder. One of these jars is used in the app project itself for some initial setup. Before the update, everything worked fine, but now it asks me to add the jar to the build path and even if I do so, when running the app it still gives me ClassNotFoundException.
Did anyone had some similar experience or has any idea about what causes this and how can it be fixed?
Thanks.
Check this Android Sdk tools Revision 22 issue?. "I found that I needed to check all of the boxes in the order/export tab of the Java Build Path for the project - and each library -- to properly compile and run the app on a device." - should helps.
The workaround here worked for me
OK. I also had a Simillar kind of Problem.
Like say If you have library project as google-play-services_lib before updating than might happen that your library code has been also updated after updating your SDK.
You Should Remove that library project from your Workspace and Import
again from the source
folder like in my case i had to import from /android-sdk-linux/extras/google/google_play_services/libproject/google-play-services_lib. Add reference of
your library path to you android app project. clean and build your Project.
Hope this Helps.
you should try to upgrade eclipse.
1) Get the new imports via the Android SDK Manager
2) Check for updates in the Eclipse repository: help/check for updates
That would "for real" upgrade the SDK version in your configs.
Dunno if the other steps pointed by VShcryabets are needed, i had them before.

Android ActionBarSherlock on NetBeans - working but editor showing errors

I'm using NetBeans for android application. I installed properly (I think) ActionBarSherlock package as android library project. Everything works fine, I can build and run application, but code editor doesn't recognize ABS classes (just look at screenshot, BUILD SUCCESSFUL but errors exists) and code completion doesn't work too.
My configuration:
Stable NetBeans 7.2 with android plugin ver. 1.13
Linux Mint 13 Maya 64 bit, Mate
ActionBarSherlock ver 4.2 (stable)
How I installed ABS:
Download and extract source
From sdk/tools run command:
./android update project -p path_to_ActionBarSherlock/library/
Similar command to connect android project library with my test project (there is similar option in Netbeans IDE but I get error that this is not android library project)
./android update project -l path_to_ActionBarSherlock/library/ -p path_to_my_test_project
I have tried clean and build on both projects but no results. Any idea?
Regards
The way I finally managed to add ActionBarSherlock to my android project on Netbeans was to:
Download the latest version of ActionBarSherlock and unzip it
Go to the subfolder called library and remove the pom.xml file from there (with one of the previous versions it didn't work. I had to first build it, close it and remove not only pom.xml but also some netbeans properties files)
Open that subproject (library) in the Netbeans
Now this project will no longer be seen as a maven project. Netbeans will see it as an Android project. Then I:
Clean&build it
Add it to my-project's library properties (right-click on my-project, properties, library, add, point the proper location of library project). Important here was to copy/move that library project somewhere near my-project. Otherwise it claimed that it cannot open it.
And from now on it works fine.
Key to that thinking was that Netbeans didn't want to add the provided library project cause it saw it as a Maven project. When the pom is deleted, Netbeans no longer sees it as Maven project nut as an Android project and it can without any objections add it as an Android's project library.
Probably there are better solutions, but I didn't find any and that was the only one working for me.
Hope it helps.
You can also make a new Android project, and then copy and paste the needed files in the new project.
So only copy:
libs, res, src, AndroidManifest.xml

Categories

Resources