Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

package org.apache.cordova does not exist android studio

I am using apache cordova to make an application, so I have done all the steps for build in terminal: 'cordova build android', it works perfectly. When I use 'cordova run android', it works again, opens the simulator and I can test the app. But when I want to build it with android studio, for making a signed apk, I have this error:

package org.apache.cordova does not exist

The error is coming from the folder src/fr.myapp.myapp/MainActivity: import org.apache.cordova.*;.

How can I add this package or fix the error?

Note that when I build on ios, I have no error and it works perfectly.

like image 266
Samuel Louart Avatar asked Jul 10 '26 05:07

Samuel Louart


1 Answers

You have imported only your applications. Not the library projects.

Steps to import Phonegap project :

  1. Import Project(Eclipse,ADT etc)

  2. Select your project from the directory(Do not select Android directory, select will the whole project, then only all the cordova libs will be imported enter image description here

Check whether you get this dialog(If not, not a prob)enter image description here

  1. If Yes, make sure you select all the libraries.enter image description here

For Step 2, if you didnt get the dialog, click next and open your project. In that File-> Import Module to import all the libraries again.

Guess I'm clear

like image 100
Mohammed Imran N Avatar answered Jul 13 '26 22:07

Mohammed Imran N



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!