Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import a Cordova ionic project into Android studio?

I'm trying to import an Cordova Ionic project in Android Studio to modify some things and try to solve some bugs but I can't.

I never work with Ionic before and I tried to follow some tutorials about how to import Ionic into Android but no one works for me.

In all of them you have to go to Android Studio > Import Project (Eclipse ADT, Gradle, etc.) and then select a folder called platform and then the Android Gradle.

But the thing is that in my project I only have this folders: hooks, css, www.

like image 806
Carlos Calvo Avatar asked Oct 18 '22 13:10

Carlos Calvo


2 Answers

My highlighters to the problem above are:

To open a Cordova for Android project in Android Studio:

Launch Android Studio.

Select Import Project (Eclipse ADT, Gradle, etc).

Select the Android platform directory in your project (/platforms/android).

For the Gradle Sync question you can simply answer Yes.

Once it finishes importing, you should be able to build and run the app directly from Android Studio. See Android Studio Overview and Building and Running from Android Studio for more details.

enter image description here

Refs:

https://cordova.apache.org/docs/en/latest/guide/platforms/android/

https://www.codeproject.com/articles/1068176/step-by-step-guide-to-build-ionic-hybrid-app-using

For the theory behind the bove logic and possible bunders you may make, please see my answer to the following question:

Building Ionic framework in android studio

like image 176
iOSAndroidWindowsMobileAppsDev Avatar answered Oct 21 '22 23:10

iOSAndroidWindowsMobileAppsDev


You dont have to import the Android Gradle. You have to previously do a

ionic platform add android
ionic build android

and then import your platforms/android folder

like image 45
Víctor Avatar answered Oct 21 '22 23:10

Víctor