NativeScript / NativeScript/android
@Interfaces decorator gives an error "Error executing Static Binding Generator: Class not found"
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:
Nativescript: 6.7.8
tns-core-modules: 6.0.1
tns-andoird: 6.5.3
Issue:
I am implementing Java Interface in my Nativescript-angular application for android. I have added Java android plugin dependency in the app.gradle file. I get a build (tns build android) error for @Interfaces decorator.
Build error during "tns build android"
"Error executing Static Binding Generator: Class not found global.com.microsoft.identity.client.IPublicClientApplication.ISingleAccountApplicationCreatedListener"
If I execute below steps then I dont see any issue.
- "tns run android --no-hmr"
- Application built and started successfully
- Perform necessary @Interfaces related changes in the TS file
- Automatically starts the incremental build
- I dont see any error and my code works fine.
app.gradle:
dependencies {
implementation "com.microsoft.identity.client:msal:1.2.+"
}
TS file:
declare var global: any;
@Interfaces([global.com.microsoft.identity.client.IPublicClientApplication.ISingleAccountApplicationCreatedListener])
export class SingleAccount extends java.lang.Object {
mSingleAccountApp;
constructor() {
super();
// necessary when extending TypeScript constructors
return global.__native(this);
}
onCreated(application): void {
//some code
}
onError(exception): void {
////some code
}
}
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện lỗi của tns build android trong trạng thái sạch và luồng chạy thành công của tns run android --no-hmr. Kiểm tra dependency trong app.gradle và khai báo TypeScript @Interfaces, sau đó lần theo lỗi của Static Binding Generator đối với IPublicClientApplication.ISingleAccountApplicationCreatedListener. Công việc được hoàn tất khi interface có thể được build thành công từ một clean build, không chỉ theo cách incremental.
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, java, 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
- 35/100