failed to run 'forcedroid create' for a hybrid android app - android

I am going through salesforce trailhead "Get Started with Hybrid Development".
Now, I try to create a forcedroid hybrid android app with command "forcedroid create".
E:\TempTry>forcedroid create
Enter your application type (native, hybrid_remote, or hybrid_local): hybrid_local
Enter your application name: MyTrailHybridLocal
Enter the target directory of your app: TrailHybridApps
Enter the package name for your app (com.mycompany.my_app): com.mytrail.hybrid
But I failed and got an error message as below.
". Should be in the format x[.y[.ignored]]
) is less than the minimum required version (5.4.0). Please update your version
of Cordova.
In fact, folder TrailHybridApps exists and it is empty. And my Cordova is v6.3.0.
E:\TempTry>cordova -v
6.3.0
So, what's wrong? And what can I do now?
Thanks in advance.
In fact, I have succeeded in finishing a Cordova android app acoording to the guide: https://cordova.apache.org/docs/en/latest/guide/cli/
So, I think my Cordova has no problem and it seems that the question resulted from the "npm forcedroid". On the other hand, I have not github installed. Does it have anything to do with github?

Before running forcedroid create, run this command:
cordova telemetry off
Then forcedroid create should work. Or, you could uninstall Cordova and reinstall with a specific version, i.e.:
npm uninstall -g cordova
npm install -g cordova#5.4.0
You don't have to do anything with github.

You need to update your cordova. This guide shows how to modify Android projects to upgrade from older versions of Cordova. Most of these instructions apply to projects created with an older set of command-line tools that precede the cordova CLI utility. See The Command-Line Interface for information on how to update the version of the CLI.
https://cordova.apache.org/docs/en/latest/guide/platforms/android/upgrade.html

Thanks to you all.
At last I worked out this problem. I would like to share with you all here.
I think it must be a bug of Cordova V6.3.0 or forcedroid create.
Refer to : https://github.com/forcedotcom/SalesforceMobileSDK-Android/issues/1209
As for me, Cordova V6.2.0 works fine while V5.4.0 seemed to result in another error message: Error:'com.android.build.gradle.BasePlugin'.
npm uninstall -g cordova
npm install -g cordova#6.2.0
'cordova telemetry off' doesn't work for me.
Thanks again, special to Richard W, miken32, Ali Nfr and Rajasekar.

Related

Cordova/Phonegap command doesnt execute

I have a problem during my cordova/phonegap installation. I did every step in this PhoneGap Tutorial
But when I try to execute "$cordova create" I get the message "cordova: command not found". When I try to execute "$phonegap" nothing happens.
Any idea, what to do?
How can I reinstall everything? How can I check my installation?
What version of Cordova do you have installed? The latest stable at this time is 5.4.1
You can check cordova version using the command
cordova --version
If by any chance you ended up with this error after an update, you can try uninstalling Cordova globally using -g(global) flag and install again using sudo npm update -g cordova
For steps regarding installation and update, please refer to the original documentation here
You might need to create a fresh cordova project after installation/update and move your config preferences and www to the freshly created project/folder.

Ionic build android in CLI does nothing

I really tried to avoid having to ask this question but I've been stuck on this for a good two days. The problem is that when I try to run the command "ionic build android" I get nothing. No error response, no warning, nothing.
I installed node.js and made my npm global so I can access it anywhere. I installed ionic and cordova via npm install and I was able to start the application and see it on the web but when I try to run it on my device, I don't get any response at all.
What am I missing? I have all the android sdks as I normally write my android applications natively. I installed Ant view homebrew. I'm quite lost.
Apparently there was a bug in Node 5.0.0 causing this.
I had the same issue as you, remedy, and was able to resolve it today by updating to the latest version of node (5.2.0 as of today):
sudo npm update -g
For some reason not (yet) known to me, the cordova command was no longer available after this update (returning "/usr/local/bin/cordova: No such file or directory"), but reinstalling cordova by calling
sudo npm install -g cordova
helped. After these two updates the ionic build ... and cordova build ... commands worked again.
So downgrading node to version 4 is apparently no longer necessary to resolve this.

Can't build app with Ionic

I am no longer able to build my app and generate an apk anymore because an error shows up. Here is what happens when I try to build the app in the command prompt: Command Prompt
Can somebody please help me with this? Oh and this is what happens if I type ionic info in the command prompt:
Your environment has been set up for using Node.js 0.12.4 (x64) and npm.
C:\Users\Singh>ionic info
Your system information:
Cordova CLI: 5.1.1
Ionic CLI Version: 1.6.1
Ionic App Lib Version: 0.3.3
OS: Windows 7 SP1
Node Version: v0.12.4
C:\Users\Singh>
Try to remove the platform, and then add it again, and then build your application.
So, if you have android as targeted platform execute these commands:
ionic platform remove android
ionic platform add android
ionic build android
My son had a very similar problem, and we never did figure out what caused it. He ended up creating a brand new blank ionic project, and then just copying the www folder from the old project. It worked, and he was able to get things building again. If you try it, you'll also have to re-add your plugins, copy package.json and bower.json, and then rerun bower install and npm install. It's not pleasant, but it might be worth a shot if you're desperate.

Is planned an upgrade for the"Multi-Device Hybrid Apps for Visual Studio" extension which use the latest version of cordova

Yesterday, Google Play Developer Support sent us a email saying that we need to upgrade our apps targeting a cordova versiĆ³n upper than 3.5.0 due a security vulnerability.
I need to know if I can wait or come back to the command line.
Support for higher versions of Cordova is planned for the next version of MDHA tools. It seems like the Android issue was fixed with Cordova 3.5.0-0.2.7.
To manually update your cordova version, please follow the steps below
Open the command prompt
Type cd %appdata%\npm\node_modules\vs-mda\
Type npm install cordova#3.5.0-0.2.7. Make sure you do not use -g
Run a "clean" on any project you want to upgrade
This will update your Cordova Android to 3.5.1. If you are building for iOS, you would need to do the same thing to patch vs-mda-remote
Shut down vs-mda-remote if it is running
Open Terminal
Go to the location you installed vs-mda-remote. Typically cd /usr/local/lib/node_modules/vs-mda-remote
Type sudo npm install cordova#3.5.0-0.2.7 Important: Be sure to omit -g

phonegap/ Cordova error: [RangeError: Maximum call stack size exceeded]

I am trying to create a phonegap / cordova app using the 3.1.0 version.
Created my app with the command:
cordova create hello com.example.hello HelloWorld
And after running this command:
cordova platform add android
to add android platform, i am getting:
[RangeError: Maximum call stack size exceeded]
Any idea what could be the issue?, previously i created another app, but same error was occurring when adding camera plugin.
I faced the same issue, but I was actually issuing the command in wrong directory, so firstly I changed the directory to Hello then issued the command.
So, I have directory structure as,
---Cordova
---Hello
and I was actually issuing the command by being at Cordova folder. After that I changed the folder to Hello then executed this cordova platform add android and it worked.
Please check once
be sure you are located in the created directory (Hello, I guess), the same level with .cordova
cd Hello
For anyone coming to this question after July 2013 (when Cordova 3.0.0 was released), there is another reason for this problem.
If you created a Cordova project on a computer with Cordova 3.x and you are trying to work with it on a computer that still has the old 2.x version, you will get this error because of how the project structure changed between the versions.
Upgrading Cordova to the newest version using npm install -g cordova will fix the problem.

Categories

Resources