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 ?
Related
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?
For a new Android Studio Project I have somehow generated the files that are generated whenever we create a new project through Android Studio through a python script. This script also places the java and layout xml files in their respective locations. Now I want to build this project and generate the APK through command line only (without opening Android Studio).
I found the android command but that command is deprecated and no longer supported.
Image of the message when using android command
Now, can anyone please suggest any other way to build and create APK through command line?
I found this ant software but am unable to use it as I don't know how to create the build.xml file.
Please help me out.
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
I followed their "how-to":
Phonegap Start
Phonegap wiki
I have succesfully installed the android sdk, but I can not install phonegap 1.3.0. I'm stuck at this step: Step 4. Build the Example PhoneGap App
4A. Open a command window and change directory ('cd') to the 'phonegap-android' folder. In Windows, use git bash as the command window. In Mac OS, use Terminal.
4B. Run the following command. This will create a PhoneGap.jar file and create a basic Android Eclipse project in the output path that can then be opened in Eclipse.
NOTE: The droidgap script has been updated and now there are two methods to create the necessary files. The new script is significantly simpler to use than the old method. For those who prefer the old method, it is still available.
NEW METHOD:
4C. From the 'phonegap-android' folder, run 'ruby bin/droidgap create [path_of_application]'. For the example app, the command would be 'ruby bin/droidgap create example'. If the example folder does not exist inside 'phonegap-android', run 'ruby bin/droidgap gen' first.
These are the steps that I have took:
I have downloaded the callback package from git (see wiki)
I run git bash --> cd to the phonegap-android folder
I run this command: 'ruby bin/droidgap gen'
Then I get: No such file or directory -- bin/droidgap(loadError) and idd the file isnt there.
I can't find droidgrap, who has the anser for me....... The old method don't work either, because I need droidgap for that one 2.
In the end I want to develop a Sencha web app for my android device. What did I forget.... :'(
The AppLaud Eclipse plugin documented on the PhoneGap wiki here eliminates the need for droidgap or any other configuration. Its wizard creates a fully configured PhoneGap for Android project.
(Note: I developed the AppLaud plugin)