question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Push fails to write from Android device

See original GitHub issue

This is my service that consumes the nativescript-plugin-firebase API (that’s what’s on the other side of the FIREBASE token), and the push inside addChild resolves, but no data is written in firebase.

import {Injectable, Inject} from '@angular/core';
import {FIREBASE} from '../../../app/frameworks/core.framework/index'

@Injectable()
export class NSDatabaseService {
  private database:any;
  private onSync:Function;
  private userID:string;
  constructor(@Inject(FIREBASE) firebase:any) {
    console.log('Constructing NSDatabaseService');
    this.database = firebase;
    this.database.init({
      persist: true // Allow disk persistence. Default false.
    }).then((instance:any) => {
      console.log('firebase.init successful');
    }, (error:any) => {
      console.log('firebase.init error: ' + error);
    });
  }

  sync(path: string, onValueReceived: Function):void {
    this.onSync = (result:any) => onValueReceived(result.value);
    this.database.addValueEventListener(this.onSync, path);
  }

  addChild(path:string, data:any, callback?:Function):void {
    this.database.push(path, data).then(function (result:any) {
      console.log('created key: ' + result.key);
      if (callback) {
        callback(result.key)
      }
    });
  }
}

Note that it works on the iOS emulator.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:51 (22 by maintainers)

github_iconTop GitHub Comments

1reaction
lowe0292commented, Jun 17, 2016

Thanks for all your help!

1reaction
EddyVerbruggencommented, Jun 17, 2016

That’s hardly ignorant 😃

Let me update the demo app first so you can simply clone that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to push the item(s). in android - Stack Overflow
The first cause is that you have more than one device connected, be sure to have only the device were you going to...
Read more >
[Q] How to push file - No space left error | XDA Forums
I am trying to push framework-res.apk file with ADB to my Galaxy S device but I get following error: C:\>adb push framework-res.apk /system/framework...
Read more >
Adb push does not work - Android Enthusiasts Stack Exchange
I tried to solve it according to this page http://android-tricks.blogspot.com/2009/01/mount-filesystem-read-write.html but with no success.
Read more >
Scrcpy v1.17 fails to push files to device · Issue #2011 - GitHub
An app I had been developing worked but suddenly stopped after the Android upgrade. Turned out more new things were added to the...
Read more >
Git Push Crashes from IDE [124680708] - Issue Tracker - Google
After updating Android studio to version 3.6 we are facing this issue. Works fine in commandline. Invocation failed Unexpected Response from Server: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found