Start a new topic

sed error building sample app

sed error building sample app

Hi there !

I am new with Wikitude, and I start with the beginning, that is to say the sample app : (specially "Automatic setup of sample app").

Here is the command line I used and the error I encoutered :(

E:Developpement\Wikitude\wikitude-cordova-plugin-samples-master>CreateSampleApp.cmd -d E:\Developpement\Wikitude\wikitude-cordova-plugin-samples-master\output -android true


Creating a new cordova project.

sed: -e expression #1, char 1: unknown command: `.'


Do you have an idea of what I mistaked ?




It seems that it is due to this command :

# Create the project directory


sed -i '.original' 's/<platform name="android"\>/\<\platform name="android"\>\<preference name="android-minSdkVersion" value="16"\/\>/g' "${PROJECT_DIRECTORY}"/config.xml


I tried using double quote but I have the same error :(


Can you please have a look at the documentation setup guide for Cordove here and see if this fixes your issue? 

Hi Eva, and thanks for your answer.

I have already installe cordova cli using step by step tutorials.

Furthermore, I have already developped cordova project without any problems...

I recently updated cordova to version 6+, maybe it is the cause ?


Hi Jean,
Could you please try the following:
1) call the .cmd with the following set of options: -e *PROJECT_PATH* -android true -ios false
2) Remove the sed command. You can change the minSDK version manually afterwards in the generated project

Best regards


I have the same problem! Did you figure it out?

Hello Roel,

Did you already try what Andreas suggested in the forum post above? If you are still having problems then please let me know
  • which version of the SDK are you using?
  • If you are using the JS API or Cordova?



Hi Eva,

I'm a step further now.

I disabled the 2 'sed' commands in the generator file. One line for minSDK version and one line for the license key. I manually updated the minSDK version and license keys in the 3 WikitudePlugin.js files.

The app now runs and gets me to the sample overview screen.

I now get this error:

"Error in Success callbackId: WikitudePlugin1256307210 : TypeError: app.wikitudePlugin.requestAccess is not a function"

Can you help me with that?

I'm using jdk1.8.0_121 with cordova (phonegap)

Hi Roel,

Did you download our Wikitude Cordova example app .zip from GitHub and run the example app generation script without modifying the downloaded Wikitude Cordova plugin? What I'm interested in is: Did you, while removing the sed commands, somehow changed the Wikitude Cordova plugin? The error you mentioned could occur if you use the latest example app but with an older version of our Cordova plugin.

Best regards,


Hi Andreas,

I did a fresh download of the .zip on github and installed it again using the app generation script (with disabled sed commands). The same error occurs.

Here is my output of the generation script:
$ ./CreateSampleApp.cmd -d C:/xampp/htdocs/ar_app5 -android true -ios true
Creating a new cordova project.
')droid (cordova version '6.5.0
Adding android project...
Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: com.wikitude.phonegapsamples
        Name: Plugin_Samples
        Activity: MainActivity
        Android target: android-23
Android project created with cordova-android@5.0.0
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Fetching plugin "cordova-plugin-whitelist@1" via npm
Installing "cordova-plugin-whitelist" for android

               This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.

Fetching plugin from default GitHub master
Fetching plugin "" via git clone
Repository "" checked out to git ref "master".
Installing "com.wikitude.phonegap.WikitudePlugin" for android

            Have fun using world's first AR plugin for PhoneGap. Visit for detailed documentation for the plugin.

            Make sure that you enter your Wikitude SDK trial license key in `WikitudePlugin.js` line 12. If you havent bought a license please visit

            If you want to contribute to the open source project, please visit us at github,

Fetching plugin "cordova-plugin-file" via npm
Installing "cordova-plugin-file" for android
Fetching plugin "cordova-plugin-compat" via npm
Installing "cordova-plugin-compat" for android

The Android Persistent storage location now defaults to "Internal". Please check this plugin's README to see if your application needs any changes in its config.xml.

If this is a new application no changes are required.

If this is an update to an existing application that did not specify an "AndroidPersistentFileLocation" you may need to add:

      "<preference name="AndroidPersistentFileLocation" value="Compatibility" />"

to config.xml in order for the application to find previously stored files.

*** DONE - SUCCESS ***

Hi Roel,

Can you by any chance give it a try on a macOS system?

We just tried it on macOS for Android and iOS and didn't encounter any such error.

Best regards,


Hi Andreas,

Unfortunately I do not have access to an macOS machine.
Is there a way I can download a complete .zip of the entire sample app, without having to use the generation script?


Hi Roel,

We just did that yesterday, so here you can download a .zip package containing a generated Cordova project for Android.

Please let me know if that works for you or in case not, why.



Hi Andreas,

Thank you!
Unfortunately, your project gives me exactly the same error.
I tried downloading the latest version of Phonegap Desktop App for Windows, with no luck. I don't know what else can be the issue.


Login or Signup to post a comment