I was trying to pull a GitHub project into Android Studio and it get struck while proceeding through import project from gradle with default settings and takes infinite time to load.
Here are a re few things to try:
There are several settings you can change in the AndroidStudio repo import function. Try changing the settings on the gradle import.
If you can't get the Android Studio import to work, try using another way to pull your project. You can use the command line or SourceTree. Once you have made a local copy, you can open the project with Android Studio. That has worked for me in the past.
Related
I am using eclipse for developing android applications.Its works good and I can debug and run the application.But now I installed android studio and move to creating new apps using android studio,But i get the following error
Gradle sync failed
What is gradle and how can i fix this problem, Now also I can't import my eclipse project to android studio
I had the same issue when importing my project from eclipse to android studio. I'll tell you how I fixed it. It's simple.
- Solution 1: It is possible to import your project from eclipse to android studio, but android studio version 1.2 currently has bugs with that. What I did is I created a new application with the same app name, same package name, same minimum api and all these things... Then normally, go to your app's folder that you want to import it from eclipse, and copy it's src folder and java folder, maybe asset and libs folder too if you have them, and paste it to your newly created project in android studio by going to that folder: "Users/AndroidStudioProjects/appname/".
If that's not your issue, try the other following solutions:
- Solution 2: Add this to your gradle.properties file in the project. This will just increase your android studio's memory:
org.gradle.jvmargs=-Xmx512m -XX:MaxPermSize=512m
You can also replace 512 to 1024 if you have enough memory in your pc.
- Solution 3: Try to close all your pc apps that consume large memory, and try that: In android studio, there is a toolbar at the top, where there is "Build" tab. Select Clean Project then Rebuild Project. Then try to sync your project again.
If you find the File Encoding Error is showed in your log when trying to sync your gradle, click on it and change the project formatting to UTF-8.
Source: https://stackoverflow.com/a/30498383/4843993
I would prefer to start solution 2 then 3 first before trying solution 1. If you still face the same issue, tell me. :)
I try to import my cordova ionic project to eclipse as an existing android application but it was undetectable? Any idea why? I could run my app in android phnoe using 'ionic run android' but why it can be imported to eclipse?
I also installed android studio and it has the same problem. I don't have a clue why is this happens..
Remove all CordovaLib that exists inside eclipse and import it again. It works 100% most of the time. Second time you import the project you will enable import your project with CordovaLib. It happens because there are existing CordovaLib inside your eclipse.
You have to choose the platforms/android folder when you want to import in eclipse, not the root of your project.
Eclipse only knows the android project, but not the cordova project.
And then select both your app and the CordovaLib projects.
But be aware that changes made in /www will only take effect in eclipse after you rebuid the project.
Or you can use eclipse project properties to unhide assets/www an in that case be aware that any changes in assets/www will be lost if you use the cli to build your project (and the same goes for any change in platform/android).
That's why I only use eclipse when I need to debug (mostly for plugins).
I faced a very same issue,
Please make sure - you are importing the project using already existing android code under the Android tab in import option. Not with already existing project option in general. This one fixed my issue,
Hopes this one will help some to save some valuable time ...
I'm trying to migrate from using Eclipse for my Android-project to the new Android Studio, and I'm having an issue related to Gradle.
What I want is for me to push the latest Eclipse-build to Github, and then be able to pull it down in Android Studio, having the latter automatically convert the project to a Gradle-build. If I'm reading the documentation right, the Android Studio import is supposedly able to do this.
When importing, I can choose between "Create project from exisiting sources" or "Import project from external model"
If I choose the first option, the project won't use Gradle (as far as I can see). If I choose the second, it seems to be looking for an already existing gradle buildfile "build.gradle" in my project.
So - Should I download a Gradle-plugin to Eclipse and make a gradle build-file there, or am I doing something wrong in the import?
It seems the only other questions I can find on SO is about importing and Eclipse export or simply how to pull a project from Github in Android Studio.
Thanks :-)
Importing and converting an existing Eclipse project into a Android Studio Gradle project is quite simple :
File -> Import Project (in Android Studio)
Select the manifest of your Eclipse Android project.
Done.
There may be some dependacy management to deal with.
You can also take a look here :
How do you import an Eclipse project into Android Studio now?
How about this:
clone repo to location 1
export from eclipse
import to android studio in location 2
copy the .hg files or whatever's applicable from 1 to 2
commit from location 2 including deleting eclipse files
Now the repo will have the android studio project and not eclipse.
I have been using Android Studio since one of the first releases (about one year ago, since I/O 2013)
However I have recently noticed that in the first screen when lets you to create a project there are also Open and Import project options, and I cant find any difference between them
I remember that in Eclipse, import project would make a copy of the project in the workspace... However, in Android Studio there is no workspace as far as I know...
So, what are the differences between Import project and Open project?
I think there is no much difference if you are working with gradle project. Since Android Studio tries to sync project every time when project is opened.
However there is difference if you try to import Eclipse project folder. In this case it will migrate it to gradle project structure.
Watch this new IO video talk to get more about tools https://www.youtube.com/watch?v=hu4U8XKmJGA
I have downloaded Phonegap from CLI (working on windows7) and made a project from command line
phonegap create hello com.example.hello HelloWorld
and built it
phonegap build android
When i import project (project/platforms/android) in Intelijj and try to build it, it gives me this error
java: duplicate class: org.apache.cordova.BuildConfig
Any advice?
The steps that I did to import project in IntelliJ, after I built the application with "cordova build":
Import project
select "PROJECT_FOLDER/platforms"
Import project from external model "Eclipse"
In select Eclipse project, select all.
Import JDK and SDK (JDK 1.7 and SDK Android API 17 and 19 in my case)
Import Android Dependencies From Property Files (Add dependency helloworls --> helloworld-cordovaLib) OK.
At last this build and run without problem to me.
There are an issue with IntelliJ and Maven, maybe you can apply the same solution.
http://youtrack.jetbrains.com/issue/IDEA-94901
1.) Delete the "gen", "target" and "out" folders
2.) Revert the changes within the "ipr" and "iml" files
3.) Start IntelliJ 11.1.5 EAP / 12 EAP
4.) Open the pom file
5.) Right click -> "Maven" -> "Reimport"
6.) "Build" -> "Rebuild project"
A better workaround (tl;dr): Don't do the 'cordova build' step from the Cordova workflow (Getting Started Guide for Android)
We ran into this issue while doing Cordova training for our students. The recommended tool from developer.android.com switched from the Eclipse ADT Bundle to Android Studio, so we made the switch.
Unfortunately, you can't follow the same workflow. The Cordova 'Getting Started' guide for the Android platform spells out the commands to execute from the command line. But, they are for the Eclipse platform. One step needs to omitted for it to work with Android Studio.
One of the links above (http://www.tricedesigns.com/2013/05/16/phonegap-android-studio/) shows the correct workflow, but if you're used to the Cordova workflow, you may just assume it's the same and complete the steps in the same way. However! Omit the 'cordova build' step. Building the project (instead of letting Android Studio build it) causes Android Studio to get the error from the question.
The accepted answer above didn't work for us, because when we attempt to import the project, there is no 'Import project from external model "Eclipse"' option. This, however, worked just fine. Hope this saves you the hours we spent looking for answers/troubleshooting.