2017-09-01 6 views
1

私のプロジェクトではこのエラーが発生していますので、firebase側の変更が疑わしい新鮮な新しいnativescriptプロジェクトを作成しました。新規のAndroidアプリケーションを使用してプロジェクトを作成し、新しいデータベースデータを追加しても、同じエラーが発生します。エラー:Uncaught(約束):TypeError:nullのプロパティ 'child'を読み取ることができません

基本的にすべてのfirebase.instancenativescript-plugin-firebase内部のプラグインは、私の側

からコードの変更基本的にすべてのfirebase.instancenativescript-plugin-firebase内部のプラグインなしで突然のすべてのNULLで私の側からのコードを変更せず、突然のすべてのNULLです。端末に受信

エラーメッセージ:私は続い

JS: Error in firebase.addValueEventListener: TypeError: Cannot read property 'child' of null JS: ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'child' of null JS: TypeError: Cannot read property 'child' of null JS: at file:///data/data/org.nativescript.bbnsng/files/app/tns_modules/nativescript-plugin-firebase/firebase.js:1456:24 JS: at new ZoneAwarePromise (file:///data/data/org.nativescript.bbnsng/files/app/tns_modules/nativescript-angular/zone-js/dist/zone-nativescript.js:776:29) JS: at Object.firebase.addValueEventListener (file:///data/data/org.nativescript.bbnsng/files/app/tns_modules/nativescript-plugin-firebase/firebase.js:1444:10) JS: at Observable._subscribe (file:///data/data/org.nativescript.bbnsng/files/app/modules/services/firebase.service.js:23:22) JS: at Observable._trySubscribe (file:///data/data/org.nativescript.bbnsng/files/app/tns_modules/rxjs/Observable.js:57:25) JS: at Observable.subscribe (file:///data/data/org.nativescript.bbnsng/files/app/tns_modules/rxjs/Observable.js:45:27) JS: at Observable.ConnectableObservable.connect (file:///data/data/org.nativescript.bbnsng/files/app/tns_modules/rxjs/observable/ConnectableObservable.js:37:18) JS: at RefCountOperator.call (file:///data/data/org.nativescript.bbnsng/files/app/tns_modules/rxjs/observable/ConnectableObservable.js:101:49) JS: at Observable.subscribe (file:///data/data/org.nativescript.bbnsng/files/app/tns_modules/rxjs/Observable.js:42:22) JS: at ObservableStrategy.createSubscription (file:///data/data/org.nativescript.bbnsng/files/app/tns_modules/@angular/common/bundles/common.umd.js:2664:22) JS: at AsyncPipe._subscribe (file:///data/data/org.nativescript.bbnsng/files/app/tns_modules/@angular/common/bundles/common.umd.js:2778:45) JS: at AsyncPipe.transform (file:///data/data/org.nativescript.bbnsng/files/app/tns_modules/@angular/common/bundles/common.umd.js:2755:22) JS: at Object.eval [as updateDirectives] (ng:///HomeModule/HomeComponent.ngfactory.js:127:68) JS: at Object.debugUpdateDirectives [as updateDirectives] (file:///data/data/org.nativescript.bbnsng/files/app/tns_modules/@angular/core/bundles/core.umd.js:12613:21) JS: at checkAndUpdateView (file:///data/data/org.nativescript.bbnsng/files/app/tns_modules/@angular/core/bundles/core.umd.js:12025:14)

ステップ:

  • 新しいレポを作成しfirebaseコンソールで新しいfirebaseプロジェクト
  • を作成しますパッケージ名がのその案件のアンドロイドアプリデータベースにいくつかのデータを追加し、許可がパブリック
  • コードまでこの状態にcorresponsding nativescript角度アプリhttps://github.com/ishandutta2007/bb_ns_ng_main_app2
  • google-services.jsonをダウンロードし、それを追加するルール作り、SHA1を取得し、同じ
  • でアプリをアップデートする
  • 実行keytool -list -v -keystore ~/.android/bbnsng.keystore app/App_Resources/Android/
  • アプリを実行します。

再現手順:私にとって git clone https://github.com/ishandutta2007/bb_ns_ng_main_app2.git cd bb_ns_ng_main_app2 tns run android

答えて

0

、app.jsするには、以下の文を追加/ app.tsは、この問題を修正し、私は正しいfirebaseデータベースが構成されていました。例:

require("./shared/firebase/firebase.common"); 

Angular Projectの場合、main.tsにimport firebase.commonを追加します。例:

import "./shared/firebase/firebase.common";