Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

If you create a custom activity more than once an exception should be thrown

Đang mở
#1,320 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.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
android, java, javascript
Lĩnh vực
build-system, mobile-dev

Hướng nghiên cứu

Bắt đầu tại vị trí Generator.java được liên kết, quanh dòng 82, và theo dõi cách các extends trùng lặp cho com.tns.NativeScriptActivity được xử lý. Chạy bản tái hiện custom-activity đã được báo cáo bằng tns build android; được xem là hoàn tất khi phần mở rộng trùng lặp tạo ra exception như mong đợi thay vì chỉ ghi log cảnh báo.

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

Mô tả

  1. Create new project
  2. Try to extend the com.tns.NativeScriptActivity, which is create by tns-core-modules
    Code:
var MyCustomActivityClass = (function (_super) {
    __extends(MyCustomActivityClass, _super);
    function MyCustomActivityClass() {
        _super.call(this);
        return global.__native(this);
    }
    MyCustomActivityClass.prototype.onCreate = function (savedInstanceState) {
     	_super.prototype.onCreate.call(this, false ? savedInstanceState : null);
     	android.util.Log.d("Sbg.Test","we got called from onCreate of custom-activity.js");
    };

    MyCustomActivityClass = __decorate([
        JavaProxy("com.tns.NativeScriptActivity")
    ], MyCustomActivityClass);

    return MyCustomActivityClass;
}(android.app.Activity));

  1. Build the app for android tns build android
    Actual: A warning will be logged "Warning: there already is an extend called com.tns.NativeScriptActivity."
    Expected: An exception to be thrown https://github.com/NativeScript/android-runtime/blob/2ab7271d12d56a03e57880a2b1783b08206363ae/test-app/build-tools/static-binding-generator/src/main/java/org/nativescript/staticbindinggenerator/Generator.java#L82

P.S. In some cases the exception is thrown, but this situations are very rare.

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

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.

Issue khác của NativeScript/android

Tất cả issue của NativeScript/android

Issue tương tự

Thêm issue về C++

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.