NativeScript / NativeScript/nativescript-cli

CLI 8.2.x discards AAR files with the same name

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

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

bug
Ngôn ngữ chính
JavaScript
Star
1.1k
Fork
204
Merge trung bình
1 ngày 9 giờ
Pull request đã merge (30 ngày)
8

Mô tả

Issue Description

I have a plugin workspace with multiple packages and a core package, all under the same scope. My core package has a platforms folder, with an AndroidManifest.xml and an include.gradle file.

Starting from CLI 8.2.x (with 8.1.x works fine) I've noticed that some permissions were missing after building the app, permissions declared in the AndroidManifest.xml of my plugin. It turns out that on build time, an aar is being generated for my core package called core.aar. So, the file name seems to collide with another package (probably the one from @nativescript/core) hence being discarded.

I see the need of discarding duplicated aar files, but perhaps the process should be a bit more "smart" and consider where those files are placed. That, or generated aar files for scoped plugins should contain the scope on its name. These are some suggestions, in case they help.

Reproduction
  1. Find or create a plugin workspace with a package named core.
  2. Add an AndroidManifest.xml file to the platforms/android folder of the plugin.
  3. Add some permission to the manifest (any other thing would work too, but a permission is the easiest thing to add).
  4. Pack the plugin and install inside an existing app.
  5. Build the app.
  6. Check if the permission is listed under the information page of the app.
Relevant log output (if applicable)

No response

Environment
OS: macOS 12.2.1
CPU: (8) arm64 Apple M1
Shell: /bin/zsh
node: 16.13.1
npm: 8.3.2
nativescript: 8.2.3

# android
java: 11.0.11
ndk: Not Found
apis: 23, 26, 28, 29, 30, 31, 32
build_tools: 28.0.3, 29.0.0, 30.0.3, 31.0.0, 32.0.0
system_images:
  - android-31 | Google Play ARM 64 v8a
  - android-32 | Google Play ARM 64 v8a

# ios
xcode: 13.3.1/13E500a
cocoapods: 1.11.2
python: 2.7.18
python3: 3.8.9
ruby: 2.6.8
platforms:
  - DriverKit 21.4
  - iOS 15.4
  - macOS 12.3
  - tvOS 15.4
  - watchOS 8.5
Dependencies
"dependencies": {
  "@awarns/core": "file:../../packages/core",
  "@nativescript/core": "file:../../node_modules/@nativescript/core",
  "@nativescript/unit-test-runner": "^3.0.3",
  "@awarns/geofencing": "file:../../packages/geofencing"
},
"devDependencies": {
  "@jsdevtools/coverage-istanbul-loader": "3.0.5",
  "@nativescript/android": "~8.2.0",
  "@nativescript/ios": "~8.2.0",
  "karma": "6.3.17",
  "karma-coverage": "2.0.3",
  "karma-jasmine": "4.0.1",
  "karma-junit-reporter": "2.0.1",
  "karma-nativescript-launcher": "0.4.0",
  "nyc": "15.1.0"
}
Please accept these terms

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 quá trình build bằng một plugin có platforms/android/AndroidManifest.xml và include.gradle, sau đó theo dõi cách CLI xử lý các tệp AAR được tạo ra. So sánh hành vi của CLI 8.1.x và 8.2.x, đồng thời xác định nơi các artifact trùng tên bị loại bỏ. Hoàn thành khi các quyền trong manifest của plugin vẫn được giữ lại trong ứng dụng đã build mà không làm hỏng việc xử lý các artifact trùng lặp.

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, javascript
Lĩnh vực
build-system, cli, 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
42/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.