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

Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory(). > Could not create service of type PluginResolutionStrategyInternal using BuildScopeServices.createPluginResolutionStrategy() Error In rect-native run-android #23554

Closed
kamithL opened this Issue Feb 20, 2019 · 9 comments

Comments

Projects
None yet
7 participants
@kamithL
Copy link

kamithL commented Feb 20, 2019

JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().

Could not create service of type PluginResolutionStrategyInternal using BuildScopeServices.createPluginResolutionStrategy().

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1s
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

Command failed: ./gradlew installDebug

Error: Command failed: ./gradlew installDebug
at checkExecSyncError (child_process.js:616:11)
at Object.execFileSync (child_process.js:634:13)
at runOnAllDevices (/Users/imac2/TestPrinter/node_modules/react-native/local-cli/runAndroid/runAndroid.js:299:19)
at buildAndRun (/Users/imac2/TestPrinter/node_modules/react-native/local-cli/runAndroid/runAndroid.js:135:12)
at isPackagerRunning.then.result (/Users/imac2/TestPrinter/node_modules/react-native/local-cli/runAndroid/runAndroid.js:65:12)
at process._tickCallback (internal/process/next_tick.js:68:7)

@react-native-bot

This comment has been minimized.

Copy link
Collaborator

react-native-bot commented Feb 20, 2019

Can you run react-native info and edit your issue to include these results under the Environment section?

If you believe this information is irrelevant to the reported issue, you may write [skip envinfo] under Environment to let us know.

@react-native-bot

This comment has been minimized.

Copy link
Collaborator

react-native-bot commented Feb 20, 2019

We are automatically closing this issue because it does not appear to follow any of the provided issue templates.

👉 Click here if you want to report a reproducible bug or regression in React Native.

@ThakurKarthik

This comment has been minimized.

Copy link

ThakurKarthik commented Feb 27, 2019

I have the same issue after removing the node_modules and running npm install again i can't use react-native run-android.

@ShmouG

This comment has been minimized.

Copy link

ShmouG commented Mar 1, 2019

I am having the same issue, and I keep coming up to this resolution in stackoverflow: https://stackoverflow.com/questions/30840526/gradle-could-not-create-service-of-type-initscripthandler-using-buildscopeservic
But I don't know if I can change the gradle home variable on my Mac.

@clovisdasilvaneto

This comment has been minimized.

Copy link

clovisdasilvaneto commented Mar 1, 2019

hey guys, I was having the same error, but I solved it by changing my JAVA_HOME version, because I was using java 11, but for some reason android is not compatible with it and I change to java 8 and now it works :)

If you do not know how to change your java version, follow this steps bellow:

  1. Open your .profile file (if you don't have it created, you can create a new one, or use your .bash_profile)
  2. Put the follow line:
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
  1. Save and close it
  2. In your terminal, you can put: source ~/.profile
  3. Run react-native run-android again and it should works
@ShmouG

This comment has been minimized.

Copy link

ShmouG commented Mar 1, 2019

Thanks @clovisdasilvaneto, this really helped me.
If anyone else is struggling with this, I found that you have to download java8 with homebrew as well.
Here's a link on how to do that: https://stackoverflow.com/questions/24342886/how-to-install-java-8-on-mac

@clovisdasilvaneto

This comment has been minimized.

Copy link

clovisdasilvaneto commented Mar 7, 2019

You're welcome! Happy in helping you :)

@AshDSh

This comment has been minimized.

Copy link

AshDSh commented Mar 11, 2019

I have the same issue after removing the node_modules and running npm install again i can't use react-native run-android.

Could you please elaborate on this ?

@AshDSh

This comment has been minimized.

Copy link

AshDSh commented Mar 11, 2019

hey guys, I was having the same error, but I solved it by changing my JAVA_HOME version, because I was using java 11, but for some reason android is not compatible with it and I change to java 8 and now it works :)

If you do not know how to change your java version, follow this steps bellow:

  1. Open your .profile file (if you don't have it created, you can create a new one, or use your .bash_profile)
  2. Put the follow line:
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
  1. Save and close it
  2. In your terminal, you can put: source ~/.profile
  3. Run react-native run-android again and it should works

Could you please tell the steps do this in windows7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.