NativeScript / sample-Groceries

:green_apple: :pineapple: :strawberry: A NativeScript-built iOS and Android app for managing grocery lists
Apache License 2.0
485 stars 345 forks source link

Apk build using Nativescripts Unexpected Token '.' when running tns android command #343

Open amerezrieramli opened 1 year ago

amerezrieramli commented 1 year ago

Before I proceed, let me explain that I am recently employed into this new company as a junior IT support. I mainly do hardware with very2 little programming knowledge. Recently my company upgraded to a newer server and we have changed the location of the databases. However our apps are still pointing towards the old server url/location. I have been in contact with the app developers on how to change the configuration of the apk; in which it needs to be decompiled. They are engaged in a big project and was unable to assist me at this moment. Instead, they have given me the whole folder containing all the source code (Shown in the screenshot).

Screenshot 2023-08-01 223228

I was asked to:-

Change the URL setting in on of the config.ts file contained in the res folder - done - Recompile everything to APK so that the 'new' apk can be installed on our mobile android devices. Upon reading the README file in the folder, it is obvious I am supposed to rebuild this apk app using nativescript. Please see screenshots:-

Screenshot 2023-08-08 172327 Screenshot 2023-08-08 172441

My questions / Issues :-

I have done the steps required in the README file such as:- a. Install [node js] (https://nodejs.org/dist/v10.15.1/node-v10.15.1-x64.msi). Make sure to use version > v10 LTS (I am now using ver v12.22.12) b. Install Nativescript CLI using git bash npm install -g nativescript Done c. Install Java SE Development Kit 8u201 Done d. Install [Android Studio] (Download Android Studio & App Tools - Android Developers) Done e. Create android emulator. Done f. Clone this repository. <---- How is this done correctly? Do I copy the whole project folder and place it under an active working folder to generate the apk app? Please advise Do I run the .sh script PRIOR to running the related commands in tns such as 'tns android build' / 'tns android debug'? I did a tns debug android using command prompt (Admin rights) in the folder path and received :-

Screenshot 2023-08-08 174524

I also did tns doctor just to check my configurations are correct or otherwise:-

Screenshot 2023-08-08 174756

I DID refer back to the developer of this app, however he did not have any comments rather than the android apk was created using nativescript (duh!). I have also send him the exact same question here however he is not replying as prompt as I expected. Would appreciate if anyone with the expertise could assist and guide me moving forward. Many thanks.