Hi Ahmet, could you send me a screenshot, where to select and apply the version please?
In project folder, /native/.config file I have stated the version 14.1.6 (attached picture)
But when I attempt to build app via "App/Build Native Mobile App", the builder gets updated to its newest version and then downloads the latest template from Mendix Github (14.1.11). In NBUI, I don't find option to select template version:
As a suggestion, you can use below commands to download Mendix’s official Native Template and pin it to a specific version (v14.1.6). This lets you work with that exact template version instead of the latest one, which can be helpful if you want consistent behavior or to avoid issues introduced in newer releases.
git clone https://github.com/mendix/native-template.git
cd native-template
git checkout v14.1.6
Thanks Ahmet, but I still seem not to find how to do it.
Let's suppose:
- I have downloaded Native Template 14.1.6 from Github to folder:
"C:\Users\myuser\Mendix"
- Project folder (having .mpr) is:
"C:\Users\myuser\Mendix\MyProject"
- In its subfolder: \MyProject\nativemobile I have .config and asset files at ready:
My Java is at:
"C:\Program Files\Eclipse Adoptium\jdk-21.0.5.11-hotspot\"
What precisely shall I type to command prompt to build a native app ready to be launched in Android Studio, same as the Mendix Native Mobile Builder UI would produce?
I struggle to find the usage of mxbuild.exe in junction with native-mobile-toolkit
After cloning, using CLI, go the folder:
cd C:\Users\myuser\Mendix\native-template
If you didn't install npm package:
npm install
Generate the Android project (what Navite Builder UI does):
npx mendix-native build android --project-dir "C:\Users\myuser\Mendix\MyProject"
Open the C:\Users\myuser\Mendix\native-template\android folder via Android Studio.
Hopefully, that would help you.
Here's the console output:
There is no npm package called mendix-native, which is why running npx mendix-native … results in a 404 error.
cd C:\Users\myuser\Mendix\native-template
npm install (use --legacy-peer-deps if needed)
npm run configure
This is the supported way to configure the native project locally, after which you can open the generated android folder in Android Studio.