Reputation: 447
I am using react-native async-storage community version which is working smoothly with iOS but not with android.
After using react-native run-android I am getting following error
FAILURE: Build failed with an exception.
Where: Build file '/Users/blickx/Desktop/dumont-reactnative/Dumont/node_modules/@react-native-community/async-storage/android/build.gradle' line: 36
What went wrong: A problem occurred evaluating project ':@react-native-community_async-storage'.
Plugin with id 'com.android.library' not found.
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 5s
at checkExecSyncError (child_process.js:621:11) at execFileSync (child_process.js:639:15) at runOnAllDevices (/Users/blickx/Desktop/dumont-reactnative/Dumont/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:74:39) at buildAndRun (/Users/blickx/Desktop/dumont-reactnative/Dumont/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:158:41) at /Users/blickx/Desktop/dumont-reactnative/Dumont/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:125:12 at processTicksAndRejections (internal/process/task_queues.js:93:5) at async Command.handleAction (/Users/blickx/Desktop/dumont-reactnative/Dumont/node_modules/react-native/node_modules/@react-native-community/cli/build/cliEntry.js:160:7)
Upvotes: 0
Views: 10113
Reputation: 1
In settings.gradle file find this
include ':@react-native-async-storage_async-storage' project(':@react-native-async-storage_async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-async-storage/async-storage/android')
copy the ':@react-native-async-storage_async-storage' in the include line and paste the same to implementation project line in build.gradle
Like this ->
dependencies {
......
implementation project(':@react-native-async-storage_async-storage') //<- paste this
..... }
Upvotes: -1
Reputation: 932
It seems you have a missing android plugin which is causing the issue for you.
Instruct Gradle to download Android plugin from Maven Central repository. You do it by pasting the following code at the beginning of the Gradle build file:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
}
}
Note: Make sure your project is using Gradle 3.
Hope this Helps!
Upvotes: 0