androidreactjsreact-nativegradleintercom

Could not find com.google.android:flexbox:1.0.0 react-native-intercom


I have a react-native project. After the bitnary (jcenter) shutted down I started to replace it. Currently I'm using mavenCentral(). Also I'm using the react-native-intercom (wrapper for intercom). When I'm trying to build gradlew assembleRelease. Its throws me an error.

Could not determine the dependencies of task ':app:compileReleaseJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:releaseCompileClasspath'.
   > Could not find com.google.android:flexbox:1.0.0.
     Required by:
         project :app > io.intercom.android:intercom-sdk-base:5.5.1

I saw the solution, but it didn't help. this one

My files: (if you need more information let me know <3)

build.gradle(app):

apply plugin: "com.android.application"

import com.android.build.OutputFile
import com.sun.org.apache.xalan.internal.xsltc.compiler.Copy


instead
project.ext.react = [
        entryFile: "index.js",
        enableHermes: false,  // clean and rebuild if changing
        bundleInBeta: true,
        bundleInStaging: true,
        devDisabledInBeta: true,
        devDisabledInStaging: true,
        extraPackagerArgs: ["--max-workers=1"]
]

apply from: "../../node_modules/react-native/react.gradle"
def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false
def jscFlavor = 'org.webkit:android-jsc:+'

def enableHermes = project.ext.react.get("enableHermes", false);

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    buildToolsVersion '29.0.2'

    defaultConfig {
        applicationId "se.welcomeapp.android"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 5955
        versionName "5.9.55"

        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
        missingDimensionStrategy 'react-native-camera', 'general'
    }
    splits {
        abi {
            reset()
            enable enableSeparateBuildPerCPUArchitecture
            universalApk false  // If true, also generate a universal APK
            include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
    }
    signingConfigs {
        release {
            storeFile file("welcome_keystore.jks")
            storePassword "DjU@y!@6C^qYqYaGyQCo"
            keyAlias "live"
            keyPassword "mX7!&@RZiD2^5ZaWkKAV"
        }
    }
    buildTypes {
        debug {
            applicationIdSuffix ".debug"
            manifestPlaceholders = [isDebug:true]
        }
        beta {
            manifestPlaceholders = [isDebug:false]
            applicationIdSuffix ".beta"
            matchingFallbacks = [ 'release']
            signingConfig signingConfigs.release
        }
        staging {
            manifestPlaceholders = [isDebug:false]
            applicationIdSuffix ".staging"
            matchingFallbacks = [ 'release']
            signingConfig signingConfigs.release
        }
        release {
            manifestPlaceholders = [isDebug:false]
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
            signingConfig signingConfigs.release
        }
    }
    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) {  // null for the universal-debug, universal-release variants
                output.versionCodeOverride =
                        versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
            }
        }
    }

    dexOptions {
        preDexLibraries false
        javaMaxHeapSize "3g"
    }

    packagingOptions {
        pickFirst '**/libjsc.so'
        pickFirst '**/libc++_shared.so'
        pickFirst '**/armeabi-v7a/libc++_shared.so'
        pickFirst '**/x86/libc++_shared.so'
        pickFirst '**/arm64-v8a/libc++_shared.so'
        pickFirst '**/x86_64/libc++_shared.so'
        pickFirst '**/x86/libjsc.so'
        pickFirst '**/armeabi-v7a/libjsc.so'
    }
}

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.28.1'
    }
}

apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}

dependencies {
    implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
    implementation "com.facebook.react:react-native:+"
    implementation project(':react-native-amplitude-analytics')
    implementation project(':react-native-color-matrix-image-filters')
    implementation project(':react-native-pdf')
    implementation project(':rn-fetch-blob')
    implementation project(':react-native-document-picker')
    implementation project(':react-native-sound')
    implementation project(':react-native-audio')
    implementation project(':react-native-branch')
    implementation "org.webkit:android-jsc:r241213"
    implementation project(':@react-native-community_async-storage')
    implementation project(':react-native-svg')
    implementation project(':react-native-webview')
    implementation project(':@react-native-community_netinfo')
    implementation project(':react-native-keychain')
    implementation project(':react-native-share')
    implementation project(':react-native-intercom')
    implementation(project(':react-native-firebase')) {
        transitive = false
    }
    implementation(project(':react-native-maps')){
        exclude group: 'com.google.android.gms', module: 'play-services-base'
        exclude group: 'com.google.android.gms', module: 'play-services-maps'
    }
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
    implementation(project(':react-native-geolocation-service')) {
        exclude group: 'com.google.android.gms', module: 'play-services-location'
    }
    implementation 'com.google.android.gms:play-services-location:17.0.0'

    implementation project(':react-native-image-crop-picker')
    implementation project(':react-native-fs')
    implementation project(':react-native-open-settings')
    implementation project(':react-native-linear-gradient')
    implementation project(':bugsnag-react-native')
    implementation project(':react-native-device-info')
    implementation project(':react-native-push-notification')
    implementation project(':react-native-geocoder')
    implementation project(':react-native-vector-icons')
    implementation project(':react-native-i18n')
    implementation project(':react-native-fbsdk')
    implementation project(':react-native-camera')
    provided fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.2.1'
    implementation "com.android.support:appcompat-v7:28.0.0"
    implementation "com.android.support:design:28.0.0"

    implementation("com.facebook.react:react-native:0.60.4") {
        // enforce version to fix https://github.com/facebook/react-native/issues/19259
        // if someone send a version of react-native to jcenter, it will use the one
        // from jcenter first before node_modules
        force = true
    }

    if (enableHermes) {
        def hermesPath = "../../node_modules/hermesvm/android/";
        debugImplementation files(hermesPath + "hermes-debug.aar")
        releaseImplementation files(hermesPath + "hermes-release.aar")
    } else {
        implementation jscFlavor
    }

    implementation 'io.github.inflationx:calligraphy3:3.1.1'
    implementation 'io.github.inflationx:viewpump:2.0.3'
    implementation('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true;
    }

    // Firebase dependencies
    implementation "com.google.android.gms:play-services-base:17.0.0"
    implementation "com.google.firebase:firebase-core:17.0.1"
    implementation "com.google.firebase:firebase-messaging:20.2.4"
    implementation "com.google.firebase:firebase-analytics:17.0.1"

    // Intercom with Firebase dependencies
    implementation 'io.intercom.android:intercom-sdk-base:5.5.1'
    implementation 'io.intercom.android:intercom-sdk-fcm:5.+'

    // If your app supports Android versions before Ice Cream Sandwich (API level 14)
    // TODO: upgrade these to 1.3.0 and test if it solves the crash on samsung for animated gifs
    implementation 'com.facebook.fresco:animated-base-support:1.0.1'  // For animated GIF support
    implementation 'com.facebook.fresco:animated-webp:1.0.1'
    implementation 'com.facebook.fresco:animated-gif:1.0.1'
    implementation 'com.facebook.fresco:webpsupport:1.0.1'
    implementation 'com.android.support:multidex:1.0.3'

}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

task wrapper(type: Wrapper) {
    gradleVersion = '5.4.1'
}

apply plugin: 'com.google.gms.google-services'

build.gradle (android):

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
        ext {
                buildToolsVersion = "29.0.2"
                minSdkVersion = 16
                compileSdkVersion = 29
                targetSdkVersion = 29
        }
        repositories {
                google()
                mavenCentral()
        }
        dependencies {
                classpath 'com.android.tools.build:gradle:3.5.3'
                classpath 'com.google.gms:google-services:4.2.0'

            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
}

allprojects {
        repositories {
                google()
                mavenCentral()
                maven { url "$rootDir/../node_modules/react-native/android" }
//              maven { url 'https://maven.google.com' }
                maven {
                    url "https://jitpack.io"
                    credentials { username authToken }
                }
                maven { url "$rootDir/../node_modules/jsc-android/dist" }
        }
}

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 29
                buildToolsVersion "29.0.2"
            }
        }
    }
    project.configurations.all {
        resolutionStrategy {
            eachDependency { details ->
                if (requested.group == 'com.android.support') {
                    if (requested.name.startsWith("support-v4")) {
                        details.useVersion '29.0.0'
                    }
                }
            }
        }
    }
}


Solution

  • I solved it. If you are using the react-native-intercom wrapper. You need to update it, after update everything works fine