NativeScript / NativeScript/firebase
[firebase 3.2.x] Android "default FirebaseApp is not initialized"
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- TypeScript
- Star
- 62
- Fork
- 53
- Merge trung bình
- 8 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 2
Mô tả
CLI: 8.6.5
@nativescript/core: 8.6.2
@nativescript/firebase-analytics: 3.2.2
@nativescript/firebase-core: 3.2.2
@nativescript/firebase-crashlytics: 3.2.2
@nativescript/firebase-messaging: 3.2.2
Were there any breaking changes in the latest versions of firebase-core analytics, crashlytics or messaging? After updating from version 3.1.3 to version 3.2.2 or 3.2.0, I get this error on Android devices:
Error: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.myapp.myapp. Make sure to call FirebaseApp.initializeApp(Context) first.
My code, unchanged from the previous version. initializeApp() returns null and the next line throws the exception.
import { firebase } from "@nativescript/firebase-core";
import "@nativescript/firebase-analytics";
import "@nativescript/firebase-crashlytics";
import "@nativescript/firebase-messaging";
export async function initFirebase() {
const app = await firebase().initializeApp();
// app is null
firebase().crashlytics().setCrashlyticsCollectionEnabled(true);
}
Downgrading to version 3.1.3 all works fine.
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 với hàm initFirebase và so sánh quá trình khởi tạo Firebase Core Android giữa các phiên bản 3.1.3 và 3.2.2. Tái hiện sự cố với các phiên bản gói NativeScript và Firebase được liệt kê, sau đó xác minh rằng initializeApp() không còn trả về null và lệnh gọi Crashlytics tiếp theo thành công trên Android.
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, typescript
- Lĩnh vực
- 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
- 30/100