Downloading a libgdx Project Gradle Problems - java

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!

Related

Migrate to Gradle, but Gradle information is given in project

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

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

How to add exisiting java source project to Android Studio

I have an existing git repository of pure Java code that I would like to add to my Android project.
I don't want to change any of the existing files. I want to keep my existing package names to simplify the maintenance of my legacy code.
In Eclipse, you can simply add the root of the existing project to your Java Build Path.
How to do the same in Android Studio?
I'm not sure this will help or not. But you may check these.
https://developer.android.com/sdk/installing/migrate.html
Unable to import Eclipse project to Android Studio
How to import eclipse project from git to Android Studio?
My solution to this was to Export my Java project to a JAR.
And then, I added the JAR to the Android Studio project.
File > Project Structure leads to this window:
That way, I could use my files untouched as such.
I am not so happy with this solution because it breaks my revision control system.

How can I modify the DroidGap.class file from phonegap-1.0.0.jar archive in eclipse?

I am really very new on android development.
I have made 2-3 apps , those running on my android device already.
Last few days I am facing a stupid problem.
The problem is , creating the app fullscreen for every device. I have read phone gaps wiki
and tried with specific way. But I failed everytime.
When I'm trying to open the DroidGap.class from my Android eclipse project explorer , I got a error. that, "DroidGap.class has no source attached". (after build the phonegap.jar)
Please help me....
first you need to add phonegap.jar to your project
you need to add phone gap plugin to your eclipse
Use the AppLaud Eclipse Plugin for PhoneGap Android
Download and unzip the PhoneGap sources from GitHub
In the AppLaud wizard, select "Enter path to installed PhoneGap"
Enter the directory path to the unzipped sources from GitHub
Now you will be able to modify and debug the sources that comprise phonegap.jar
Caveat: I'm the creator of the AppLaud Plugin
fullscreen?
If you want modify DroidGap.class dowload source code from github and rebuild phonegap.
Rebulid instruction here: https://github.com/callback/callback-android/blob/master/README.md

Categories