fails to build an (newly created) ejected expo project - react-native

I am trying to add react-native-firebase to a newly created expo project, I ejected the app successfully, but when I try to add the library the project fails to build and I get the following error
ERROR: In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[15.0.
1]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.
Dependency failing: com.google.android.gms:play-services-flags:15.0.1 -> com.google.android.gms:play-services-basement#[
15.0.1], but play-services-basement version was 16.2.0.
I updated all firbase dependencies but it still fails, I then used this line to force stop the errors so I can at least build
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
the previous error is gone but I keep different errors. eg:
Error: Program type already present: com.google.android.gms.internal.measurement.zzbk
platform: Ubuntu 19:04
expo: Latest
react-native-firebase: 5.2.5
gradle (project) file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven { url 'https://dl.bintray.com/android/android-tools/' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
// classpath 'com.google.gms:google-services:3.2.1'
classpath 'de.undercouch:gradle-download-task:2.0.0'
classpath 'com.amazonaws:aws-devicefarm-gradle-plugin:1.3' // https://github.com/awslabs/aws-device-farm-gradle-plugin/releases
classpath 'com.google.gms:google-services:4.2.0'
}
}
allprojects {
repositories {
google()
jcenter()
// For non-detach
maven {
url "$rootDir/maven"
}
// For old expoviews to work
maven {
url "$rootDir/versioned-abis/expoview-abi26_0_0/maven"
}
maven {
url "$rootDir/versioned-abis/expoview-abi27_0_0/maven"
}
maven {
url "$rootDir/versioned-abis/expoview-abi28_0_0/maven"
}
maven {
url "$rootDir/versioned-abis/expoview-abi29_0_0/maven"
}
maven {
url "$rootDir/versioned-abis/expoview-abi30_0_0/maven"
}
maven {
url "$rootDir/versioned-abis/expoview-abi31_0_0/maven"
}
maven {
url "$rootDir/versioned-abis/expoview-abi32_0_0/maven"
}
// For detach
maven {
url "$rootDir/../node_modules/expokit/maven"
}
maven {
// We use a modified build of com.android.support.test:runner:1.0.1. Explanation in maven-test/README
url "$rootDir/maven-test"
}
maven {
// Local Maven repo containing AARs with JSC built for Android
url "$rootDir/../node_modules/jsc-android/dist"
}
flatDir {
dirs 'libs'
// dirs project(':expoview').file('libs')
}
// https://github.com/google/ExoPlayer/issues/5225#issuecomment-445739013
maven { url 'https://google.bintray.com/exoplayer' }
maven { url "https://jitpack.io" }
// Want this last so that we never end up with a stale cache
mavenLocal()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
gradle (app)
buildscript {
repositories {
google()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.26.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'devicefarm'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 27
defaultConfig {
applicationId 'expo.reactnative.test'
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName '1.0.0'
ndk {
abiFilters 'armeabi-v7a', 'x86'
}
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// Deprecated. Used by net.openid:appauth
manifestPlaceholders = [
'appAuthRedirectScheme': 'host.exp.exponent'
]
}
dexOptions {
javaMaxHeapSize System.getenv("DISABLE_DEX_MAX_HEAP") ? null : "8g"
}
flavorDimensions 'remoteKernel'
productFlavors {
devKernel {
dimension 'remoteKernel'
}
prodKernel {
dimension 'remoteKernel'
}
}
signingConfigs {
debug {
storeFile file('../debug.keystore')
}
release {
storeFile file(System.getenv("ANDROID_KEYSTORE_PATH") ?: "release-key.jks")
storePassword System.getenv("ANDROID_KEYSTORE_PASSWORD")
keyAlias System.getenv("ANDROID_KEY_ALIAS")
keyPassword System.getenv("ANDROID_KEY_PASSWORD")
}
}
buildTypes {
debug {
debuggable true
ext.enableCrashlytics = false
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
lintOptions {
abortOnError false
}
packagingOptions {
pickFirst "**"
}
configurations.all {
resolutionStrategy.force 'com.android.support:design:27.1.0'
}
}
devicefarm {
projectName System.getenv("DEVICEFARM_PROJECT_NAME")
devicePool System.getenv("DEVICEFARM_DEVICE_POOL")
executionTimeoutMinutes 40
authentication {
accessKey System.getenv("AWS_ACCESS_KEY_ID")
secretKey System.getenv("AWS_SECRET_ACCESS_KEY")
}
}
configurations.all {
resolutionStrategy {
force 'org.webkit:android-jsc:r224109'
}
}
// WHEN_PREPARING_SHELL_REMOVE_FROM_HERE
apply from: 'expo.gradle'
// WHEN_PREPARING_SHELL_REMOVE_TO_HERE
dependencies {
implementation project(':react-native-firebase')
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.firebase:firebase-core:16.0.9'
implementation 'com.google.firebase:firebase-analytics:16.5.0'
// Firebase dependencies
implementation "com.google.android.gms:play-services-base:16.1.0"
//
implementation 'com.android.support:multidex:1.0.1'
// Our dependencies
implementation 'com.android.support:appcompat-v7:27.1.1'
// Our dependencies from ExpoView
// DON'T ADD ANYTHING HERE THAT ISN'T IN EXPOVIEW. ONLY COPY THINGS FROM EXPOVIEW TO HERE.
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.facebook.android:facebook-android-sdk:4.37.0'
implementation('com.facebook.android:audience-network-sdk:4.99.0') {
exclude module: 'play-services-ads'
}
compileOnly 'org.glassfish:javax.annotation:3.1.1'
implementation 'com.jakewharton:butterknife:8.4.0'
implementation 'de.greenrobot:eventbus:2.4.0'
// Be careful when upgrading! Upgrading might break experience scoping. Check with Jesse. See Analytics.resetAmplitudeDatabaseHelper
implementation 'com.amplitude:android-sdk:2.9.2'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.android.gms:play-services-gcm:16.1.0'
implementation 'com.google.android.gms:play-services-analytics:16.0.8'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-ads:17.2.0'
annotationProcessor 'com.raizlabs.android:DBFlow-Compiler:2.2.1'
implementation "com.raizlabs.android:DBFlow-Core:2.2.1"
implementation "com.raizlabs.android:DBFlow:2.2.1"
implementation "com.madgag.spongycastle:core:1.53.0.0"
implementation "com.madgag.spongycastle:prov:1.53.0.0"
debugImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
implementation 'com.facebook.device.yearclass:yearclass:2.1.0'
implementation 'commons-io:commons-io:1.4'
implementation 'me.leolin:ShortcutBadger:1.1.4#aar'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'com.yqritc:android-scalablevideoview:1.0.1'
implementation 'commons-codec:commons-codec:1.10'
implementation 'com.segment.analytics.android:analytics:4.3.0'
implementation 'com.google.zxing:core:3.3.3'
implementation 'net.openid:appauth:0.4.1'
implementation('com.airbnb.android:lottie:2.5.5') {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
implementation('io.nlopez.smartlocation:library:3.2.11') {
transitive = false
}
implementation 'com.android.support:exifinterface:27.1.1'
implementation 'com.squareup.okio:okio:1.9.0'
implementation 'com.facebook.soloader:soloader:0.5.1'
implementation 'com.google.android.exoplayer:exoplayer:2.6.1'
implementation 'expolib_v1.com.google.android.exoplayer:expolib_v1-extension-okhttp:2.6.1#aar'
// expo-file-system
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.10.0'
// Testing
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
// We use a modified build of com.android.support.test:runner:1.0.1. Explanation in maven-test/README
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support:support-annotations:27.1.1'
androidTestImplementation 'com.google.code.findbugs:jsr305:3.0.0'
androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
androidTestImplementation 'com.azimolabs.conditionwatcher:conditionwatcher:0.2'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:1.10.19'
testImplementation 'org.robolectric:robolectric:3.8'
testImplementation 'com.android.support.test:runner:1.0.2-alpha1'
testImplementation 'com.android.support.test:rules:1.0.2-alpha1'
implementation('host.exp.exponent:expoview:32.0.0#aar') {
transitive = true
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
exclude group: 'com.squareup.okhttp3', module: 'okhttp-urlconnection'
}
api 'com.facebook.react:react-native:32.0.0'
api 'host.exp.exponent:expo-app-loader-provider:1.0.0'
api 'host.exp.exponent:expo-core:2.0.0'
api 'host.exp.exponent:expo-constants-interface:2.0.0'
api 'host.exp.exponent:expo-constants:2.0.1'
api 'host.exp.exponent:expo-errors:1.0.0'
api 'host.exp.exponent:expo-file-system-interface:2.0.0'
api 'host.exp.exponent:expo-file-system:2.0.0'
api 'host.exp.exponent:expo-image-loader-interface:2.0.0'
api 'host.exp.exponent:expo-permissions:2.0.0'
api 'host.exp.exponent:expo-permissions-interface:2.0.0'
api 'host.exp.exponent:expo-sensors-interface:2.0.0'
api 'host.exp.exponent:expo-react-native-adapter:2.0.0'
api 'host.exp.exponent:expo-task-manager:1.0.0'
api 'host.exp.exponent:expo-task-manager-interface:1.0.0'
// Optional universal modules, could be removed
// along with references in MainActivity
api 'host.exp.exponent:expo-ads-admob:2.0.0'
api 'host.exp.exponent:expo-app-auth:2.0.0'
api 'host.exp.exponent:expo-analytics-segment:2.0.0'
api 'host.exp.exponent:expo-barcode-scanner-interface:2.0.0'
api 'host.exp.exponent:expo-barcode-scanner:2.0.0'
api 'host.exp.exponent:expo-camera-interface:2.0.0'
api 'host.exp.exponent:expo-camera:2.0.0'
api 'host.exp.exponent:expo-contacts:2.0.0'
api 'host.exp.exponent:expo-face-detector:2.0.0'
api 'host.exp.exponent:expo-face-detector-interface:2.0.0'
api 'host.exp.exponent:expo-font:2.0.0'
api 'host.exp.exponent:expo-gl-cpp:2.0.0'
api 'host.exp.exponent:expo-gl:2.0.0'
api 'host.exp.exponent:expo-google-sign-in:2.0.0'
api 'host.exp.exponent:expo-local-authentication:2.0.0'
api 'host.exp.exponent:expo-localization:2.0.0'
api 'host.exp.exponent:expo-location:2.0.1'
api 'host.exp.exponent:expo-media-library:2.0.0'
api 'host.exp.exponent:expo-print:2.0.0'
api 'host.exp.exponent:expo-sensors:2.0.0'
api 'host.exp.exponent:expo-sms:2.0.0'
api 'host.exp.exponent:expo-background-fetch:1.0.0'
}
// This has to be down here for some reason
apply plugin: 'com.google.gms.google-services'
}
// This has to be down here for some reason
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true

Add
maven { // expo-camera bundles a custom
com.google.android:cameraview url
"$rootDir/../node_modules/expo-camera/android/maven" }
to build.gradle at
allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
maven { // expo-camera bundles a custom com.google.android:cameraview url
"$rootDir/../node_modules/expo-camera/android/maven" }
google()
jcenter()
maven { url 'https://jitpack.io' }
} }

This works for me.
maven { // expo-camera bundles a custom
url("$rootDir/../node_modules/expo-camera/android/maven")
}

Related

react-native build-android: "Could not find react-native.jar"

I'm currently trying to build my React Native project (using ExpoKit and several native modules) for Android on a Mac running Mojave. It's working fine on iOS. However, I'm getting Could not find react-native.jar when running react-native run-android. It's looking for a react-native-33.0.0.jar file in file:/Users/username/Documents/Projekte/appname/app/node_modules/expokit/maven/com/facebook/react/react-native/33.0.0/, however, it's not there.
This is the output of react-native info:
React Native Environment Info:
System:
OS: macOS 10.14.6
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU # 2.30GHz
Memory: 312.45 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.15.1 - /usr/local/bin/node
npm: 6.4.1 - /usr/local/bin/npm
SDKs:
iOS SDK:
Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.2
System Images: android-28 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5791312
Xcode: 10.3/10G8 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz => 0.59.8
npmGlobalPackages:
react-native-cli: 2.0.1
And my build.gradle file in android/app:
buildscript {
repositories {
google()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.26.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'devicefarm'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
android {
compileSdkVersion safeExtGet("compileSdkVersion", 28)
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId 'de.teledoctor24.android'
minSdkVersion safeExtGet("minSdkVersion", 21)
targetSdkVersion safeExtGet("targetSdkVersion", 28)
versionCode 1
versionName '1.0.2'
ndk {
abiFilters 'armeabi-v7a', 'x86'
}
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// Deprecated. Used by net.openid:appauth
manifestPlaceholders = [
'appAuthRedirectScheme': 'host.exp.exponent'
]
}
dexOptions {
javaMaxHeapSize System.getenv("DISABLE_DEX_MAX_HEAP") ? null : "8g"
}
signingConfigs {
debug {
storeFile file('../debug.keystore')
}
release {
storeFile file(System.getenv("ANDROID_KEYSTORE_PATH") ?: "release-key.jks")
storePassword System.getenv("ANDROID_KEYSTORE_PASSWORD")
keyAlias System.getenv("ANDROID_KEY_ALIAS")
keyPassword System.getenv("ANDROID_KEY_PASSWORD")
}
}
buildTypes {
debug {
debuggable true
ext.enableCrashlytics = false
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
lintOptions {
abortOnError false
}
packagingOptions {
pickFirst "**"
}
}
devicefarm {
projectName System.getenv("DEVICEFARM_PROJECT_NAME")
devicePool System.getenv("DEVICEFARM_DEVICE_POOL")
executionTimeoutMinutes 40
authentication {
accessKey System.getenv("AWS_ACCESS_KEY_ID")
secretKey System.getenv("AWS_SECRET_ACCESS_KEY")
}
}
configurations.all {
resolutionStrategy {
force 'org.webkit:android-jsc:r241213'
}
}
// WHEN_PREPARING_SHELL_REMOVE_FROM_HERE
apply from: 'expo.gradle'
// WHEN_PREPARING_SHELL_REMOVE_TO_HERE
apply from: "../../node_modules/react-native-unimodules/gradle.groovy"
dependencies {
implementation project(':tipsi-stripe')
implementation project(':react-native-twilio-video-webrtc')
implementation project(':react-native-onesignal')
implementation project(':react-native-vector-icons')
implementation project(':react-native-randombytes')
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:multidex:1.0.1'
// Our dependencies
implementation "com.android.support:appcompat-v7:$supportLibVersion"
// Our dependencies from ExpoView
// DON'T ADD ANYTHING HERE THAT ISN'T IN EXPOVIEW. ONLY COPY THINGS FROM EXPOVIEW TO HERE.
implementation "com.android.support:appcompat-v7:$supportLibVersion"
implementation 'com.facebook.android:facebook-android-sdk:5.0.1'
implementation('com.facebook.android:audience-network-sdk:5.1.1') {
exclude module: 'play-services-ads'
}
compileOnly 'org.glassfish:javax.annotation:3.1.1'
implementation 'com.jakewharton:butterknife:9.0.0'
implementation 'de.greenrobot:eventbus:2.4.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.android.gms:play-services-gcm:15.0.1'
implementation 'com.google.android.gms:play-services-analytics:16.0.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
annotationProcessor 'com.raizlabs.android:DBFlow-Compiler:2.2.1'
implementation "com.raizlabs.android:DBFlow-Core:2.2.1"
implementation "com.raizlabs.android:DBFlow:2.2.1"
implementation "com.madgag.spongycastle:core:1.53.0.0"
implementation "com.madgag.spongycastle:prov:1.53.0.0"
debugImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
implementation 'com.facebook.device.yearclass:yearclass:2.1.0'
implementation 'commons-io:commons-io:1.4'
implementation 'me.leolin:ShortcutBadger:1.1.4#aar'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'commons-codec:commons-codec:1.10'
implementation 'com.segment.analytics.android:analytics:4.3.0'
implementation 'com.google.zxing:core:3.3.3'
implementation 'net.openid:appauth:0.4.1'
implementation 'com.airbnb.android:lottie:2.5.6'
implementation('io.nlopez.smartlocation:library:3.2.11') {
transitive = false
}
implementation "com.android.support:exifinterface:${safeExtGet("supportLibVersion", "28.0.0")}"
implementation 'com.squareup.okio:okio:1.9.0'
implementation 'com.facebook.soloader:soloader:0.6.0'
// expo-file-system
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.10.0'
// Testing
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
// We use a modified build of com.android.support.test:runner:1.0.1. Explanation in maven-test/README
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation "com.android.support:support-annotations:${safeExtGet("supportLibVersion", "28.0.0")}"
androidTestImplementation 'com.google.code.findbugs:jsr305:3.0.0'
androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
androidTestImplementation 'com.azimolabs.conditionwatcher:conditionwatcher:0.2'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:1.10.19'
testImplementation 'org.robolectric:robolectric:3.8'
testImplementation 'com.android.support.test:runner:1.0.2-alpha1'
testImplementation 'com.android.support.test:rules:1.0.2-alpha1'
implementation('host.exp.exponent:expoview:33.0.0#aar') {
transitive = true
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
exclude group: 'com.squareup.okhttp3', module: 'okhttp-urlconnection'
}
api 'org.webkit:android-jsc:r241213' // needs to be before react-native
api 'com.facebook.react:react-native:33.0.0'
addUnimodulesDependencies([
modulesPaths : [
'../../node_modules'
],
configuration: 'api',
target : 'react-native',
exclude : [
// You can exclude unneeded modules here.
// By default we exclude FaceDetector
// and Stripe payments APIs.
'unimodules-face-detector-interface',
'expo-face-detector',
'expo-payments-stripe'
// Adding a name here will also remove the package
// from auto-generated BasePackageList.java
]
])
}
// This has to be down here for some reason
apply plugin: 'com.google.gms.google-services'
The problem occurs while building the react-native-randombytes module. If I comment this module out, the same error happens on other modules like react-native-twilio-video-webrtc. This is the exact error:
> Task :react-native-randombytes:javaPreCompileDebug FAILED
> Task :app:exponentPrebuildStep
Opening `/dev/tty` failed (6): Device not configured
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all files for configuration ':react-native-randombytes:debugCompileClasspath'.
> Could not find react-native.jar (com.facebook.react:react-native:33.0.0).
Searched in the following locations:
file:/Users/username/Documents/Projekte/appname/app/node_modules/expokit/maven/com/facebook/react/react-native/33.0.0/react-native-33.0.0.jar
Any help would be appreciated!
Please set the React-native version in your package.json file.
package.json
"dependencies": {
...
"react-native": "https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz",
And remove npm.lock
And rm -rf node_modules && npm install => expo start => open Android Studio => build

App is having trouble with Google Play services, please try again in ExpoKit project

I have updated ExpoKit SDK from 32 to 33 version, and I changed map from expo map to react-native-maps, I did all steps for setting up react-native-maps, however, I'm still don't see map in the app, all I see is an error message:
App is having trouble with Google Play services, please try again.
react-native-maps version is 0.24.0.
How to fix this problem?
here is my app build.gradle:
import com.android.build.OutputFile
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' } // Gradle Plugin Portal
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.1, 0.99.99]'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
buildscript {
repositories {
google()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.26.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'devicefarm'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 28
splits {
abi {
reset()
enable true
universalApk false
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
defaultConfig {
applicationId 'com.myproject'
minSdkVersion 21
targetSdkVersion 28
versionCode 29
versionName '1.1.1'
multiDexEnabled true
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
// Deprecated. Used by net.openid:appauth
manifestPlaceholders = [
'appAuthRedirectScheme': 'host.exp.exponent'
]
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) {
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
dexOptions {
javaMaxHeapSize System.getenv("DISABLE_DEX_MAX_HEAP") ? null : "8g"
}
signingConfigs {
debug {
storeFile file('../debug.keystore')
}
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
}
}
}
buildTypes {
debug {
debuggable true
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
lintOptions {
abortOnError false
}
packagingOptions {
pickFirst "**"
}
configurations.all {
resolutionStrategy.force 'androidx.appcompat:appcompat:1.0.2'
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}
devicefarm {
projectName System.getenv("DEVICEFARM_PROJECT_NAME")
devicePool System.getenv("DEVICEFARM_DEVICE_POOL")
executionTimeoutMinutes 40
authentication {
accessKey System.getenv("AWS_ACCESS_KEY_ID")
secretKey System.getenv("AWS_SECRET_ACCESS_KEY")
}
}
configurations.all {
resolutionStrategy {
force 'org.webkit:android-jsc:r224109'
}
}
// WHEN_PREPARING_SHELL_REMOVE_FROM_HERE
apply from: 'expo.gradle'
apply from: "../../node_modules/react-native-unimodules/gradle.groovy"
// WHEN_PREPARING_SHELL_REMOVE_TO_HERE
dependencies {
implementation project(':react-native-maps')
compile project(':react-native-fabric')
compile('com.crashlytics.sdk.android:crashlytics:2.10.1#aar') {
transitive = true;
}
compile project(':react-native-device-info')
compile project(':react-native-onesignal')
compile project(':react-native-wheel-picker-android')
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core:1.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core:1.0.2'
implementation 'com.facebook.android:facebook-android-sdk:4.37.0'
implementation('com.facebook.android:audience-network-sdk:4.99.0') {
exclude module: 'play-services-ads'
}
compileOnly 'org.glassfish:javax.annotation:3.1.1'
implementation 'com.jakewharton:butterknife:8.4.0'
implementation 'de.greenrobot:eventbus:2.4.0'
// Be careful when upgrading! Upgrading might break experience scoping. Check with Jesse. See Analytics.resetAmplitudeDatabaseHelper
implementation 'com.amplitude:android-sdk:2.9.2'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.android.gms:play-services-base:16.0.0'
implementation 'com.google.android.gms:play-services-gcm:16.0.0'
implementation 'com.google.android.gms:play-services-analytics:16.0.0'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-auth:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
// implementation 'com.google.android.gms:play-services-ads:16.0.1'
annotationProcessor 'com.raizlabs.android:DBFlow-Compiler:2.2.1'
implementation "com.raizlabs.android:DBFlow-Core:2.2.1"
implementation "com.raizlabs.android:DBFlow:2.2.1"
implementation "com.madgag.spongycastle:core:1.53.0.0"
implementation "com.madgag.spongycastle:prov:1.53.0.0"
debugImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
implementation 'com.facebook.device.yearclass:yearclass:2.1.0'
implementation 'commons-io:commons-io:1.4'
implementation 'me.leolin:ShortcutBadger:1.1.4#aar'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'com.yqritc:android-scalablevideoview:1.0.1'
implementation 'commons-codec:commons-codec:1.10'
implementation 'com.segment.analytics.android:analytics:4.3.0'
implementation 'com.google.zxing:core:3.3.3'
implementation 'net.openid:appauth:0.4.1'
implementation 'io.branch.sdk.android:library:2.17.1'
implementation('io.nlopez.smartlocation:library:3.2.11') {
transitive = false
}
implementation 'androidx.exifinterface:exifinterface:1.0.0'
implementation 'com.squareup.okio:okio:1.9.0'
implementation 'com.facebook.soloader:soloader:0.5.1'
implementation 'com.google.android.exoplayer:exoplayer:2.6.1'
implementation 'com.google.android.exoplayer:extension-okhttp:2.6.1'
// expo-file-system
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.10.0'
// Testing
//androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
// We use a modified build of com.android.support.test:runner:1.0.1. Explanation in maven-test/README
androidTestImplementation 'com.google.code.findbugs:jsr305:3.0.0'
androidTestImplementation 'com.azimolabs.conditionwatcher:conditionwatcher:0.2'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:1.10.19'
testImplementation 'org.robolectric:robolectric:3.8'
implementation('host.exp.exponent:expoview:33.0.0#aar') {
transitive = true
exclude group: 'com.squareup.okhttp3', module: 'okhttp'
exclude group: 'com.squareup.okhttp3', module: 'okhttp-urlconnection'
}
addUnimodulesDependencies([
modulesPaths : [
'../../node_modules'
],
configuration: 'api',
target : 'react-native',
exclude : [
'expo-av',
'expo-gl',
'expo-barcode-scanner',
'expo-mail-composers',
'expo-media-library',
'expo-sharing',
'expo-web-browser',
'expo-barcode-scanner-interface',
]
])
}
apply plugin: 'com.google.gms.google-service

Android dependency 'com.google.firebase:firebase-iid' has different version for the compile (16.0.0) and runtime (18.0.0) classpath

In my react native application i am integrating react-native-push-notification and getting this error.
app/build.gradle
android {
compileSdkVersion 27
buildToolsVersion "27.0.2"
defaultConfig {
applicationId "xxxxxxx"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
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"
}
}
// 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-push-notification')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:23.0.1"
implementation "com.google.firebase:firebase-core:16.0.1"
implementation "com.facebook.react:react-native:+" // From node_modules
}
// 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'
}
apply plugin: 'com.google.gms.google-services'
Project build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:4.0.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
google()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "27.0.2"
}
}
}
}
I tried various solutions like changing from "implementaion" to "api" , in configuration.all adding check to fetch particular version of firebase-core, but nothing worked.
React Native version is 0.55.4
I found the solution.
In my project's build.gradle buildscript->dependencies i replaced version of the google-services gradle plugin from "4.0.2" to "4.2.0" and it worked.
classpath 'com.google.gms:google-services:4.2.0'
The library react-native-push-notification has a dependency declared as '+' for the com.google.firebase:firebase-messaging in it's build.gradle. This will fetch the latest version of the library from maven repo.
This is clashing with your version declaration in your android/app/build.gradle file, which is 16.0.1.
Add this to your project level build.gradle
ext {
googlePlayServicesVersion = "[your_desired_version]"
firebaseVersion = "[your_desired_version]"
}

react-native run-android fails -- cannot find Kotlin

A problem occurred configuring project ':app'.
Could not resolve all artifacts for configuration ':app:classpath'.
Could not find org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.11.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.11/kotlin-stdlib-jdk8-1.3.11.pom
- https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.11/kotlin-stdlib-jdk8-1.3.11.jar
- https://maven.fabric.io/public/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.11/kotlin-stdlib-jdk8-1.3.11.pom
- https://maven.fabric.io/public/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.11/kotlin-stdlib-jdk8-1.3.11.jar
Required by:
project :app > com.android.tools.build:gradle:3.3.0
This stacktrace tells me that react-native is looking for Kotlin JDK for some reason. Not sure why Kotlin would be required, when everything is in Java.
I have included implementation org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.11
in my app build.gradle, exactly the same version as seen in the stack dump
app build.gradle
buildscript {
repositories {
google()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
import com.android.build.OutputFile
project.ext.react = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId 'com.recordit'
targetSdkVersion 26
minSdkVersion 16
versionCode 1
versionName '1.0.0'
ndk {
abiFilters 'armeabi-v7a', 'x86'
}
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// Deprecated. Used by net.openid:appauth
manifestPlaceholders = [
'appAuthRedirectScheme': 'host.exp.exponent'
]
}
dexOptions {
javaMaxHeapSize System.getenv("DISABLE_DEX_MAX_HEAP") ? null : "8g"
}
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"
}
}
lintOptions {
abortOnError false
}
packagingOptions {
pickFirst "**"
}
configurations.all {
resolutionStrategy.force 'com.android.support:design:27.1.0'
}
// 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(':rn-fetch-blob')
implementation project(':react-native-fs')
implementation project(':react-native-linear-gradient')
implementation project(':react-native-radial-gradient')
implementation 'com.android.support:multidex:1.0.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.3.11"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation project(':react-native-vector-icons')
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation "com.facebook.react:react-native:+" // From node_modules
}
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
and project build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version='1.1.1'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:3.2.0'
classpath 'de.undercouch:gradle-download-task:2.0.0'
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
// For non-detach
maven {
url "$rootDir/maven"
}
// For detach
maven {
url "$rootDir/../node_modules/expokit/maven"
}
maven {
// We use a modified build of com.android.support.test:runner:1.0.1. Explanation in maven-test/README
url "$rootDir/maven-test"
}
maven {
url 'https://maven.google.com'
}
jcenter()
maven {
// Local Maven repo containing AARs with JSC built for Android
url "$rootDir/../home/node_modules/jsc-android/android"
}
flatDir {
dirs 'libs'
// dirs project(':expoview').file('libs')
}
maven { url "https://jitpack.io" }
// Want this last so that we never end up with a stale cache
mavenLocal()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

React native build cannot find jar

We have a project, which compiles and run for everybody EXCEPT me. I have exactly the same code, I try to run it exactly the same way, but the log says:
FAILURE: Build failed with an exception.
What went wrong: Could not resolve all files for configuration ':react-native-camera:debugCompileClasspath'.
> Could not find core.jar (com.google.zxing:core:3.3.0). Searched in the following locations:
https://artifactory.mycompany.eu/artifactory/mvn-libs-all/com/google/zxing/core/3.3.0/core-3.3.0.jar
I changed the url above (only the company name), but i checked, and the jar is presented there.
This jar is necessary for react-native-camera node module.
I have already:
run npm cache clean --force
run gradlew clean
deleted the whole project, checked out the source code, installed
node modules, tried to run
But nothing helped.
EDIT:
project/build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
rootProject.ext.isRelease = project.hasProperty('buildForDebug')? false:true
def RNfile = new File("$rootDir/node_modules/react-native/package.json")
rootProject.ext.rnVersion = new groovy.json.JsonSlurper().parseText(RNfile.text).version
artifactId = project.artifactId
allprojects {
println "release $isRelease"
//version = "${project.version}-${isRelease ? project.property('build.number') : 'SNAPSHOT'}"
version = "${project.version}-${ project.hasProperty('build.number') ? project.property('build.number') : '0'}"
group = project.groupId
println "coordinates: $group:$artifactId:$version"
}
buildscript {
repositories {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
}
}
allprojects {
configurations.all {
resolutionStrategy {
eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'com.facebook.react' && details.requested.name == 'react-native') {
details.useVersion rootProject.ext.rnVersion
}
}
}
}
repositories {
mavenLocal()
google()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/node_modules/react-native/android"
}
}
}
subprojects { project ->
afterEvaluate {
if (project.name.contains('react-native-')) {
project.tasks.collect { task ->
if (task.name == 'lint') {
task.enabled = false
}
}
}
}
}
project/android/app/build.gradle
project.ext.androidSignKeystorePassword = (project.hasProperty('keystorePassword'))? project.property('keystorePassword') : System.properties['android.keystorePassword']
project.ext.androidSignKeyPassword = (project.hasProperty('keyPassword'))? project.property('keyPassword') : System.properties['android.keyPassword']
project.ext.androidSignKeyAlias = (project.hasProperty('keyAlias'))? project.property('keyAlias') : System.properties['android.keyAlias']
configurations {
keystore
}
dependencies {
keystore "eu.dorsum.cm.config:jenkins-android-keystore:1#jks"
}
rootProject.ext.signApp = project.hasProperty('signKeyAlias') && project.hasProperty('keystore-android-password')
buildscript {
repositories {
google()
maven {
url "https://maven.google.com"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.google.gms:google-services:4.1.0'
}
}
allprojects {
repositories {
mavenLocal()
google()
maven {
url "https://maven.google.com"
}
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/node_modules/react-native/android"
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
configurations.all {
resolutionStrategy {
eachDependency { DependencyResolveDetails details ->
if (details.requested.group == 'com.facebook.react' && details.requested.name == 'react-native') {
details.useVersion rootProject.ext.rnVersion
}
}
}
}
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "26.1.0"
}
}
}
}
apply plugin: "com.android.application"
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
import com.android.build.OutputFile
project.ext.react = [
root: "$rootDir",
entryFile: "index.js"
]
apply from: "$rootDir/node_modules/react-native/react.gradle"
apply from: "$rootDir/node_modules/react-native-vector-icons/fonts.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "com.dbit"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName project.version
ndk {
abiFilters "armeabi-v7a", "x86"
}
if (!project.hasProperty('buildForDebug')) {
archivesBaseName = "${rootProject.name}-${versionName}"
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
signingConfigs {
release {
storeFile files(project.configurations.keystore.collect { it }).singleFile
storePassword project.ext.androidSignKeystorePassword
keyAlias project.ext.androidSignKeyAlias
keyPassword project.ext.androidSignKeyPassword
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
debug {
signingConfig signingConfigs.release
}
}
variantFilter { variant ->
// ignores unwanted build types
// no release type from development branch, no debug type from release branch
// (ignore = release type XOR release version)
setIgnore(variant.buildType.name.equals('release') ^ isRelease)
}
// 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
}
}
}
lintOptions {
abortOnError false
}
}
dependencies {
implementation project(':react-native-view-overflow')
implementation project(':react-native-vector-icons')
implementation project(':react-native-linear-gradient')
implementation project(':react-native-fcm')
implementation 'com.google.firebase:firebase-core'
implementation 'com.google.firebase:firebase-messaging'
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:27.0.3"
implementation "com.facebook.react:react-native:${rootProject.ext.rnVersion}" // From node_modules
implementation (project(':react-native-camera')) {
exclude group: "com.google.android.gms"
implementation 'com.android.support:exifinterface:27.1.0'
implementation ('com.google.android.gms:play-services-vision:12.0.1') {
force = true
}
}
}
// 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.implementation
into 'libs'
}
If you have any suggestion, it would be highly appreciated.
I think you miss repository in Gradle to get com.google.zxing:core:3.3.0
You need open Android Studio with project in folder /android of your react-native project.
and edit file build.gradle of project
like this
and add google() and jcenter() to respository of buildscript and allprojects
like this
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
In my case the solution was running the following command in the projectName/android folder:
gradlew cleanBuildCache
The strange thing for me is that gradlew clean was not enough.
According to this documentation https://developer.android.com/studio/build/build-cache#clear_the_build_cache:
"Similar to the Android plugin's clean task that clears your project’s
build/ directories, you can run the cleanBuildCache task to clear your
project’s build cache."
Based on this information, it is obvious that something went wrong in my build cache and that caused the problem.
I also had to delete the node_modules folder, and install all node modules again.