1

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?

Johnson
  • 157
  • 3
  • 17
  • I think the error message was some confused because version of my cordova(6.3.0) is greater than required(5.4.0) in fact. Does it have anything to do with git? I do not have git installed. – Johnson Jul 29 '16 at 08:03

3 Answers3

2

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.

miken32
  • 42,008
  • 16
  • 111
  • 154
Richard W
  • 21
  • 3
  • Thank you. But the 1st solution does not work. After uninstalling the latest version of cordova(6.3.0) and installing V5.4.0, I succeeded in creating the android project. Thank you. – Johnson Sep 13 '16 at 08:48
  • But now, I got another error message: Error:'com.android.build.gradle.BasePlugin' does not implement the Plugin interface. – Johnson Sep 13 '16 at 08:48
  • It looks like some other people have been able to manually fix it with these instructions: http://stackoverflow.com/questions/36925531/gradle-sync-failed-com-android-build-gradle-baseplugin-does-not-implement-the/36978066#36978066 – Richard W Sep 14 '16 at 16:23
  • I'd also recommend you post these questions to the SalesforceMobileSDK Google+ community. That's where the Mobile SDK SMEs hang out. https://plus.google.com/communities/114225252149514546445 – Richard W Sep 14 '16 at 16:25
1

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

Freelancer
  • 836
  • 1
  • 14
  • 47
Rajasekar
  • 11
  • 1
  • But my cordova has been the latest version, 6.3.0. I ran command "npm update -g cordova". And because the "forcedroid create" failed, I have not generated any android project. – Johnson Jul 29 '16 at 01:37
0

Thanks to you all.

At last I worked out this problem. I would like to share with you all here.

  1. 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

  2. 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

  3. 'cordova telemetry off' doesn't work for me.

Thanks again, special to Richard W, miken32, Ali Nfr and Rajasekar.

Johnson
  • 157
  • 3
  • 17