Apache cordova how to generate release apk - release

Before i start, i will warn you guys that im not an app developer and that i did not code this app, and that i have no expirience with apache cordova.
So i'm using apache cordova in visual studio 2013 and i'm here trying to get the release .apk but when i try to run a release build on a device i get the following error.
"Android packages must be signed when debugging using the Release or Distribution configurations." I've been googling solutions to this but i could not find any, though i did find that i need to change several things to get the .apk file i want.
So the first step would be making a keystore for the app right? Well, i have no clue on how to do this, and all the answers i found where using the cordova cli which i don't even know how to open. Can anyone tell me what a keystore is and how do i get it. If i need to use the cordova cli how do i open it.
After this, what should i do?

Related

Couldn't generate a APK folder (Gradle issue)

I can't seemed to generate the APK. and this pops up!
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
Could not create service of type FileHasher using BuildSessionScopeServices.createFileSnapshotter().
Please assist.
Which is your global java version?
Put some more information. Ionic info output and Android Studio version.
Try to downgrade your java version to 8
if you do not know how to change your java version, google it!

"APK was defined multiple times" , app fails to install with Android Studio

My app was installing just fine... installing and reinstalling for testing, etc. But now it won't install anymore... and Android Studio says,
Application Installation Failed
Installation failed with message Failed to
finalize session :
INSTALL_FAILED_INVALID_APK: Split
lib_slice_3_apk was defined multiple times.
It is possible that this issue is resolved by
uninstalling an existing version of the apk if it is
present, and then re-installing.
WARNING: Uninstalling will remove the
application data!
Do you want to uninstall the existing
application?
[CANCEL] [OK]
I tried uninstalling the app from my phone, but it still won't re-install.
Also, I tried installing it fresh on an emulator where it had never been installed before, and that did not work either.
I suppose I must have inadvertently messed up some compile-related setting that I don't understand (but I haven't been doing anything like that). I don't have a knowledge of the compile process, and pretty much depend on Android Studio to do that.
I have been working on a "sister" app to this one... where I copied some libraries (.jar files such as zixng.jar from [project root]\app\libs) from this app to the other app. And that other app is installed on my phone also... but then again, it's not on the emulator... so I guess that's not the problem. Merp.
Thanks for any suggestions or possible explanations.
Try to clean & then Rebuild the project again. To do so please go to Build menu, both the tools are present their.
If issue not solved with that than try to invalidate caches & restart Android Studio from File menu -> Invalidate Caches/Restart.

Apache Cordova Tools with Visual Studio 2015 Community Edition

I am totally new to Apache Cordova tools with VS 2015. I just tried to create basic initial project, added nothing more and trying to build it, but it fails everytime.
For the specific error I get, I performed all the steps mentioned at:
Configuring Apache Cordova with VS2015.
I am not able to get rid of this error and run the most basic project.
Here is my sample code: https://1drv.ms/f/s!ApUTYQW5TdbIgzrPGeUkxWVmmy0Z
I ran into this problem and was able to solve it using the solution here: https://stackoverflow.com/a/31688018/4045156
The solution is for a slightly different problem, but in my case it did resolve it. :)
EDIT: here's the solution from that post:
Close all VS instances
cd %appdata%\"..\Local\Microsoft\Phone Tools"
rename CoreCon folder to something else
Launch VS again.
As mentioned in the official link - configure VS tools for Apache Cordova which you are following,
If you see unexpected errors when trying to build the Blank App template after installing Visual Studio Tools for Apache Cordova, you can try clearing your cache and reinstalling the Cordova CLI pre-processor, vs-tac, on your PC.Typically, this is only necessary if you try to build a Cordova app and see the error Cannot find module [modulename].
For other errors, you may have to look at workarounds link.
According to me, clearing cache should resolve the issue or this issue would have got introduced in latest version of Visual Studio once again.
I also suggest you to look at the following SO posts which should help you out in this issue.
VS dont work with TACO
Error with cordova using VS
Hope this helps. Cheers.

Phonegap 3.4.0 fails to build new projects and update old projects

I recently updated phonegap, node, and npm. I have an existing project I previously built with Phonegap version 3.3.0. I then attempted to update my existing project using phonegap platform update ios and received an error stating that the '/platforms' directory does not exist.
I don't think it makes any difference, but I also tried to use the cordova command instead of the phonegap command, but I just get the same error as above. I even created a completely new project with phonegap create Test and I am able to get a project built successfully, but when I try to run/build I get a similar error: Error: /platforms does not exist. Please specify an existing parent folder. [error] /Users/mftcmbp1/.cordova/lib/ios/cordova/3.4.0/bin/create: Command failed with exit code 1 Even stranger, I am able to successfully create a project with the cordova command, build ios and android platforms, and emulate the project, yet I can't do this with the phonegap command like I could before I updated.Any help or suggestions of why this would be occurring will be helpful.
Thanks!
Not sure if there is a bug with Phonegap 3.4.0, but I fixed my issue by uninstalling the latest Phonegap version and installing Phonegap version 3.3.0-0.19.4.
1- you need to 'cd' to your project and add platform first before build
cd Test
2- then add platform
iOS
phonegap platform add ios
android
phonegap platform add android
3- then you can build your project
iOS
phonegap build ios
android
phonegap build android
I ran into this over the weekend, have you tried:
$ mkdir project_directory/platforms
As I remember it, that solved the issue as a hotfix.
The error occured after a project was cloned from github without the platforms directory.
I ran into the same issue, and it looks like an error in the update script, and specifically this file:
node_modules/phonegap/node_modules/cordova/src/util.js
The quick fix is, in the function isRootDir, to change "config.xml" to ".cordova", i.e.:
- if (fs.existsSync(path.join(dir, 'config.xml'))) {
+ if (fs.existsSync(path.join(dir, '.cordova'))) {
The old version identified the base project directory via the existence of the .cordova directory. The new version is incorrectly looking for a directory that contains these three items:
www/
config.xml
platforms/
config.xml should not be in the base directory, it's under www/, which is why it fails.
The script does have fail-safe, which is to look for www/config.xml. However, the way it does this is to continue traversing the tree towards root, and if at any time it finds another www/config.xml, will assume this is a better candidate for the project directory.
In your situation, I'm guessing you have a /www/config.xml off of your root directory, and PhoneGap is erroneously thinking that is your project directory.

PhoneGap 3.1 Local Build WP8

I'm trying to play with new phonegap-cli main focus is to setup wp8 platform
and when running command:
phonegap build wp8
It tries to use PhoneGap Build, which I presume happens because it hasn't found
my installed SDK in any path.
I tried to test my thesis and ran this command:
phonegap local build wp8
And it returns this error:
I have .NET Framework v4.0 installed, so this path exists:
C:\Windows\Microsoft.NET\Framework\v4.0.30319
So the only thing I think happens is that phonegap can't find where SDK is installed,
so I have been searching through the documentation and I couldn't find anything regarding which Environment Variable PhoneGap checks.
So I would really appreciate any kind of help here.
Please make sure that you have added the framework path to the system PATH variable.
In my case it was the above reason and also related to Ant installed and configuration.
Alternatively you can use phonegap's online build service:
https://build.phonegap.com/
It works like a charm and is free for 1 private project.

Resources