Closed arpitjivanitecan closed 1 year ago
TNS doctor result is here
✔ Getting environment information
No issues were detected. ✔ Your ANDROID_HOME environment variable is set and points to correct directory. ✔ Your adb from the Android SDK is correctly installed. ✔ The Android SDK is installed. ✔ A compatible Android SDK for compilation is found. ✔ Javac is installed and is configured properly. ✔ The Java Development Kit (JDK) is installed and is configured properly. ✔ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure. ✔ Getting NativeScript components versions information... ✔ Component nativescript has 8.5.3 version and is up to date. ✔ Component @nativescript/core has 8.5.7 version and is up to date. ✖ Component @nativescript/ios is not installed. ✔ Component @nativescript/android has 8.5.0 version and is up to date.
Sounds like a possible network configuration issue, or a stale/stuck process preventing gradle from running correctly. I'd recommend trying a reboot, or looking around StackOverflow for other possible solutions (note, this issue has likely nothing to do with NativeScript itself):
I already try to reboot 2 3 times but nothing works
I don't know how to help, though I'm curious about the following info:
Windows 10 java version is jdk-11.0.19.7-hotspot downloaded from https://adoptium.net/temurin/archive/
Those look good to me. One thing I would try to see if it makes a difference:
ns clean
ns debug android
If that doesn't work, I would then try the following:
ns clean
ns prepare android
then edit platforms/android/gradle.properties
and add to the end of the file
# Disable Gradle Daemon
org.gradle.daemon=false
And then run/build:
ns debug android
output of ns debug android
can you check this error Searching for devices... npm WARN deprecated @npmcli/move-file@1.1.2: This functionality has been moved to @npmcli/fs npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility npm WARN deprecated source-map-resolve@0.6.0: See https://github.com/lydell/source-map-resolve#deprecated npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x. npm WARN deprecated core-js@3.6.4: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
added 1509 packages, and audited 1510 packages in 1m
116 packages are looking for funding
run npm fund
for details
50 vulnerabilities (2 low, 20 moderate, 20 high, 8 critical)
To address issues that do not require attention, run: npm audit fix
To address all issues (including breaking changes), run: npm audit fix --force
Run npm audit
for details.
Copying template files...
Platform android successfully added. v8.5.0
Preparing project...
C:\Users\AR022301\Downloads\HW\node_modules\webpack-cli\bin\cli.js:93
throw err;
^
TypeError: webpack.init is not a function
at module.exports (C:\Users\AR022301\Downloads\HW\webpack.config.js:4:10)
at handleFunction (C:\Users\AR022301\Downloads\HW\node_modules\webpack-cli\bin\utils\prepareOptions.js:21:13)
at prepareOptions (C:\Users\AR022301\Downloads\HW\node_modules\webpack-cli\bin\utils\prepareOptions.js:9:5)
at requireConfig (C:\Users\AR022301\Downloads\HW\node_modules\webpack-cli\bin\utils\convert-argv.js:117:14)
at C:\Users\AR022301\Downloads\HW\node_modules\webpack-cli\bin\utils\convert-argv.js:123:17
at Array.forEach (
That seems like a completely different issue - post your package.json
with the dependencies, seems like incorrect project setup? How was this project created?
{ "name": "HW", "main": "./src/main.ts", "version": "1.0.0", "private": true, "dependencies": { "@angular/animations": "~15.2.0", "@angular/common": "~15.2.0", "@angular/compiler": "~15.2.0", "@angular/core": "~15.2.0", "@angular/forms": "~15.2.0", "@angular/platform-browser": "~15.2.0", "@angular/platform-browser-dynamic": "~15.2.0", "@angular/router": "~15.2.0", "@nativescript/angular": "^15.0.0", "@nativescript/core": "~8.5.0", "@nativescript/theme": "~3.0.2", "rxjs": "~7.6.0", "zone.js": "~0.13.0" }, "devDependencies": { "@angular-devkit/build-angular": "^0.901.13", "@angular/compiler-cli": "^15.0.4", "@nativescript/android": "8.5.0", "@nativescript/types": "~8.5.0", "@nativescript/webpack": "^4.1.0", "@ngtools/webpack": "~15.2.0", "typescript": "~4.8.4" } }
Updated package.json
{ "name": "HW", "main": "./src/main.ts", "version": "1.0.0", "private": true, "dependencies": { "@angular/animations": "~16.1.3", "@angular/common": "~16.1.3", "@angular/compiler": "~16.1.3", "@angular/core": "~16.1.3", "@angular/forms": "~16.1.3", "@angular/platform-browser": "~16.1.3", "@angular/platform-browser-dynamic": "~16.1.3", "@angular/router": "~16.1.3", "@nativescript/angular": "^16.0.0", "@nativescript/core": "~8.5.7", "@nativescript/theme": "~3.0.2", "rxjs": "~7.8.1", "zone.js": "~0.13.1" }, "devDependencies": { "@angular-devkit/build-angular": "^16.1.3", "@angular/compiler-cli": "^16.1.3", "@nativescript/android": "8.5.0", "@nativescript/types": "~8.5.0", "@nativescript/webpack": "^5.0.16", "@ngtools/webpack": "~16.1.3", "typescript": "~5.1.6" } }
getting this error
FAILURE: Build failed with an exception.
What went wrong: java.io.IOException: Unable to establish loopback connection
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org Failed to build plugin @nativescript/core : Error: Command gradlew.bat failed with exit code 1
Did the above help in the updated version? Are you able to run the following:
ns create myApp --ts
cd myApp
ns debug android --no-hmr
?
The webpack issue is because you had @nativescript/webpack@^4.1.0
in the package.json, but trying to use the 5.x
api/interface.
Still getting the same error if you have time then you can lookup into my system I can give you remote access for some time
Problem solved with changing jdk from jdk-11.0.19.7-hotspot to jdk-11.0.18
Good to know, thanks for the update!
still getting gradle error from android side [CIRCULAR REFERENCE:java.nio.file.AccessDeniedException: C:\Users\AR022301\NativeScriptExamples\testapp\platforms\android\app\build\intermediates\project_dex_archive\debug\out\6877dd31322427efc2f8087b2888f38fb662d7341ded1766e076e0402d88f7e5_10.jar]
Build completed with 2 failures. C:\Users\AR022301\NativeScriptExamples\testapp\platforms\android\app\build\intermediates\compressed_assets\debug\out\assets\app\assets\auth0-logo.png.jar
[CIRCULAR REFERENCE:java.nio.file.AccessDeniedException: C:\Users\AR022301\NativeScriptExamples\testapp\platforms\android\app\build\intermediates\project_dex_archive\debug\out\6877dd31322427efc2f8087b2888f38fb662d7341ded1766e076e0402d88f7e5_11.jar]
Build completed with 2 failures. C:\Users\AR022301\NativeScriptExamples\testapp\platforms\android\app\build\intermediates\compressed_assets\debug\out\assets\app\bundle.js.jar
Sounds like a file permission issue, could be related to anti-virus software, or just incorrect file permissions on your project folders. While not necessary, do try running it from an administrative prompt and see if that makes a difference.
I tried with that also but after 3 4 run it works fine but when I do ns clean and tns run android I have to run this for 3 4 times and then it works but it is not the solution
That sounds odd, seems like somehow filesystem permissions are set up in an unconventional way (likely by mistake), so when you run ns clean
we delete node_modules
, hooks
, platforms
and package-lock.json
, and on the next run, these are re-created at which point their permissions are likely incorrect again because the current user in the terminal might have incorrect acl settings. I don't know what to try other than searching around google/stack overflow for possible solutions - the NativeScript CLI doesn't change these at all, just uses whatever the system is configured for.
If you have time then you can take a look what is happening I can give you an access
I mainly use macOS for development, so I'm not really sure what to look for, also join our discord: https://nativescript.org/discord and we can chat further there. I'd recommend looking around and if still an issue, I may be able to connect briefly and have a quick look around - we can coordinate that on discord.
FAILURE: Build failed with an exception.
What went wrong: java.io.IOException: Unable to establish loopback connection
Try:
Get more help at https://help.gradle.org