Generate Gradle Build files complains about missing dependencies - android

I am trying to import this Android Backend Starter Client project into Android Studio.
It's an Eclipse project which means that to import it into Android Studio it needs to be exported from Eclipse with the Generate Gradle Build files option.
The project has as dependency Google Play services. I have imported the Google Play Sevices source code from the SDK as another Eclipse project.
The issue is that when I try to export the main project, Eclipse complains that it cannot find the Google Play Services project, even though the project is open in Eclipse. See the image below.
I have to mention that both of the projects are compiling and that I am using the Windows version of Eclipse.

I managed to export the project from eclipse. The issue was that the google-play-services_lib project was not located in the same workspace as the solutions-mbsac project. Once I moved it to the same workspace the export worked.
To import it into Android Studio I still had to modify the generated gradle.build files a bit and to update to the latest gradle.
The Eclipse export generates paths for the source files, but it generates them with \. This causes the import into Android Studio to fail. The \ need to be replaced with /.
To update to the latest gradle I just replaced the dependencies in the gradle.build file and replaced the gradle-wrapper files with other files generated by Android Studio.
After making all these changes the project imported successfully into Android Studio.

Related

How do I import gdax-Java into my android studio app

I downloaded the git hub for gdax-java to my MacBook.
I don’t see any .jar file or a .aar file to import into my android studio app
There is no gradle dependency listed in the repository
How do I use this api in my android studio app?
I even tried ./gradlew jar and I get this error
Could not target platform: 'Java SE 11' using tool chain: 'JDK 8 (1.8)'.
Why is this so difficult to implement?
Here is what I had to do. https://dzone.com/articles/installing-openjdk-11-on-macos
Then the steps of ./gradlew build and ./gradlew jar worked and I could add the jar to the libs folder following these steps. How to add a jar in External Libraries in android studio
It would be nice if the ./gradlew steps would be indicated in the github

Migrate Eclipse app and libs to Android Studio

I have an Android app project in eclipse that references to 3 libs+ some jar files and I would like to migrate all to Android studio.
First, I export "generate Gradle build files" (app) and succeed import in Android Studio.
I tried to create root folder manualy but the Imports in the App "cannot resolve symbol .."
How do I migrate the rest libs and jars and implement them?
If you want to move the rest of your libs and jars to Android studio, you can do it in three different ways. Please read this link https://stackoverflow.com/a/35369267/5475941. In this post I explained how to import your JAR files in Android studio and I explained all possible ways step by step with screenshots. I hope it helps.
No need to export your project in android studio manage itself ,
open android studio and select import project (eclipse adt etc)
browse to your project root directory and pick your main project not
library or dependent project .
start wizard to import and wait to complete gradle build.

Importing and converting Eclipse-made Android project from Github to Android Studio Gradle-build

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.

"Gradle location is incorrect" when migrating android project from eclipse to android studio

I followed the this guide to migrate my android project
https://developer.android.com/sdk/installing/migrate.html
I have exported a Gradle file through eclipse. When I try to import the project to android studio, I am stucked with this error. Please help
Android studio version 0.6.1
That's not asking for your project's Gradle structured files it wants the location of your Gradle Build tools or Gradle configuration file.
It defaults as a file called .gradle in your user home directory I think.
Mine points to:
/home/indiv/.gradle
Although, I found it easier to import my Eclipse projects into Studio (as Eclipse projects) than export a Gradle project from Eclipse and then import to Studio.
Your choice though.

Migrating Android apps from Eclipse to Android Studio with multiple user-created libraries and dependencies

How can you migrate to Android Studio using an Eclipse project depending one many user libraries?
I've tried using the Eclipse export to gradle but I can't seem to get it to work.
Also, my project sources are not in the workspace.
As of Android Studio 0.4.2, you can now import the Eclipse project from Android Studio.
Note: This is different from Eclipse's export Gradle project function.
Open Android Studio
Verify the version is >0.4.2, if not update to it. (I had to download it from the tools website)
Import Project...
Navigate to the actual Android app project, the highest level project (not the workspace or the directory containing all the eclipse projects)
Follow the wizard to import it all
The advantages of doing it this was is that :
makes the migration less painful
generates gradle files
restructures your project as a gradle/Android Studio project

Categories

Resources