Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with React-Native 0.60.5 #79

Open
Cassers opened this issue Sep 9, 2019 · 6 comments
Open

Doesn't work with React-Native 0.60.5 #79

Cassers opened this issue Sep 9, 2019 · 6 comments

Comments

@Cassers
Copy link

Cassers commented Sep 9, 2019

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.

@RenderCoder
Copy link

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

@AylanBoscarino
Copy link

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;

@neller1
Copy link

neller1 commented Sep 20, 2019

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;

@kalwaniyash
Copy link

kalwaniyash commented Sep 24, 2019

+1

@neller1
Copy link

neller1 commented Sep 26, 2019

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')

@gustavorozolin
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants