I'm following the cordova tutorial on how to embed a cordova project onto a larger android app: https://cordova.apache.org/docs/en/latest/guide/platforms/android/webview.html
After setting up the cordova project, adding android as a platform and running it, im stuck at step 2.
I go to %projectpath%\MyApp\node_modules\cordova-android\framework and run the "ant jar" command, but it tells me build.xml doesn't exist.
I searched my computer for a build.xml file but I can't find any file named like that.
cmd error picture
Am I doing something wrong or using an incorrect folder?
Related
I can't find something about this, I am create a cordova project with NodeJS/npm, see this link, But after create the project I will try to modify him, its like a normal thing to do.
I tryed to edit the file in:
C:\Program Files\nodejs\helloworld\platforms\android\assets\www\index.html
and run this code in console:
cordova emulate android
my files are reloading and my modifications are deleted, the application are deployed into emulator and I can't do nothing. How I can edit my project without this "reloader"? What I am doing wrong?
modify here
C:\Program Files\nodejs\helloworld\www\index.html
This modification will be automatically applied to the platform's asset folder after you build the project. And build project first before emulate
cordova build android
I've just started to get my hands on the Ionic Framework to code my first Android app.
I can set up the project, but when I want to add the Android platform via 'ionic platform add' it says:
' ? Error reading config file: Error: ENOENT, open 'D:\Projects\android2\config.xml'
Error happened: undefined'
When I want to build the App via 'ionic build android' it says:
'Current working directory is not a Cordova-based project.'
When I run the fix from the ionic FAQ ('cordova create') it says:
'At least the dir must be provided to create new project. See `cordova help`.'
Does anyone know why this errors happen?
Edit: tried on multiple computer (Windows 7 64), got the same error.
Go inside the folder you will find another folder where you might be containing all the files related to your projects ,after going inside the folder write down the command 'ionic platform add android'...
For example:
step1: ionic start MyFirstApp blank
after running this command a folder will be created in which to the drive where you run.
step2: Go inside the folder name 'MyFirstApp' by running command 'cd MyFirstApp'
step3: Then write ionic platform add android
I think this will work for you! Happy Coding
I'm trying out Phonegap using both the command line and with Intellij IDEA.
When I create a new 'hello world'-project with
phonegap create . com.example.test Test
a folder www is created with all html-files. I'm told this is the place where you should do the changes to the source code.
But when I do 'phonegap local build android' the contents of this folder is copied to 'platforms/android/assets/www'. I assume this is done by ant.
Now I want to use only Intellij IDEA for the building instead of the command line. I already managed to import the project into IDEA and run it, but only AFTER I did a local build using the command line first, so I assume IDEA found the copied 'assets/www' files to do the building/running.
Somehow it must be possible with Intellij IDEA to edit the normal www in the root but then when running, do exactly the same as phonegap local build does, but I can't figure out how.
So I've tried posting some of these issues on the Phonegap forum but have not heard from anyone regarding my issues...
I recently upgraded from PG 2.9 to 3.3 and am having trouble adjusting my project to the change... it should be as easy as installing phonegap 3.3 and creating a new project and dragging my /www to the root of the project and calling the cordova CLI commands to build and update my project-- both of which say that they complete successfully.
But it's not that easy! Instead, building and updating my project deletes the cordova2.9.jar and does not create a 3.3.0 jar... so I build it myself which goes fine. I stick it in my /libs folder and my app loads on my phone finally... The problem now is that running in PG 3 requires a change in how API calls are handled-- they are all plugins which you have to install before using them... so I installed all of the needed plugins...
The problem now is this message in logcat within Eclipse:
Unable to open asset URL: file:///android_asset/www/cordova/lib/cordova_plugins.js
so I find this cordova_plugins.js file in the root of my assets/www/ directory (Why is it here?! Shouldn't this be automated by cordova build & update to the correct location?!) So I try to copy the file to /www/cordova/lib/ where the error reports it is trying to find it.
When I do this, I get all of these errors:
Unable to open asset URL:file:///android_asset/www/cordova/lib/plugins/org.apache.cordova.file/www/DirectoryEntry.js
Unable to open asset URL:file:///android_asset/www/cordova/lib/plugins/org.apache.cordova.file/www/DirectoryReader.js
Unable to open asset URL:file:///android_asset/www/cordova/lib/plugins/org.apache.cordova.file/www/File.js
Unable to open asset URL:file:///android_asset/www/cordova/lib/plugins/org.apache.cordova.file/www/Entry.js
...etc (basically every plug-in that I had installed in the project.)
I am clearly missing something here... relocating these javascript files to the correct directory manually should not be what I need to do...
I should mention that this original error occurred when I was running the application in PG2.9 but the only plugins that I needed to use were included by default so I could still use the needed API functionalities.
Any ideas here?
You must need to create and deploy any phonegap project/application using Phonegap Command Line Interface
To Create any project write following command on command line:
$ phonegap create <path> <package_name> <project_name>
i.e.
$ phonegap create hello com.example.hello HelloWorld
To add any platform to your project:
cd <path_to_project>
$ phonegap build <platform>
i.e.
cd hello
$ phonegap build ios
$ phonegap build android
To add any plugin feature to your project:
cd <path_to_project>
$ phonegap local plugin add <path_to_plugin>
i.e.
cd hello
$ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git
Am following the phonegap guide for android here
I've being able to set up all the paths for java, ant, and the sdk.
After running the create <project_folder_path> <package_name> <project_name> command like is stated in the tutorial.
I get message saying its generating the project, after its done and i navigate to the project folder, the cordova.jar and cordova.js files are missing.
Do i have to do something extra ?