Comments (19)
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.
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.
Not working on expo!
from react-native-background-timer.
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.
Works for me after adding the lines in MainApplication.java
in addition to the react-native link
from react-native-background-timer.
@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.
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.
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.
@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.
glad to hear its working for you :)
from react-native-background-timer.
@dadsteph Did previous comments help you? Can I close this issue?
from react-native-background-timer.
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.
Right on @natterstefan ~! React Native... sometimes you gotta jiggle the cables you know?
from react-native-background-timer.
@ocetnik I think you can close this issue
from react-native-background-timer.
@akshayseth If you use Expo you'll just need to "eject". Check the installation section in the readme.
from react-native-background-timer.
@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.
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.
Not working for me even after linking the module manually. Please help : (
from react-native-background-timer.
I'm also facing this problem although I already followed the README (manual linking included) :(
from react-native-background-timer.
Related Issues (20)
- Can I read and write files?
- The timer works perfectly fine in iOS simulator but not on hardware device HOT 3
- BackgroundTimer stops when app goes to background after Few Sec in IOS React Native IOS HOT 17
- runBackgroundTimer doesn't work on RN 66.3 - Tested on Android HOT 5
- Background service is not working if Background data usage disabled. HOT 1
- Using react-native-background-timer with react-native-web HOT 1
- Terminating app due to uncaught exception NSInternalInconsistencyException HOT 1
- how to get clipboard content on background service
- Testing background timer with useFakeTimers in Jest HOT 4
- Background Action and Graphql HOT 2
- the task is dying out HOT 8
- background task dosen't work when device is in sleep mode. HOT 7
- Is this repo still alive? HOT 5
- BackgroundTimer.clearTimeout does not stop ongoing background task
- Invariant Violation: new NativeEventEmitter() requires a non-null argument., js engine: hermes
- react-native-background-timer not working in android HOT 1
- after upgrading gradle version to 8.2.2 I'm getting this error: Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported. HOT 1
- React Native Background Task Termination on Device Lock in Android OS <= 13 HOT 1
- RangeError in long running timers HOT 1
- Problem build/config with MainApplication.kt
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-background-timer.