6

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.

António Ribeiro
  • 4,129
  • 5
  • 32
  • 49
Carlos Calvo
  • 61
  • 1
  • 1
  • 3

3 Answers3

2

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

Community
  • 1
  • 1
1

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

Víctor
  • 3,029
  • 3
  • 28
  • 43
0

- In Android Studio

  • Choose File->Settings
  • Navigate to Plugins Tab
  • Choose Install JetBrains Plugins
  • Search for Phonegap/Cordova Plugin
  • Click On Install the Plugin
  • And Restart Android Studio

- Open IONIC Project in any editor

Run this Command

  • ionic cordova prepare android
  • It will Prepares the Ionic Project for Android

Then run this command -

  • ionic cordova build android
  • It will Builds the Ionic Project for Android.

3.Open Android Studio

Choose File > New Project > Import Project > Choose the android folder of cordova directory > ok

  1. Run the project with Android studio.
  • I have tried this and I keep getting this error: `ERROR: No installed build tools found. Install the Android build tools version 19.1.0 or higher.` I have already installed version 29.0.3 of Android SDK Build Tools – EnigmaTech Feb 10 '20 at 12:08