Giter Site home page Giter Site logo

Comments (19)

the-simian avatar the-simian commented on June 22, 2024 21

I wanted to share that the link command alone did not help me, in the long run I had to link manually. In your src/main/java/com/appname/MainApplication.java

import com.ocetnik.timer.BackgroundTimerPackage;

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
          new VectorIconsPackage(),
          //........and so on
          new BackgroundTimerPackage()
      );
    }

good luck! android build errors in this ecosystem are frustrating sometimes :)

from react-native-background-timer.

JimSchofield avatar JimSchofield commented on June 22, 2024 5

I used react-native link and I checked src/main/java/com/appname/MainApplication.java for the correct links. Still getting the same error here... What might be going on?

from react-native-background-timer.

akshayseth avatar akshayseth commented on June 22, 2024 5

Not working on expo!

from react-native-background-timer.

prayash avatar prayash commented on June 22, 2024 4

Did you remember to run react-native link after installing the module? I ran into the same issue and running that command fixed it for me.

from react-native-background-timer.

pencilcheck avatar pencilcheck commented on June 22, 2024 1

Works for me after adding the lines in MainApplication.java in addition to the react-native link

from react-native-background-timer.

natterstefan avatar natterstefan commented on June 22, 2024 1

@the-simian thanks for your comment it did work for me as well now. Wondering why this is not properly working or in the Readme.

from react-native-background-timer.

borohhov avatar borohhov commented on June 22, 2024 1

One more thing to the discussion: if you are using remote debugging via Wifi with a real phone, you still need to connect via cable. Remote reloading delivers only the Javascript files, while you need the new app build, which can only be delivered through a cable.

from react-native-background-timer.

the-simian avatar the-simian commented on June 22, 2024

another thing to check is in your settings.gradle located in the android root has the following entries as well:


include ':react-native-background-timer'
project(':react-native-background-timer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-background-timer/android')

I know I mentioned it before, but the link command simply did no good for me, and I had to add this stuff myself. Finally I'd (just to cover our bases) make sure you're using latest packages as well. Hope that helps.

@JimSchofield are you getting the exact same stacktrace as this issue? Does it point to the setTimeout, or clear timeout? Just making sure I'm not overlooking something

Best of luck :)

from react-native-background-timer.

JimSchofield avatar JimSchofield commented on June 22, 2024

@the-simian gradle entries were identical to what you supplied, and it was identical to the op. For some reason I re-imported it and tried using it and it worked... I wish I could tell you what I was doing wrong. Thanks for the help!

from react-native-background-timer.

the-simian avatar the-simian commented on June 22, 2024

glad to hear its working for you :)

from react-native-background-timer.

ocetnik avatar ocetnik commented on June 22, 2024

@dadsteph Did previous comments help you? Can I close this issue?

from react-native-background-timer.

KenilDomadia avatar KenilDomadia commented on June 22, 2024

I am working with expo integrated app, the above steps couldn't solve the issue for me. Is there anything else I can do to solve the issue?

from react-native-background-timer.

the-simian avatar the-simian commented on June 22, 2024

Right on @natterstefan ~! React Native... sometimes you gotta jiggle the cables you know?

from react-native-background-timer.

zorobabel avatar zorobabel commented on June 22, 2024

@dadsteph Check this comment

@ocetnik I think you can close this issue

from react-native-background-timer.

ocetnik avatar ocetnik commented on June 22, 2024

@akshayseth If you use Expo you'll just need to "eject". Check the installation section in the readme.

from react-native-background-timer.

the-simian avatar the-simian commented on June 22, 2024

@akshayseth I'm using expo these days also, honestly, I often have problems when I stray from expo's ecosystem unless I eject (which I usually don't because there's a lot of downsides to that)

from react-native-background-timer.

haratmalli avatar haratmalli commented on June 22, 2024

if you were just install this and testing with
BackgroundTimer.runBackgroundTimer(() => { //code that will be called every 3 seconds }, 3000);
and got null is not an object (evaluating 'RNBackgroundTimer.start') error.
You should rebuild app like react-native run-android

from react-native-background-timer.

prajna-h avatar prajna-h commented on June 22, 2024

Not working for me even after linking the module manually. Please help : (

from react-native-background-timer.

terrynguyen255 avatar terrynguyen255 commented on June 22, 2024

I'm also facing this problem although I already followed the README (manual linking included) :(

from react-native-background-timer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.