I use Phonegap CLI to make my android apps every thing works fine, but when I want to make my final .apk I face a problem
I have SDK JDK Java and all environment variables
I generated my .keystore and when i run phonegap build --release i have no error my problem is this
there is no folder called bin or any .apk file in my folder
I red all documents and questions from stackoverflow and I still have this problem
what do you think? should i switch to cordova CLI ?
PhoneGap has been discontinued.
Switching to Cordova CLI is certainly an option, but many find that installing the build toolchain is a lot of trouble to get working (and keep working).
If you prefer the convenience of a build service like you had with PhoneGap, have a look at VoltBuilder, Ionic or Monaca.
Related
I am planning to develop hybrid application for Android and iOS using Angular,Phonegap etc.
My main query is how to maintain single code base for iOS/Android?
Q1:I execute cordova create command to create project for Android. and write one Hello World App.Do I need to do create project again in iOS and copy www?
Q2: How about maintaining single code in git ? I am confused since folder structure are different for Android and iOS ?
Any help is appreciated.
I have searched many blogs but didn't find the this concepts.
Just develop your code under project/www
cordova platform add android
cordova platform add ios
Will create both platforms, and with cordova prepare, and cordova build, it will copy the files to each platform
To maintain code, just add your project into a GIT, and both platforms project/platforms/[IOS/android] will be in the same project. You can also gitignore the platforms if you want to maintain light your project
I developed an application on Apache Cordova, I followed all the steps to generate the .apk to upload on Google Play. I tried many times but Google's response is the same:
We rejected APP, package ID com.xxx.app, for violating our dangerous products policy. If you submitted an update, the previous version of
your app is still available on Google Play. This app uses software
that contains security vulnerabilities for users. Below is the list of
vulnerabilities and the corresponding APK versions that were detected
in your recent submission. Please upgrade your app(s) as soon as
possible and increment the version number of the upgraded APK.
Vulnerability Apache Cordova: The vulnerabilities were fixed in Apache Cordova v.3.5.1.
I have the latest version of Cordova (5.4.1).
The following will detail the steps that I followed for installation and project development:
Start the download of Cordova from the console Node.js using the command npm install -g Cordova.
Install Java: version 1.8.0_65.
Install Android SDK.
Add Java and SDK to PATH.
I downloaded the necessary components of the Android SDK.
Create the project through the commands. (Cordova create Projectxxxx).
Add the Android platform.
I copied my application code in the www folder.
Add the plugins needed for my project: splashscreen and sqlite.
I tested the application on the Android emulator and other mobile phones. All good. Runs perfect.
To create the signed APK file, these are the steps:
-Cordova build --release android. (This generated the android-release-unsigned.apk on platforms / android / build / outputs
/ apk).
-Then, I generated the keystore.
-After the jarsigner.
-Finally: zipalign.
I upload end-app.apk to Google Play.
Another detail that I have is that cordova.js generated version is 4.1.1. But the console version is 5.4.1 (Command: Cordova -version).
I did everything by node.js console.
Attemps:
I uploaded an APK without js components. Only with cordova.js and it not worked.
I installed all over again in a newly installed windows and neither worked.
My version is higher than 3.5.1. I can not find the solution.
The big problem is not just that PLATFORM_VERSION_BUILD_LABEL is wrong, but the default cordova used is ancient ( it was 3.7.1 on mine ). To resolve this you need to install a newer version in the project. You can specify this on the command line, much like npm does.
cordova platform update android#4.1.1
Or you can specify it in your config.xml
<engine name="android" version="4.1.1" />
That may need 'spec' instead of 'version' depending on how current you cordova install is. At this point, they are up to 5.1, and you can use 'latest' instead of a specific version number.
The next headache will be the point of the patch, which locks down network access. I am now getting 404 errors on all my ajax calls to our server. Access was the root of the security problem, so this isn't a big surprise. I am still working on that.
I had the same problem, I found a previous corodva version in a plugin, in my case was facebook connect; I deleted this plugin and upload again, its work form me. You may search PLATFORM_VERSION_BUILD_LABEL in your project, is posible that some plugin have other cordova version.
I was trying to solve this problem almost for a week. Solution:
There was a cordova.js file within www/lib/cordova folder that doesn't get updated when you update cordova and ionic. Open the file and look for var PLATFORM_VERSION_BUILD_LABEL. If the version is not 4.1.1 at the time of this post, update it with another copy of the file that is somewhere in your main directory.
I´m starting with sencha touch 2 tech,and now I´m stuck in creating the .apk file.
This is what I have done since the begining to where I´m stuck:
Download Sencha Touch SDK
Install Java JDK
Install NodeJS
Install Ruby
Install Sencha CMD
After that I created my app:
In the command line --> sencha generate app MY_APP_NAME MY_APP_FOLDER(I use the folder www of my wamp server)
Then with Eclipse for PHP Developers,I opened the folder and start editing the files to create my app.
Now I have finished my app and want to create the .apk file to test it in a real device(in my wamp server runs perfect).
And I´m stuck on how to create the apk file,I have read lots of tutorials but no one is clear.
Please some help on how to create the .apk file step by step or something helpfull.
Thanks.
Create Simple Android Project in Eclipse and put your www folder in assets folder.
And write below code in your MainActivity:
#Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
super.loadUrl("file:///android_asset/www/index.html");
}
Now simply run your Application.
For creating apk files, you can create and setup Cordova environment as described here.
For some additional help, see this reference.
Once you want to make apk for your android device. Just go through the steps here. But i will advice you to use build of your app to work with in your cordova app.
After making build of your project, Check the following steps:
cordova create yourapp com.example.yourapp YourApp
cd yourapp
cordova platform add android
cordova build android
After this you should copy your project and paste it into the immediate www folder of your cordova project. And then run
cordova run android
Deploy the .apk file in your emulator or real device to test the app.
Let me know if it helps.
Finally I solve my problem. I found that through this link it autogenerates the files.
Before I discovered that you need to create via sencha cmd the production files through the command in the app folder:
sencha app build production
With this two steps I created the .apk file,donwloaded and tested it.
Thanks to the previous comments.
There is so much conflicting information out there on this, I'm hoping we can shed some light.
Goal: Create and develop a phonegap app that will be built using phonegap build.
1) I don't want to install the android and iOS SDKs, that's why I want to use phonegap build.
2) I created an app using the cordova cli cordova create hello
3) There is no phonegap.js or cordova.js I guess because I didn't add a platform. But I don't want to add a platform as that requires installing the SDKs
4) I need to be able to debug and test this, so I downloaded ripple, which may or may not work, I need the phonegap.js file first to see.
So has anyone figured this out? Building and developing and app that will be used on Phonegap build?
Thanks!
Phonegap will let you create a UI using webview of Android, iOS, Blackberry or other platforms. That means you need to have native SDK to apply Phonegap Build. It doesn't mean that Phonegap will create an App for you and deploy it to other platforms.
Can i have this kind of set up?
I want to create a normal xcode project and just add the Cordovalib.xcodeproj to the xcode project?
Just like this one. http://mobiledan.net/2012/05/02/compile-phonegap-source-code-in-your-ios-phonegap-project/
But instead of creating a Cordova project from the start I will create a normal and standard Xcode Project.
Yes, you can, it has been available for a long time, I think since phonegap 1.5 on iOS. It's called cleaver.
To see how to use and configure, follow this link (for phonegap 2.1), in other versions it can be a bit different, and the steps were included in a pdf inside the .dmg of phonegap installation