Migrate to Gradle, but Gradle information is given in project - java

I am having trouble with Android Studio. I forked the project here:
https://www.google.com/url?q=https://github.com/ubclaunchpad/Android-Calculator&sa=D&ust=1514703967854000&usg=AFQjCNHLwSAZ_JER6VlZ8LP6AtTzfUVBog
and cloned it in Android Studio, but it keeps telling me that I should Migrate to Gradle. However, if you look at the project files on github, there are a lot of gradle related files, so clearly the project does use gradle. How do I fix this? Is there a simple solution?

it works fine with me ensure that you open Calculator folder as a project, not Android-Calculator-master
check this photo
open calculator folder

Related

Downloading a libgdx Project Gradle Problems

So my friends and I are making a game for Android and we are using Android studio. We are using libgdx. We are also learning how to use github. Anyways, using Android Studio, I uploaded the basic libgdx setup. The one that just displays the Bad Logic image. My friend downloads it from github using Android studio but there are errors everywhere. It says that it can't find the badlogic package and it gives the following error:
This project does not use the Gradle build system. We recommend that you migrate to using the Gradle build system.
I know that libgdx uses gradle. So what is the problem? Why can't we simply upload and then download a simple project?
Thanks!
Try to remove the .gradle directory and re-import the project or use the Setup App Installer from here to create a new gradle project.
Thanks for the help! I finally figured it out.
Basically, when I imported the project, I was just importing with existing project files. These are the steps I took to get it fixed.
Check out from Version Control using Android Studio and the welcome screen.
When asked to open, say NO.
Go to the folder that is associated with the repo.
Create a local.properties file there and in that file it should have
sdk.dir = /YOUR/PATH/TO/SDK/HERE
Then go back to Android Studio.
Click Import Project and select the folder that has it in there.
From then on, it should work forever as the .gitignore file that is generated by libgdx will ignore the local.properties file when pushed. I hope this helps someone!

GitHub and Android studio no gradle.build

So I created an Android studio project, then trough it I created a Git repository and published it.
Now I'm on a different computer trying to sync it all. So from the home of android studio I select "Check out project from Version Control" then Git, paste the github repo link and it imports the code, but no all.
When I open the imported project the Gradle Script is missing (tough it's not shown even in the GitHub repo), the manifest folder and to show the res folder i have to change the type under 1:project to "project".
If I open an activity xml file it won't give the option to switch between Design and Text. And it doens't recognise some component like "AppCompactActivity" in the java files.
Anyone knows what is happening and how to solve this?
Thanks
Probably you didn't commit all files. Also you should check that the IDE is the same on both computer, same gradle plugin, same Android Studio version and so on.
Check that your gradle exist on your github repo in remote

How to add Gradle to an existing project in Android Studio?

I have an existing project in Android Studio that I originally imported from Eclipse.
I haven't been using any specific build system to build my project other than the one provided by default with the Android Studio IDE (though the project was originally created with Eclipse.
I haven't been able to find a good tutorial of the steps. What's the recommended approach to add Gradle to this project?
Any help would be greatly appreciated.
Thanks!
I would recommend creating a new project in android studio as the folder structure used by gradle is different than the one used by eclipse. Then copy the files into their matching folder.
Here is a detailed description about the folder structure: https://developer.android.com/tools/projects/index.html

What steps do I need to take to convert my Eclipse Android project into a Gradle project?

I was wondering if it is an easy or worthwhile effort to convert my current Android project in Eclipse into a Gradle Project. Is there a generic build.gradle file I could start with that has common build tasks for Android? Would I just need to download a Gradle plugin for Eclipse or would I need to download Gradle by itself? Are there available tasks to run the project on a connected device like the Eclipse Android plugin can already do? Any input is appreciated.
Any project with build.gradle is Gradle project.
You can add build.gradle via File -> Export -> Android / Generate Gradle build file
or use build.gradle template for classic Android project check
gh.c/N/n-1/b/m/o.n.e.e.g/docs/android/build.gradle.
see http://www.nodeclipse.org/projects/gradle/ for info about Gradle support in Eclipse
Are there available tasks to run the project on a connected device like the Eclipse Android plugin can already do?
there is android-command plugin referenced in template.
Be aware that all Android-Gradle related is currently beta, including Android Studio.
I recommend to read docs well
http://tools.android.com/tech-docs/new-build-system
http://www.gradle.org/
I don't know of any standalone Gradle tools, but if you install Android Studios, and import your eclipse project, it elegantly converts it to Gradle for you. This is what I did.
If your target IDE is android studio.I use android studio 0.8.9 and from experience when I am moving my eclipse projects I simply go over to android studio,under the file menu and import the eclipse project.Android studio uses the latest version of the gradle plugin to do the job of proper conversion.Note:Make sure your gradle plugin option is turned on to work online.

How do I add this Change Log library to my current Android project in Eclipse?

Okay, so I'm having difficulties implementing this Change log library into my android app in eclipse: https://github.com/gabrielemariotti/changeloglib
I tried using the clone url and importing the library into eclipse and then going into the properties of my android project and adding it as a library but that didn't work. I do not have Maven installed nor do I know anything about it. Is there a way I can just get a jar of this library somewhere? Can someone please help me? Thank you!
Its most likely not setup as an Android Library project and that is why it can't be accessed that way.
You can create the jar yourself though by using: https://stackoverflow.com/a/11289115/1784299 eclipse itself or running the jar command in a terminal. (Eclipse might be a little more user friendly if you don't use the terminal.
I would however highly recommend learning how to incorporate Maven in your projects because it is a huge time saver. If you migrate to Android Studio then Maven will become your best friend.
I answer here to help other devs with the same issue.
The library is built with the Android Studio folder structure.
I highly recommend to use the gradle build system to work.
Hovewer, you can build it locally with Eclipse.
All required steps are described here:
https://github.com/gabrielemariotti/changeloglib/blob/master/doc/BUILD.md#reference-this-project-as-a-library-in-eclipse.
It can be valid for a lot of libraries.
Eclipse uses src and res as source folders. Android Studio instead uses src/main/java and src/main/res as source folders.
So you have to mark the java folder as source (right click on folder -> Build-Path -> use as source folder)

Categories