
I have tried to run app android version. but build failed with following error.
node_modules\@react-native-community\async-storage\android\src\main\java\com\reactnativecommunity\asyncstorage\ReactDatabaseSupplier.java:17: error: package com.facebook.common.logging does not exist
import com.facebook.common.logging.FLog
Package.json file
{
"name": "example",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest",
"android-windows": "react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && react-native run-android"
},
"rnpm": {
"assets": [
"src/assets/fonts"
]
},
"dependencies": {
"@react-native-community/async-storage": "^1.4.0",
"@react-native-community/netinfo": "^2.0.10",
"axios": "^0.18.0",
"crypto-js": "^3.1.9-1",
"react": "16.8.3",
"react-native": "0.59.8",
"react-native-barcode-scanner-google": "git+https://github.com/ekreutz/react-native-barcode-scanner-google.git#v1.3.0",
"react-native-cache-image": "^1.0.0",
"react-native-camera": "git+https://[email protected]/react-native-community/react-native-camera.git",
"react-native-device-info": "^1.4.2",
"react-native-gesture-handler": "1.1.0",
"react-native-orientation": "3.1.3",
"react-native-picker-select": "^6.1.0",
"react-native-snackbar": "^0.4.6",
"react-native-super-grid": "^2.1.0",
"react-native-table-component": "^1.2.0",
"react-navigation": "3.6.0",
"react-navigation-backhandler": "1.1.1",
"url-parse": "^1.2.0"
},
"devDependencies": {
"babel-jest": "^24.6.0",
"jest": "^24.6.0",
"metro-react-native-babel-preset": "0.53.1",
"react-test-renderer": "^16.8.6"
},
"jest": {
"preset": "react-native"
}
}
I have no idea why its not building suddenly. it was working few weeks ago. please anyone tell me the way to resolve this error.
Hey @ananth10,
Did you try to clean restart it? rm modules, install them again, in android/ run ./gradlew clean. Then back in the root, yarn start --clearCache ?
thanks.
@Krizzu i have tried it many times, but still i am getting same error. i have no idea why it suddenly happened it was working some while ago. can you suggest me any other solutions?
@ananth10 This shows that FLog dependency is missing, although this is bundled with RN, so looks like syncing problem.
Are you able to build the project without AsyncStorage?
@Krizzu No, I have removed AsyncStorage and Tried. but this time react-native-orientation displays same error.
So it appears that you have some issue with dependencies. Likely forgot to add implementation ('com.facebook.react:react-native:+') in you app/build.gradle file.
You can post it here, so I could have a look into it.
@Krizzu please look on it.
app/build.gradle
`apply plugin: "com.android.application"
import com.android.build.OutputFile
/**
react-native bundle with the correct arguments during the Android buildapply from: "../../node_modules/react-native/react.gradle" line.project.ext.react = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle"
/**
/**
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.sampleapp"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
multiDexEnabled true
missingDimensionStrategy 'react-native-camera', 'general'
}
signingConfigs {
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
implementation project(':react-native-orientation')
implementation project(':react-native-device-info')
implementation (project(':react-native-camera')){
exclude group: "com.google.android.gms"
exclude group: "com.android.support"
}
implementation project(':@react-native-community_netinfo')
implementation project(':@react-native-community_async-storage')
implementation project(':react-native-gesture-handler')
implementation (project(':react-native-barcode-scanner-google')){
exclude group: "com.android.support"
}
implementation (project(':react-native-snackbar')){
exclude group: "com.android.support"
}
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:28.0.0"
implementation 'com.android.support:design:28.0.0'
implementation "com.android.support:multidex:1.0.3"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation 'com.google.android.gms:play-services-vision:15.0.2'
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
configurations.all {
resolutionStrategy {
force 'com.android.support:support:28.0.0'
}
}`
Right, seems like deps are in place. What you can try:
node_modulesandroid/build and android/app/build dirsyarn installandroid dir, run ./gradlew installDebugHopefully that clean will be sufficient to get it working.
@Krizzu Its working now after i have explicitly added react-native version in app/gradle file
* implementation 'com.facebook.react:react-native:0.59.8' *
Thanks for your help!!!
Glad you got it working 🎉
I saw that in my package.json file react-native-vector-icons dependence is absent. I don't know why.
In my case i just run 'npm install react-native-vector-icons' and it works well (android build is success when i try to run run-android command).

Most helpful comment
Right, seems like deps are in place. What you can try:
node_modulesandroid/buildandandroid/app/builddirsyarn installandroiddir, run./gradlew installDebugHopefully that clean will be sufficient to get it working.