Start a new topic

Setup problem in Cordova Sample App

Hello,


Now I'm setting up Cordova Sample following the article in the document but it doesn't go well. (On Windows 10 Home)


https://www.wikitude.com/external/doc/documentation/latest/phonegap/setupguidecordovacli.html#PhoneGapSampleApp


1. Download ZIP file from Github, 2. Unzip that, 3. Open Windows Power Shell and change directory to Unzip file. No problem in that. Then 

4. In the console of Power Shell run the CreateSampleApp.cmd;


./ CreateSampleApp.cmd -d ~/Path/Where/The/App/Sould/Be/Created -android true


but error occured as;


'sh' is an internal or external command, It is not recognized as an operable program or batch file.


I tried same process on bash but error occured again as;


.CreateSampleApp.cmd: command not found



How I can setup Sample App of Cordova?


Thanks.



Hello,


I keep trying, on bash


$ ./CreateSampleApp.cmd ~d /sample -android true


input command then error shows as;


./CreateSampleApp.cmd: line 1: @ECHO: command not found

./CreateSampleApp.cmd: line 3: ::: command not found

./CreateSampleApp.cmd: line 4: ::: command not found

./CreateSampleApp.cmd: line 6: ::: command not found

./CreateSampleApp.cmd: line 7: SET: command not found

./CreateSampleApp.cmd: line 8: SET: command not found

./CreateSampleApp.cmd: line 9: SET: command not found

./CreateSampleApp.cmd: line 10: SET: command not found

./CreateSampleApp.cmd: line 12: SET: command not found

./CreateSampleApp.cmd: line 13: goto: command not found

./CreateSampleApp.cmd: line 15: :usage: command not found

./CreateSampleApp.cmd: line 16: ECHO: command not found

./CreateSampleApp.cmd: line 17: ECHO.: command not found

./CreateSampleApp.cmd: line 18: ECHO: command not found

./CreateSampleApp.cmd: line 19: ECHO.: command not found

./CreateSampleApp.cmd: line 20: ECHO: command not found

./CreateSampleApp.cmd: line 21: ECHO: command not found

./CreateSampleApp.cmd: line 22: ECHO.: command not found

./CreateSampleApp.cmd: line 23: ECHO: command not found

./CreateSampleApp.cmd: line 24: syntax error near unexpected token `('

./CreateSampleApp.cmd: line 24: `ECHO Specifies the sample application destination directory (will be created)'


What's the cause of this error?


Thanks.


Hi wels wels,


First of all, sorry for the late response.


I have reproduced the exact steps on my Windows 10 and it worked.


The steps are: open the cmd, move to the folder path, call to sh command to open the shell and then call to:  ./CreateSampleApp.cmd -d ../sample -ios false -android true changing the path. Could you please to reproduce my steps to see if it is still failing?


Thank you,


Aitor.

Hello Aitor,


Thank you for your reply.

I tried once again but got totally same result.


I want to check your steps again,


1. open the cmd

> I'm working on bash on VS Code terminal on Windows 10 as attached pic


2. move to the folder path, 

> change directory to the Unzipped folder of Sample App from Github


3, call to sh command to open the shell 

> ??????????


4. and then call to:  

  ./CreateSampleApp.cmd -d ../sample -ios false -android true

> Input this command but totally same result.


Are these 4 steps correct? If so, I cannot understand what you mean

in step 3 "call to sh command to open the shell ". Could you give me advice?



Or, is the Unzipped folder of Sample App from Github enough by itself to work

Wikitude sample app? I cannot understand relation between Sample App Zip

file on Github, and Android SDK and Cordova CLI.



Thanks.

error.png
(93.1 KB)

Hi again,


Doing the same as you in my VS Code terminal on Windows 10. Inside the red rectangle in the attached pic is the only difference i can see from what you're are doing. I hope it helps you.


Did you have installed the cordova command line?


Thank you,


Aitor.

Hello Aitor,


Thank you very much for your advice.


I installed MSYS2 and changed jason setting, then now I can use sh command on VS Code terminal.

And tried CreateSampleApp.cmd again, but another error occured as;


>WikitudePhoneGapSampleGenerator.sh: line 43: cordova: command not found


And you mentioned "Did you have installed the cordova command line?" 

What is this mean? How I can install cordova command line?


Thanks.

error.png
(64.8 KB)

Hello,


Do you mean Cordova tool?

I've already installed Cordova Tool Extension as attached.


Thanks.

Hi,


Here is the cordova official documentation to install the Cordova CLI:  https://cordova.apache.org/docs/en/latest/guide/cli/index.html#installing-the-cordova-cli


Please check it. Once you can use the cordova command line in your terminal, the error will disappear.


Thank you,


Aitor.

Hello Aitor,


Thank you for your advise.

Finally I could run CreateSampleApp.cmd and install cordova CLI.


I found there was a problem in jason setting, adding some lines I could install and run node.js and cordova CLI by sh command on terminal.

  

...
    
"terminal.integrated.shell.windows": "C:\\msys64\\usr\\bin\\sh.exe",
    "terminal.integrated.shellArgs.windows": ["--login", "-i"],
    "terminal.integrated.env.windows": {
        "MSYSTEM": "MINGW64"
    }

...

  sample building was done successful, and then imported app in Android Studio, then another error occured as;



ERROR: The minSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file.

Move minSdkVersion to build files and sync project

Affected Modules: CordovaLib, app

WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.

It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

Affected Modules: app

WARNING: The targetSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file.

Move targetSdkVersion to build file and sync project

Affected Modules: app


Now I'm working to figure this out.

Could you give me one more advise?


Thanks.



Hi,


I'm glad to hear that is working fine now.


The error you mention should be fixed by removing the <uses-sdk android:minSdkVersion...> line in the manifests files where Android Studio is giving you the error.


Regards,


Aitor.

Hello Aitor,


Thank you so much for your advice.

Finally I could run sample on cordova.


There were 2 AndroidManifest.xml file in;


\Android\app\manifests\


and 


\Android\CordovaLib\manifests\


I commented out <uses-sdk android:minSdkVersion="19" /> in both 2 files, then

input License key in 


\Android\app\assets\plugins\com.wikitude.phonegap.WikitudePlugin.www\WikitudePlugin.js


then finally I could build and run the Cordova sample.



Long long way....... 

Thank you so much for your cooperation once again!!!!!!


And setting up Cordova CLI and its sample is really complicated than Android SDK.

Hopefully for easy understand and setup I wish setup movie of Cordova sample.

Android SDK setup movie on youtube is very helpful.


Thanks.




Login or Signup to post a comment