react-native-threads icon indicating copy to clipboard operation
react-native-threads copied to clipboard

Doesn't work with React-Native 0.60.5

Open Cassers opened this issue 6 years ago • 6 comments

I am following all the library installation steps listed here: https://github.com/joltup/react-native-threads/blob/master/README.md

But I have not managed to run this library in React-Native, I am using the dependencies:

"dependencies": {      "react": "16.8.6",      "react-native": "0.60.5",      "react-native-threads": "0.0.16"    }

In a new project using the react-native init MyAwesomeProject command, I would like to use this library since without multi thread an application is very limited in terms of data calculations.

Cassers avatar Sep 09 '19 21:09 Cassers

Maybe you should put some error description (the wrong phenomenon or error log) here.

RenderCoder avatar Sep 11 '19 14:09 RenderCoder

I'm getting the following error message: Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings 15 actionable tasks: 2 executed, 13 up-to-date /home/aylan/Projects/thredtest/node_modules/react-native-threads/android/src/main/java/com/reactlibrary/ThreadBaseReactPackage.java:13: error: package com.facebook.react.modules.location does not exist import com.facebook.react.modules.location.LocationModule;

AylanBoscarino avatar Sep 13 '19 11:09 AylanBoscarino

I have the same issue My dependencies:

"dependencies": { "react": "16.8.6", "react-native": "0.60.5", "react-native-threads": "0.0.16" }

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings 15 actionable tasks: 2 executed, 13 up-to-date /home/aylan/Projects/thredtest/node_modules/react-native-threads/android/src/main/java/com/reactlibrary/ThreadBaseReactPackage.java:13: error: package com.facebook.react.modules.location does not exist import com.facebook.react.modules.location.LocationModule;

neller1 avatar Sep 20 '19 14:09 neller1

+1

kalwaniyash avatar Sep 24 '19 09:09 kalwaniyash

Clear solution to start threads (Android):

  1. react-native init MyProject
  2. npm i -S joltup/react-native-threads#master 3.create file react-native.config.js in project directory 4.insert this code to the file:

// react-native.config.js module.exports = { dependencies: { 'react-native-threads': { platforms: { android: null, // disable Android platform, other platforms will still autolink if provided }, }, }, };

  1. Open up android/app/src/main/java/[...]/MainApplication.java
  2. Add import com.reactlibrary.RNThreadPackage; to the imports at the top of the file
  3. Add packages.add(new RNThreadPackage(mReactNativeHost)); to getPackages method before return.
  4. Append the following lines to android/settings.gradle: include ':react-native-threads' project(':react-native-threads').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-threads/android')
  5. Insert the following lines inside the dependencies block in android/app/build.gradle: compile project(':react-native-threads')

neller1 avatar Sep 26 '19 07:09 neller1

Thanks @neller1 for your comment, its help me very much, but now I'm getting the follow error:

screenshot-1584283412985

could anyone help me?

Thanks in advance

gustavorozolin avatar Mar 15 '20 14:03 gustavorozolin