NativeScript / NativeScript/android

Get gradle error every time after npm clean

Đang mở
#1,767 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
C++
Star
563
Fork
144
Merge trung bình
10 giờ 46 phút
Pull request đã merge (30 ngày)
14

Mô tả

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI:
  • nativescript version 8.5.3
  • Cross-platform modules:
  • Android Runtime:
  • iOS Runtime (if applicable):
  • Plugin(s):
{
  "name": "testapp",
  "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.2.0",
    "@nativescript/core": "~8.5.0",
    "@nativescript/theme": "~3.0.2",
    "nativescript-auth0": "^4.1.0",
    "nativescript-ui-sidedrawer": "~15.2.0",
    "rxjs": "~7.6.0",
    "zone.js": "~0.13.0"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~15.2.0",
    "@angular/compiler-cli": "~15.2.0",
    "@nativescript/android": "8.5.0",
    "@nativescript/types": "~8.5.0",
    "@nativescript/webpack": "~5.0.14",
    "@ngtools/webpack": "~15.2.0",
    "typescript": "~4.8.4"
  }
}

Get this error with gradle version 7.5 and it takes this version automatically

Searching for devices...
Preparing project...
webpack is watching the files...
assets by path *.js 17.2 MiB
  asset vendor.js 16.6 MiB [compared for emit] (name: vendor) (id hint: defaultVendor)
  asset bundle.js 360 KiB [compared for emit] (name: bundle)
  asset runtime.js 88.5 KiB [compared for emit] (name: runtime)
  asset src_app_home_home_module_ts.js 25.6 KiB [compared for emit]
  asset src_app_user_user_module_ts.js 18.2 KiB [compared for emit]
  asset src_app_featured_featured_module_ts.js 11.4 KiB [compared for emit]
  + 3 assets
assets by path fonts/*.ttf 374 KiB
  asset fonts/fa-solid-900.ttf 204 KiB [compared for emit] [from: src/fonts/fa-solid-900.ttf] [copied]
  asset fonts/fa-brands-400.ttf 131 KiB [compared for emit] [from: src/fonts/fa-brands-400.ttf] [copied]
  asset fonts/fa-regular-400.ttf 39.1 KiB [compared for emit] [from: src/fonts/fa-regular-400.ttf] [copied]
assets by path assets/*.png 14.5 KiB
  asset assets/nativescript-angular-logo.png 10.8 KiB [compared for emit] [from: src/assets/nativescript-angular-logo.png] [copied]
  asset assets/auth0-logo.png 3.73 KiB [compared for emit] [from: src/assets/auth0-logo.png] [copied]
Entrypoint bundle 17.1 MiB = runtime.js 88.5 KiB vendor.js 16.6 MiB bundle.js 360 KiB
runtime modules 25.4 KiB 13 modules
orphan modules 6.96 KiB [orphan] 7 modules
modules by path ./node_modules/ 5.59 MiB
  javascript modules 5.33 MiB 609 modules
  json modules 273 KiB
    modules by path ./node_modules/mdn-data/css/*.json 242 KiB 3 modules
    modules by path ./node_modules/css-tree/ 30.7 KiB 2 modules
modules by path ./src/ 152 KiB
  modules by path ./src/app/ 26.5 KiB 22 modules
  modules by path ./src/*.ts 4.75 KiB 2 modules
  ./src/app.android.scss 120 KiB [built] [code generated]
  ./src/common/config.ts 565 bytes [built] [code generated]
external "~/package.json" 42 bytes [optional] [built] [code generated]
webpack 5.76.1 compiled successfully in 14536 ms
Webpack compilation complete. Watching for file changes.
         ~ applying user-defined configuration from C:\Users\AR022301\NativeScriptExamples\testapp\App_Resources\Android\before-plugins.gradle
Built aar for @nativescript/core
Updating runtime package.json with configuration values...
Project successfully prepared (android)
Building project...
Gradle build...
         + applying user-defined configuration from C:\Users\AR022301\NativeScriptExamples\testapp\App_Resources\Android\before-plugins.gradle
         + applying user-defined configuration from C:\Users\AR022301\NativeScriptExamples\testapp\App_Resources\Android\before-plugins.gradle
         + applying user-defined configuration from C:\Users\AR022301\NativeScriptExamples\testapp\App_Resources\Android\app.gradle
         + using android X library androidx.multidex:multidex:2.0.1
         + adding nativescript runtime package dependency: nativescript-optimized-with-inspector
         + adding aar plugin dependency: C:\Users\AR022301\NativeScriptExamples\testapp\node_modules\@nativescript\core\platforms\android\core.aar
         + adding aar plugin dependency: C:\Users\AR022301\NativeScriptExamples\testapp\node_modules\@nativescript\core\platforms\android\widgets-release.aar    
         + adding aar plugin dependency: C:\Users\AR022301\NativeScriptExamples\testapp\node_modules\nativescript-auth0\platforms\android\nativescript_auth0.aar 
         + adding aar plugin dependency: C:\Users\AR022301\NativeScriptExamples\testapp\node_modules\nativescript-ui-core\platforms\android\TNSCore-release.aar  
         + adding aar plugin dependency: C:\Users\AR022301\NativeScriptExamples\testapp\node_modules\nativescript-ui-sidedrawer\platforms\android\TNSSideDrawer-release.aar

Build file 'C:\Users\AR022301\NativeScriptExamples\testapp\platforms\android\app\build.gradle' line: 586
A problem occurred configuring project ':app'.
C:\Users\AR022301\NativeScriptExamples\testapp\platforms\android\.gradle\7.5\fileHashes\fileHashes.bin (The system cannot find the file specified)

Unable to apply changes on device: emulator-5554. Error is: Command gradlew.bat failed with exit code 1.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Tái hiện bản build Android sau khi chạy npm clean, sau đó kiểm tra platforms/android/app/build.gradle quanh dòng 586 và đường dẫn bộ nhớ đệm .gradle/7.5 được tạo. So sánh cấu hình Gradle được tạo với các tệp before-plugins.gradle và app.gradle được đề cập trong nhật ký. Hoàn tất khi dự án build thành công sau khi dọn dẹp mà không gặp lỗi thiếu tệp fileHashes.bin.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
android, angular, node.js, typescript
Lĩnh vực
build-system, mobile-dev
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
28/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.