Closed NCenerar closed 2 years ago
After digging into the source code, I found the bug and patched it on my local installation.
L257 of lib/services/android-plugin-build-service.js
:
getRuntimeGradleVersions(projectDir) {
return __awaiter(this, void 0, void 0, function* () {
let runtimeGradleVersions = null;
if (projectDir) {
const projectData = this.$projectDataService.getProjectData(projectDir);
const platformData = this.$platformsDataService.getPlatformData(this.$devicePlatformsConstants.Android, projectData);
const projectRuntimeVersion = platformData.platformProjectService.getFrameworkVersion(projectData);
/* runtimeGradleVersions = yield this.getGradleVersions(projectRuntimeVersion); */ // <-- THIS LINE WAS MISSING
this.$logger.trace(`Got gradle versions ${JSON.stringify(runtimeGradleVersions)} from runtime v${projectRuntimeVersion}`);
}
if (!runtimeGradleVersions) {
const latestRuntimeVersion = yield this.getLatestRuntimeVersion();
runtimeGradleVersions = yield this.getGradleVersions(latestRuntimeVersion);
this.$logger.trace(`Got gradle versions ${JSON.stringify(runtimeGradleVersions)} from the latest runtime v${latestRuntimeVersion}`);
}
return runtimeGradleVersions || {};
});
}
I will try to fix it in this repo and create a pull request.
I created a fork and a branch for fixing this:https://github.com/NCenerar/nativescript-cli/tree/fix/issue-5650
I cannot create a pull request for patching NS 7.2.1 since there is no branch for NS 7.2 (apparently).
I can still create a pull request for master
since this bug seems to be still present.
Thank you.
@NCenerar this has been fixed in the 8.2 CLI, so please update your CLI and try with that. It should be backwards compatible with older projects, so just npm i -g nativescript
then ns clean
and build again - it should work.
@rigor789 Unfortunately, our project does not work with NativeScript 8. The migration tool didn't work out of the box and until now, we judged too risky to take the leap. Any chance to see a new version of NS7, like 7.2.2 😅
@NCenerar you do not need to update to NativeScript 8, just the CLI - which should be backwards compatible down to NS 6.x
Issue Description
When running
tns build android
, I get an error:Reproduction
Create a project with dependency on
"@nativescript/android": "7.0.1"
and"@nativescript-community/gesturehandler": "0.1.41"
. Build the project.Relevant log output (if applicable)
Environment
Dependencies
Please accept these terms