I'm runing IntelliJ IDEA 13.1.2 on Ubuntu machine. I'm facing with a file generated wrong structure I think. Some one already asked about this problem(), but is not solved.
- :~/workspace$ phonegap create mobileApp1 ... done..
- :~/workspace$ cd mobileApp1/
- :~/workspace/mobileApp1$ phonegap build android
[phonegap] adding the Android platform...
Creating Cordova project for the Android platform:
Project successfully created.
BUILD SUCCESSFUL
Total time: 5 seconds
[phonegap] successfully compiled Android app
- Starting IntelliJ IDEA
- Import project > Select directory with existing sources
- > mobileApp1/platforms/android
on Build
Error:(4, 14) java: duplicate class: org.apache.cordova.BuildConfig
SOLUTION
I have no reputation to post more than 2 links =)) so I deleted original links ..
because seems nobody helped to give some solution ..
Edite later :
I find few tutorials and for me was a SOLUTION :
http://www.tricedesigns.com/2013/05/16/phonegap-android-studio/
Configuring project like Android from Existing sources and www like empty module (but select target folder from disk), and Adding to SDK some feature like Android 4.0.3 and 4.2.2, solved my problem .. In Project Settings > Facets > I have Android (CordovaLib) checked like Library module.
The problem is ... I use Ubuntu and Windows.. and there are some differences on the interface if IntelliJ IDEA.
so I can't provide step-by-step tutorial, but after few experiences with: phonegap create myFirstApp, phonegap platform add android, phonegap build android ..
and few new pject in IntelliJ..
you will see :D
Happy coding ;)
Hi, just to help:
The tutorial is still valid except that no special steps are
required anymore. To start a cordova project:
$ cordova create hello com.example.hello "HelloWorld"
$ cd hello
$ cordova platform add android
Do not build the project yet.
then "import projects" in android studio and choose the hello
directory (not the android directory).
Leave all settings as preselected (so do not exclude the CordovaLib
files!!) and you are ready to go!
– CristiC777 Jul 21 '14 at 13:07