-
-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI 8.2.x cannot build plugin with targetSdk 32 and buildTools 32.0.0 #5660
Comments
Hi @agonper, I have exactly the same problem when building a plugin using I discovered that the only way to tell NS where to look for import { NativeScriptConfig } from '@nativescript/core';
export default {
id: 'org.nativescript.app',
appPath: '.',
appResourcesPath: 'App_Resources',
android: {
v8Flags: '--expose_gc',
markingMode: 'none',
},
cli: {
packageManager: "npm",
/**
* Optional - Override the files or paths to clean when running the `ns clean` command
*/
pathsToClean: ["node_modules"],
/**
* Optional - Additional files or paths to clean when running the `ns clean` command, the paths are appended to the
* default list of paths.
*/
additionalPathsToClean: [],
},
useLegacyWorkflow: false,
} as NativeScriptConfig; This should fix that particular error It appears that this is not just
|
The SIGINT part is unrelated - that's normal - it doesn't indicate a failure
|
Well it clearly crashes plugin build and that's the only error in the detailed logs, so something must be related.
Could it be somehow related to #5664? - I just noticed that compileSdk version is 32 even thought I have it set to 31 in the
So my initial comment that it might not be related to SDK 32 could be wrong... No idea at this point. |
The build fails on the gradle side, why it does - I'm not sure yet, haven't had a chance to dig deeper myself. Just thought I'd chime in on the SIGINT part to avoid going down that path, as it is definitely not the cause of the failure. |
Ahm, ok, thanks for clarifying. Is there a way to get a hold of that Annoyingly enough, this file gets wiped out as soon as process exits, so I have no chance of looking into that file and see what's happening on line 38 - but it must be something generic as @agonper has the same line error.
|
@rigor789 an update regarding this one. The big problem that I was finding very annoying up until now was the fact that the temp directory from where the error is thrown was being deleted immediately. So I was not able to go back and inspect the project or look at what's wrong at the reported line Fortunately, I've managed to by watching the directory and copying everything recursively obtain a copy of the project that is generated. Below is the command that is being executed:
And this is the error being produced by the command:
So here is the line 38 from the generated We are clearly looking for this Notice the path where we are looking for it When or by which task this file is being generated? Found the template in the source code as well: nativescript-cli/vendor/gradle-plugin/build.gradle Lines 32 to 38 in a11cace
|
I am experiencing exactly the same issue. I use macOS and I am also seeing what appears to be the missing ".../T/..." in the path to the missing "dependencies.json" file referenced in the build error output (as nicely detailed by @grigala in the Sep 29 post above). This leads me to believe the error is more about "no such directory" than it is about "no such file", as I have added a "dependencies.json" file to my plugin project (containing only an empty JSON array "[]"), but I continue to receive the same error. @agonper / @grigala - did you discover a solution - or a workaround - to this issue? If so, posting an update would be greatly appreciated! Thank you. |
Hi @grfalk, adding an empty So, after my last discussion with the core members, they all admitted that it's clearly a bug they've introduced, but they've all been surprised that we are still using this way of building plugins, which apparently is considered kind of "legacy" way of doing it (broken legacy way), and they themselves haven't been doing it in this way for a long time. Instead, they are using NX workspace way, like packing the sources directly. As I didn't get much of an additional feedback, I gave up on it and all my plugins are simply frozen where they were. Migrating to their proposed "just pack sources" isn't trivial and would require quite an effort in my case due to a lot of complexity in my plugins, but maybe it could work fine in your case - give it a go. |
@grigala - thank you very much for your reply. It explains a lot regarding what I have been experiencing regarding this error, as well what I am seeing when reviewing {N} tooling source code. So, based on the feedback you received the {N} core team members...
...does that imply that all the "current" (i.e.- v7) NativeScript Plugin documentation is no longer valid/applicable? e.g. - Plugin Reference and tns plugin build Or is there updated {N} documentation that I am missing regarding how to create/manage {N} plugin projects using the NX project build paradigm? I am migrating a {N} v6 plugin to be compatible with {N} v7/8, which is how I found myself in {N} "legacy-land". I have completed the required modifications to the plugin's Typescript and native source code for both platforms such that it is now compatible with {N} v7/8. I am now simply attempting to use @grigala (or anyone else reading this) - do know if there is a version of {N} I could "fallback to" where the logic associated with the |
No, it's valid if you are building with an older CLI tools. They introduced this bug in v8.2 I think. Documentation is a mess to be honest, they didn't migrate from v7 to v8 properly, and I often find myself in the situation when the documentation is available for v7 but nowhere to be found for |
So... if I "read between the lines", this issue is low priority (an assumption on my part because it has been open since 2022-03) because it does not negatively affecting the (newer) NX-based build approach for plugins (or possibly supports it?), yet broke the (now legacy?) I am aware that with the release of {N} v7, the {N} team updated all the {N} team-managed plugins to be compatible and consolidated them into a single repo project managed by NX. Using NX to manage a repo that is composed of 34 (formerly standalone) plugin subprojects makes sense to do. But expecting all organizations/individuals in the {N} community that use custom (or extended {N}-managed) plugins to spontaneously do the same without any official notification or documentation is questionable (at best). Organizations that utilize plugins in their {N} app(s) must be given notice, and need to be allotted time, to make such a migration for {N}-based products that are used in production scenarios. Moreover, use of the OK - I am done venting. Back to this issue. @grigala I tried falling back to {N} v8.1.x, but ran into issues apparently related to #1706 and #9814 (and both have been closed with "fixed in v8.2.x" as the solution). I also briefly tried falling back to {N} v7.x.y and ran into different issues when attempting to build my plugin using the
@grigala Because I need to update my custom plugin in short order, I used your approach (quoted above) to "capture" the gradle project created by the execution of the In the meantime, I will wait to see what the {N} team decides to do about the functionality @grigala Thank you again for you replies 🙏. They have proven to be quite helpful. |
Hi, I also digged into this ....and also found some PR that are open regarding the android build process, namely #5671 and #5578 |
@madmas it could fix it. You can all easily test this by pulling my main branch, build and test with it |
For everyone following, I can confirm that you can do the following to fix it:
See this commit for an example in my project. This way it will ship the sources in |
@grfalk Try with this version (https://www.npmjs.com/package/nativescript/v/8.1.5-next-02-20-2022-1872272336). As I tested with this version, gradle issue is fixed while dependencies.json issue is not yet introduced. |
Issue Description
When running ns plugin build using NS CLI 8.2.x, the following error raises:
Rolling back to CLI 8.1.5 temporally fixes the problem (defaults to targetSdk 31 and buildTools 30.0.3).
Reproduction
https://github.com/GeoTecINIT/nativescript-context-apis
Relevant log output (if applicable)
Dependencies
Please accept these terms
The text was updated successfully, but these errors were encountered: