I had a working phonegap project which I compiled using
phonegap build android
And then aligned and signed using ant
ant release
However, I had to format my computer, saved the folder on another drive, and copied it back after formatting. I installed jdk, android sdk, phonegap, ant, and when I try to compile it again (using the same command as before) I'm getting this error (which doesn't help at all, not even with --verbose):
[error] An error occurred while building the android project.
What do I need to do to be able to compile the project again? Also, do you recommend using an IDE instead of the phonegap CLI?
Related
I built a "Hello World" app using PhoneGap Desktop, but now when I try to build an APK on build.phonegap.com, it just hangs. The build has been pending for 2 days now. Is there an alternative way to build the APK?
Go to Console/Terminal
cd Project Path
cordova build android
(or)
cordova build ios
Go to project path ->platforms -> ios/android in finder(mac)/file explorer(windows)
It converts android/iOS project and open project in android studio/Xcode and build .apk/.ipa file.
It's a bit clunky, but deleting your app from PhoneGap Build and re-adding adding the app should solve the problem. This solution was found on the Adobe Forums.
I am new to Phonegap and have succesfully created my first app and compiled first on-line then set up phonegap, android SDK etc locally so I can build and run the app in the emulator using 'phonegap run android' at the command prompt (windows).
For an IDE I installed Eclipse and imported the project. I can now run the project from within Eclipse.
However I am really struggling with the Eclipse build. It's taken days already to solve all the problems and get to this stage but I've reached the point where I can't make progress although it would seem so simple.
The build project option is disabled. It turns on if I add something under 'Builders' under 'Configure Build Path...' but I have no idea what I should be doing here.
I can go back to the CMD prompt and build, refresh in Eclipse and run the modified version but this can't be the right way to do it?
I just need to tell Eclipse to 'phonegap build'. But how?
When you create a project using PhoneGap it creates a Gradle based build which can be opened in Android Studio or IntelliJ IDEA. I recommend using Android Studio for PhoneGap projects.
I try to compile my Cordova Hybrid App from visual studio to apk file
After I deploy the project to Android / iOS the project bin folder still empty.
I try to upload the "www" folder to build.phonegap.com but I get error.
What is the best and correct way to compile the project (HTML, CSS, and JS) to APK for Android and IOS?
Thanks,
Tom
Update:
I try to build from the visual studio
this is my Project folder
When I try to build project from the visual studio on "Device" mode I get this error
1- If you have used Ripple simulator as the target, nothing will be generated in the bin folder. You need to switch the build configuration to "device" in order for the binaries to be generated
2 - The www folder that is generated by the Visual Studio template has nothing special and you shouldn't have issues with PhoneGap Build. If you have errors they are coming from your JS code itself
3 - To build the binaries for Android using the Multi-Device Hybrid extension for Visual Studio, you should be good by simply switching the build configuration to "device" instead of Ripple simulator. For iOS you need to use the Remote Build and Simulation Agent for iOS (which require have a Mac as the iOS tools are NOT available for Windows and you cannot generate the iOS binary directly on your Windows machine. Otherwise, you can consider using PhoneGap Build service
From the image the error looks to be similar to the one I was getting about my device not being recognized/found.
This answer explains how to get the APK directly just by setting the solution to Release, and only Building the project rather trying to do a full deploy to a device. It pretty much is the same answer as mentioned in point 3 above, just tested on a PhoneGap App solution.
I just upgraded my Apache Cordova project to Cordova 3.2 and changed everything to a cordova CLI project at the same time. It was all working fine until, in my Android app, I added a reference to another, third-party project. The Android app still works fine with that sub-project, however, now when I try to run "cordova build" from the command line I get the following error:
Preparing android project
Compiling app on platform "android" via command "/<path-to-my-cordova-project>/platforms/android/cordova/build"
[Error: An error occurred while building the android project.Error executing "ant clean -f /<path-to-my-cordova-project>/platforms/android/build.xml":
BUILD FAILED
/Applications/adt-bundle-mac-x86_64/sdk/tools/ant/build.xml:471: Invalid file: /<path-to-my-android-sub-project>/build.xml
The Android sub-project uses maven, rather than ant, so there is no build.xml file. But Cordova wants one to exist, for some reason… I tried placing a dummy build.xml file in the sub-project, but Cordova doesn't like that either.
I know that typically Cordova projects don't have sub-projects, since all of the app code is typically just html/javascript/css. So, is the concept of a sub-project simply something that the Cordova CLI doesn't support yet? Is there a way I can get the CLI to just ignore the sub-project?
You can use the android update project command to create a build.xml file that cordova's ant will like. If the subproject has a lot of dependencies that maven resolves, then you may end up with a multi step build where you resolve the dependencies of the subproject first then do the cordova build.
More details about the sub project would help.
I am new to Android and using Android 2.3 .
There is sample Browser plugin in the source code I am trying to build
it but unable to do so.
To compile plugin [ In README.txt ]
run "make SampleBrowserPlugin" (compiles libsampleplugin.so and
builds the apk)
the previous command produces an apk file so record its location.
Using the above steps I am unable to build it.
I have tried the following things :-
I thought to build the code in JNI folder first so as to get the
plugin ".so" so that after getting the ".so" would build the project
apk using the eclipse .
I tried building the code in the JNI folder using NDK build.The code
was not geting build it was giving "undefined reference to
JNIRegisterNativeMethod in JNIHelp.h "
Can anyone tell me how to build the Sample plugin and install it
on Emulator.
You need to "make SampleBrowserPlugin" from the root of your source installation (on a Linux machine). That is, the same directory that contains "bionic", "build", "dalvik", etc. as child directories.