wayan wahyu Adi Putra
wayan wahyu Adi Putra

Reputation: 379

React Native FAILURE: Build failed with an exception ative_modules.gradle' line: 191

i got error when i start "react-native run-android"

do anyone can help me ?

FAILURE: Build failed with an exception.

FAILURE: Build failed with an exception.

Upvotes: 0

Views: 8165

Answers (2)

SirG
SirG

Reputation: 91

Go to android/app/build/intermediates/signin-config/debug/out/ and delete signin-config.json. Use your file explorer because it might be hidden by your code editor. I couldn't see mine in VS Code. After deletion, run react-native run-android again. It might fix your problem.

Upvotes: 4

Mohamed Ahmed
Mohamed Ahmed

Reputation: 223

I can not comment yet so hoping this may fix your problem.

Did you upgrade your React-Native recently? It seems to be a problem with your cli tools not being able to find the root of your android folder. In a nutshell, all you have to (hopefully that's the issue) do is, add the sourceDir to your native.config.js.

This would be a good time to mention that link will deprecate the use of rnpm in your package.json file. As the documentation suggests, you will have to create a new file (if not already) in your project root directory.

So in your project root directory, create a new file named native.config.js. And inside the folder, you may define the sourceDir which will link to your android folder of the project.

Like so:

module.exports = {
  project: {
    ios: {},
    android: {
    //This link will change according to your android file location. That is if you have a custom directory
    "sourceDir": "./android/app/src",

    //Additionally, you could define the package name
    "packageName":"com.wayan.app"

    },
  },
  //assets: ['./assets/fonts'],
};

So suppose your android folder is called something else, you can replace the sourceDir with the link to your android/app/src directory.

Now try react-native link and re-try react-native run-android

Going through your code, the line says Script 'C:\Users\wayan\Desktop\android\app\node_modules@react-native-community\cli-platform-android\native_modules.gradle' line: 191. So I am assuming that your project name is called app inside android folder?

Here is the LINK to the official guide for autolink. Hope this helps. Happy Coding :)

Upvotes: 2

Related Questions