Error: more than one library with package name using react-native-intercom










0















My project compiled fine 2 days ago, but all day yesterday and today I can't seem to get the android app to build.



I've tried pulling from my repo back as far as 2 weeks ago and still get the same build error. The iOS build works fine.



The versions used to be 26 but I changed them trying to get the build to go through. I think the specific dependency that was duplicated changed when I did this, but otherwise these files are more or less like they were before I started trying to get this to work.



I honestly can't put all the steps I've tried because its been 2 days of google/stackoverflow/github issues and following suggestions there - most of which involved upgrading the sdk versions like I have.



Any commit that includes intercom has the same problem building, but up until 2 days ago I wasn't having any issue building with intercom.



This is the last couple of lines of my react-native run-android output:



:react-native-intercom:processReleaseResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-intercom:processReleaseResources'.
> Error: more than one library with package name 'android.support.graphics.drawable'


My android/build.gradle :



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

buildscript
repositories
jcenter()

dependencies
classpath 'com.android.tools.build:gradle:2.2.3'

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




subprojects
afterEvaluate project ->
if (project.hasProperty("android"))
android
compileSdkVersion 28
buildToolsVersion '28.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"

maven url 'https://maven.google.com'




My android/app/build.gradle:



apply plugin: "com.android.application"

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


dependencies
// These docs use an open ended version so that our plugin
// can be updated quickly in response to Android tooling updates

// We recommend changing it to the latest version from our changelog:
// https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
classpath 'io.fabric.tools:gradle:1.+'



apply plugin: "com.android.application"
apply plugin: 'io.fabric'
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"

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


import com.android.build.OutputFile

/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation
* entryFile: "index.android.js",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn$productFlavor$buildType'
* // 'bundleIn$buildType'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn$productFlavor$buildType'
* // 'devDisabledIn$buildType'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs:
* ]
*/

project.ext.react = [
entryFile: "index.js"
]

project.ext.versionName = "1.0.0"

apply from: "../../node_modules/react-native/react.gradle"
apply from: "../../node_modules/react-native-code-push/android/codepush.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

def generateVersionCode() value.length() < 1 )
def versionCode = 0
return versionCode
else
def versionCode = value.toInteger()
return versionCode




def generateVersionName()
def envValue = System.getenv('APP_VERSION_NAME')
if (envValue && envValue != "")
return envValue
else
return project.hasProperty('versionName') ? project.property('versionName') : '0.0.0'



android
compileSdkVersion 28
buildToolsVersion "28.0.0"

signingConfigs
if (System.getenv('IS_JENKINS')=="yes")
release
storeFile file(System.getenv('APP_KEYSTORE_PATH'))
storePassword System.getenv('APP_KEYSTORE_PASS')
keyAlias 'something'
keyPassword System.getenv('APP_KEYSTORE_PASS')

else
release
keyAlias 'xxx'
keyPassword 'xxx'
storeFile file('xxx')
storePassword 'xxx'




defaultConfig
applicationId "com.insiderealestate.kvCore"
minSdkVersion 16
targetSdkVersion 28
versionCode generateVersionCode()
versionName generateVersionName()
multiDexEnabled true
ndk
abiFilters "armeabi-v7a", "x86"


splits
abi
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"


buildTypes
debug
// Note: CodePush updates should not be tested in Debug mode as they are overriden by the RN packager. However, because CodePush checks for updates in all modes, we must supply a key.
buildConfigField "String", "CODEPUSH_KEY", '""'
applicationIdSuffix ".debug"


releaseStaging
buildConfigField "String", "CODEPUSH_KEY", '""'
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release

release
buildConfigField "String", "CODEPUSH_KEY", '""'
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
compile project(':react-native-code-push')
compile project(':appcenter-crashes')
compile project(':appcenter-analytics')
compile project(':appcenter')
compile (project(':react-native-intercom'))
exclude group: 'com.android.support.graphics.drawable'

compile project(':bugsnag-react-native')
compile project(':react-native-sms')
compile project(':react-native-linear-gradient')
compile project(':react-native-immediate-phone-call')
compile project(':react-native-fabric')
compile project(':react-native-config')
compile project(':react-native-i18n')
compile project(':react-native-vector-icons')
compile project(':react-native-device-info')
compile fileTree(dir: "libs", include: ["*.jar"])
compile 'com.android.support:appcompat-v7:28.0.0'
compile "com.facebook.react:react-native:+" // From node_modules
compile('com.crashlytics.sdk.android:crashlytics:2.8.0@aar')
transitive = true;

compile 'io.intercom.android:intercom-sdk-base:5.+'


// 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'










share|improve this question


























    0















    My project compiled fine 2 days ago, but all day yesterday and today I can't seem to get the android app to build.



    I've tried pulling from my repo back as far as 2 weeks ago and still get the same build error. The iOS build works fine.



    The versions used to be 26 but I changed them trying to get the build to go through. I think the specific dependency that was duplicated changed when I did this, but otherwise these files are more or less like they were before I started trying to get this to work.



    I honestly can't put all the steps I've tried because its been 2 days of google/stackoverflow/github issues and following suggestions there - most of which involved upgrading the sdk versions like I have.



    Any commit that includes intercom has the same problem building, but up until 2 days ago I wasn't having any issue building with intercom.



    This is the last couple of lines of my react-native run-android output:



    :react-native-intercom:processReleaseResources FAILED

    FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':react-native-intercom:processReleaseResources'.
    > Error: more than one library with package name 'android.support.graphics.drawable'


    My android/build.gradle :



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

    buildscript
    repositories
    jcenter()

    dependencies
    classpath 'com.android.tools.build:gradle:2.2.3'

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




    subprojects
    afterEvaluate project ->
    if (project.hasProperty("android"))
    android
    compileSdkVersion 28
    buildToolsVersion '28.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"

    maven url 'https://maven.google.com'




    My android/app/build.gradle:



    apply plugin: "com.android.application"

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


    dependencies
    // These docs use an open ended version so that our plugin
    // can be updated quickly in response to Android tooling updates

    // We recommend changing it to the latest version from our changelog:
    // https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
    classpath 'io.fabric.tools:gradle:1.+'



    apply plugin: "com.android.application"
    apply plugin: 'io.fabric'
    apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"

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


    import com.android.build.OutputFile

    /**
    * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
    * and bundleReleaseJsAndAssets).
    * These basically call `react-native bundle` with the correct arguments during the Android build
    * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
    * bundle directly from the development server. Below you can see all the possible configurations
    * and their defaults. If you decide to add a configuration block, make sure to add it before the
    * `apply from: "../../node_modules/react-native/react.gradle"` line.
    *
    * project.ext.react = [
    * // the name of the generated asset file containing your JS bundle
    * bundleAssetName: "index.android.bundle",
    *
    * // the entry file for bundle generation
    * entryFile: "index.android.js",
    *
    * // whether to bundle JS and assets in debug mode
    * bundleInDebug: false,
    *
    * // whether to bundle JS and assets in release mode
    * bundleInRelease: true,
    *
    * // whether to bundle JS and assets in another build variant (if configured).
    * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
    * // The configuration property can be in the following formats
    * // 'bundleIn$productFlavor$buildType'
    * // 'bundleIn$buildType'
    * // bundleInFreeDebug: true,
    * // bundleInPaidRelease: true,
    * // bundleInBeta: true,
    *
    * // whether to disable dev mode in custom build variants (by default only disabled in release)
    * // for example: to disable dev mode in the staging build type (if configured)
    * devDisabledInStaging: true,
    * // The configuration property can be in the following formats
    * // 'devDisabledIn$productFlavor$buildType'
    * // 'devDisabledIn$buildType'
    *
    * // the root of your project, i.e. where "package.json" lives
    * root: "../../",
    *
    * // where to put the JS bundle asset in debug mode
    * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
    *
    * // where to put the JS bundle asset in release mode
    * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
    *
    * // where to put drawable resources / React Native assets, e.g. the ones you use via
    * // require('./image.png')), in debug mode
    * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
    *
    * // where to put drawable resources / React Native assets, e.g. the ones you use via
    * // require('./image.png')), in release mode
    * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
    *
    * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
    * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
    * // date; if you have any other folders that you want to ignore for performance reasons (gradle
    * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
    * // for example, you might want to remove it from here.
    * inputExcludes: ["android/**", "ios/**"],
    *
    * // override which node gets called and with what additional arguments
    * nodeExecutableAndArgs: ["node"],
    *
    * // supply additional arguments to the packager
    * extraPackagerArgs:
    * ]
    */

    project.ext.react = [
    entryFile: "index.js"
    ]

    project.ext.versionName = "1.0.0"

    apply from: "../../node_modules/react-native/react.gradle"
    apply from: "../../node_modules/react-native-code-push/android/codepush.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

    def generateVersionCode() value.length() < 1 )
    def versionCode = 0
    return versionCode
    else
    def versionCode = value.toInteger()
    return versionCode




    def generateVersionName()
    def envValue = System.getenv('APP_VERSION_NAME')
    if (envValue && envValue != "")
    return envValue
    else
    return project.hasProperty('versionName') ? project.property('versionName') : '0.0.0'



    android
    compileSdkVersion 28
    buildToolsVersion "28.0.0"

    signingConfigs
    if (System.getenv('IS_JENKINS')=="yes")
    release
    storeFile file(System.getenv('APP_KEYSTORE_PATH'))
    storePassword System.getenv('APP_KEYSTORE_PASS')
    keyAlias 'something'
    keyPassword System.getenv('APP_KEYSTORE_PASS')

    else
    release
    keyAlias 'xxx'
    keyPassword 'xxx'
    storeFile file('xxx')
    storePassword 'xxx'




    defaultConfig
    applicationId "com.insiderealestate.kvCore"
    minSdkVersion 16
    targetSdkVersion 28
    versionCode generateVersionCode()
    versionName generateVersionName()
    multiDexEnabled true
    ndk
    abiFilters "armeabi-v7a", "x86"


    splits
    abi
    reset()
    enable enableSeparateBuildPerCPUArchitecture
    universalApk false // If true, also generate a universal APK
    include "armeabi-v7a", "x86"


    buildTypes
    debug
    // Note: CodePush updates should not be tested in Debug mode as they are overriden by the RN packager. However, because CodePush checks for updates in all modes, we must supply a key.
    buildConfigField "String", "CODEPUSH_KEY", '""'
    applicationIdSuffix ".debug"


    releaseStaging
    buildConfigField "String", "CODEPUSH_KEY", '""'
    minifyEnabled enableProguardInReleaseBuilds
    proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
    signingConfig signingConfigs.release

    release
    buildConfigField "String", "CODEPUSH_KEY", '""'
    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
    compile project(':react-native-code-push')
    compile project(':appcenter-crashes')
    compile project(':appcenter-analytics')
    compile project(':appcenter')
    compile (project(':react-native-intercom'))
    exclude group: 'com.android.support.graphics.drawable'

    compile project(':bugsnag-react-native')
    compile project(':react-native-sms')
    compile project(':react-native-linear-gradient')
    compile project(':react-native-immediate-phone-call')
    compile project(':react-native-fabric')
    compile project(':react-native-config')
    compile project(':react-native-i18n')
    compile project(':react-native-vector-icons')
    compile project(':react-native-device-info')
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile 'com.android.support:appcompat-v7:28.0.0'
    compile "com.facebook.react:react-native:+" // From node_modules
    compile('com.crashlytics.sdk.android:crashlytics:2.8.0@aar')
    transitive = true;

    compile 'io.intercom.android:intercom-sdk-base:5.+'


    // 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'










    share|improve this question
























      0












      0








      0








      My project compiled fine 2 days ago, but all day yesterday and today I can't seem to get the android app to build.



      I've tried pulling from my repo back as far as 2 weeks ago and still get the same build error. The iOS build works fine.



      The versions used to be 26 but I changed them trying to get the build to go through. I think the specific dependency that was duplicated changed when I did this, but otherwise these files are more or less like they were before I started trying to get this to work.



      I honestly can't put all the steps I've tried because its been 2 days of google/stackoverflow/github issues and following suggestions there - most of which involved upgrading the sdk versions like I have.



      Any commit that includes intercom has the same problem building, but up until 2 days ago I wasn't having any issue building with intercom.



      This is the last couple of lines of my react-native run-android output:



      :react-native-intercom:processReleaseResources FAILED

      FAILURE: Build failed with an exception.

      * What went wrong:
      Execution failed for task ':react-native-intercom:processReleaseResources'.
      > Error: more than one library with package name 'android.support.graphics.drawable'


      My android/build.gradle :



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

      buildscript
      repositories
      jcenter()

      dependencies
      classpath 'com.android.tools.build:gradle:2.2.3'

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




      subprojects
      afterEvaluate project ->
      if (project.hasProperty("android"))
      android
      compileSdkVersion 28
      buildToolsVersion '28.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"

      maven url 'https://maven.google.com'




      My android/app/build.gradle:



      apply plugin: "com.android.application"

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


      dependencies
      // These docs use an open ended version so that our plugin
      // can be updated quickly in response to Android tooling updates

      // We recommend changing it to the latest version from our changelog:
      // https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
      classpath 'io.fabric.tools:gradle:1.+'



      apply plugin: "com.android.application"
      apply plugin: 'io.fabric'
      apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"

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


      import com.android.build.OutputFile

      /**
      * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
      * and bundleReleaseJsAndAssets).
      * These basically call `react-native bundle` with the correct arguments during the Android build
      * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
      * bundle directly from the development server. Below you can see all the possible configurations
      * and their defaults. If you decide to add a configuration block, make sure to add it before the
      * `apply from: "../../node_modules/react-native/react.gradle"` line.
      *
      * project.ext.react = [
      * // the name of the generated asset file containing your JS bundle
      * bundleAssetName: "index.android.bundle",
      *
      * // the entry file for bundle generation
      * entryFile: "index.android.js",
      *
      * // whether to bundle JS and assets in debug mode
      * bundleInDebug: false,
      *
      * // whether to bundle JS and assets in release mode
      * bundleInRelease: true,
      *
      * // whether to bundle JS and assets in another build variant (if configured).
      * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
      * // The configuration property can be in the following formats
      * // 'bundleIn$productFlavor$buildType'
      * // 'bundleIn$buildType'
      * // bundleInFreeDebug: true,
      * // bundleInPaidRelease: true,
      * // bundleInBeta: true,
      *
      * // whether to disable dev mode in custom build variants (by default only disabled in release)
      * // for example: to disable dev mode in the staging build type (if configured)
      * devDisabledInStaging: true,
      * // The configuration property can be in the following formats
      * // 'devDisabledIn$productFlavor$buildType'
      * // 'devDisabledIn$buildType'
      *
      * // the root of your project, i.e. where "package.json" lives
      * root: "../../",
      *
      * // where to put the JS bundle asset in debug mode
      * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
      *
      * // where to put the JS bundle asset in release mode
      * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
      *
      * // where to put drawable resources / React Native assets, e.g. the ones you use via
      * // require('./image.png')), in debug mode
      * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
      *
      * // where to put drawable resources / React Native assets, e.g. the ones you use via
      * // require('./image.png')), in release mode
      * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
      *
      * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
      * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
      * // date; if you have any other folders that you want to ignore for performance reasons (gradle
      * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
      * // for example, you might want to remove it from here.
      * inputExcludes: ["android/**", "ios/**"],
      *
      * // override which node gets called and with what additional arguments
      * nodeExecutableAndArgs: ["node"],
      *
      * // supply additional arguments to the packager
      * extraPackagerArgs:
      * ]
      */

      project.ext.react = [
      entryFile: "index.js"
      ]

      project.ext.versionName = "1.0.0"

      apply from: "../../node_modules/react-native/react.gradle"
      apply from: "../../node_modules/react-native-code-push/android/codepush.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

      def generateVersionCode() value.length() < 1 )
      def versionCode = 0
      return versionCode
      else
      def versionCode = value.toInteger()
      return versionCode




      def generateVersionName()
      def envValue = System.getenv('APP_VERSION_NAME')
      if (envValue && envValue != "")
      return envValue
      else
      return project.hasProperty('versionName') ? project.property('versionName') : '0.0.0'



      android
      compileSdkVersion 28
      buildToolsVersion "28.0.0"

      signingConfigs
      if (System.getenv('IS_JENKINS')=="yes")
      release
      storeFile file(System.getenv('APP_KEYSTORE_PATH'))
      storePassword System.getenv('APP_KEYSTORE_PASS')
      keyAlias 'something'
      keyPassword System.getenv('APP_KEYSTORE_PASS')

      else
      release
      keyAlias 'xxx'
      keyPassword 'xxx'
      storeFile file('xxx')
      storePassword 'xxx'




      defaultConfig
      applicationId "com.insiderealestate.kvCore"
      minSdkVersion 16
      targetSdkVersion 28
      versionCode generateVersionCode()
      versionName generateVersionName()
      multiDexEnabled true
      ndk
      abiFilters "armeabi-v7a", "x86"


      splits
      abi
      reset()
      enable enableSeparateBuildPerCPUArchitecture
      universalApk false // If true, also generate a universal APK
      include "armeabi-v7a", "x86"


      buildTypes
      debug
      // Note: CodePush updates should not be tested in Debug mode as they are overriden by the RN packager. However, because CodePush checks for updates in all modes, we must supply a key.
      buildConfigField "String", "CODEPUSH_KEY", '""'
      applicationIdSuffix ".debug"


      releaseStaging
      buildConfigField "String", "CODEPUSH_KEY", '""'
      minifyEnabled enableProguardInReleaseBuilds
      proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
      signingConfig signingConfigs.release

      release
      buildConfigField "String", "CODEPUSH_KEY", '""'
      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
      compile project(':react-native-code-push')
      compile project(':appcenter-crashes')
      compile project(':appcenter-analytics')
      compile project(':appcenter')
      compile (project(':react-native-intercom'))
      exclude group: 'com.android.support.graphics.drawable'

      compile project(':bugsnag-react-native')
      compile project(':react-native-sms')
      compile project(':react-native-linear-gradient')
      compile project(':react-native-immediate-phone-call')
      compile project(':react-native-fabric')
      compile project(':react-native-config')
      compile project(':react-native-i18n')
      compile project(':react-native-vector-icons')
      compile project(':react-native-device-info')
      compile fileTree(dir: "libs", include: ["*.jar"])
      compile 'com.android.support:appcompat-v7:28.0.0'
      compile "com.facebook.react:react-native:+" // From node_modules
      compile('com.crashlytics.sdk.android:crashlytics:2.8.0@aar')
      transitive = true;

      compile 'io.intercom.android:intercom-sdk-base:5.+'


      // 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'










      share|improve this question














      My project compiled fine 2 days ago, but all day yesterday and today I can't seem to get the android app to build.



      I've tried pulling from my repo back as far as 2 weeks ago and still get the same build error. The iOS build works fine.



      The versions used to be 26 but I changed them trying to get the build to go through. I think the specific dependency that was duplicated changed when I did this, but otherwise these files are more or less like they were before I started trying to get this to work.



      I honestly can't put all the steps I've tried because its been 2 days of google/stackoverflow/github issues and following suggestions there - most of which involved upgrading the sdk versions like I have.



      Any commit that includes intercom has the same problem building, but up until 2 days ago I wasn't having any issue building with intercom.



      This is the last couple of lines of my react-native run-android output:



      :react-native-intercom:processReleaseResources FAILED

      FAILURE: Build failed with an exception.

      * What went wrong:
      Execution failed for task ':react-native-intercom:processReleaseResources'.
      > Error: more than one library with package name 'android.support.graphics.drawable'


      My android/build.gradle :



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

      buildscript
      repositories
      jcenter()

      dependencies
      classpath 'com.android.tools.build:gradle:2.2.3'

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




      subprojects
      afterEvaluate project ->
      if (project.hasProperty("android"))
      android
      compileSdkVersion 28
      buildToolsVersion '28.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"

      maven url 'https://maven.google.com'




      My android/app/build.gradle:



      apply plugin: "com.android.application"

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


      dependencies
      // These docs use an open ended version so that our plugin
      // can be updated quickly in response to Android tooling updates

      // We recommend changing it to the latest version from our changelog:
      // https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
      classpath 'io.fabric.tools:gradle:1.+'



      apply plugin: "com.android.application"
      apply plugin: 'io.fabric'
      apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"

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


      import com.android.build.OutputFile

      /**
      * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
      * and bundleReleaseJsAndAssets).
      * These basically call `react-native bundle` with the correct arguments during the Android build
      * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
      * bundle directly from the development server. Below you can see all the possible configurations
      * and their defaults. If you decide to add a configuration block, make sure to add it before the
      * `apply from: "../../node_modules/react-native/react.gradle"` line.
      *
      * project.ext.react = [
      * // the name of the generated asset file containing your JS bundle
      * bundleAssetName: "index.android.bundle",
      *
      * // the entry file for bundle generation
      * entryFile: "index.android.js",
      *
      * // whether to bundle JS and assets in debug mode
      * bundleInDebug: false,
      *
      * // whether to bundle JS and assets in release mode
      * bundleInRelease: true,
      *
      * // whether to bundle JS and assets in another build variant (if configured).
      * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
      * // The configuration property can be in the following formats
      * // 'bundleIn$productFlavor$buildType'
      * // 'bundleIn$buildType'
      * // bundleInFreeDebug: true,
      * // bundleInPaidRelease: true,
      * // bundleInBeta: true,
      *
      * // whether to disable dev mode in custom build variants (by default only disabled in release)
      * // for example: to disable dev mode in the staging build type (if configured)
      * devDisabledInStaging: true,
      * // The configuration property can be in the following formats
      * // 'devDisabledIn$productFlavor$buildType'
      * // 'devDisabledIn$buildType'
      *
      * // the root of your project, i.e. where "package.json" lives
      * root: "../../",
      *
      * // where to put the JS bundle asset in debug mode
      * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
      *
      * // where to put the JS bundle asset in release mode
      * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
      *
      * // where to put drawable resources / React Native assets, e.g. the ones you use via
      * // require('./image.png')), in debug mode
      * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
      *
      * // where to put drawable resources / React Native assets, e.g. the ones you use via
      * // require('./image.png')), in release mode
      * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
      *
      * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
      * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
      * // date; if you have any other folders that you want to ignore for performance reasons (gradle
      * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
      * // for example, you might want to remove it from here.
      * inputExcludes: ["android/**", "ios/**"],
      *
      * // override which node gets called and with what additional arguments
      * nodeExecutableAndArgs: ["node"],
      *
      * // supply additional arguments to the packager
      * extraPackagerArgs:
      * ]
      */

      project.ext.react = [
      entryFile: "index.js"
      ]

      project.ext.versionName = "1.0.0"

      apply from: "../../node_modules/react-native/react.gradle"
      apply from: "../../node_modules/react-native-code-push/android/codepush.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

      def generateVersionCode() value.length() < 1 )
      def versionCode = 0
      return versionCode
      else
      def versionCode = value.toInteger()
      return versionCode




      def generateVersionName()
      def envValue = System.getenv('APP_VERSION_NAME')
      if (envValue && envValue != "")
      return envValue
      else
      return project.hasProperty('versionName') ? project.property('versionName') : '0.0.0'



      android
      compileSdkVersion 28
      buildToolsVersion "28.0.0"

      signingConfigs
      if (System.getenv('IS_JENKINS')=="yes")
      release
      storeFile file(System.getenv('APP_KEYSTORE_PATH'))
      storePassword System.getenv('APP_KEYSTORE_PASS')
      keyAlias 'something'
      keyPassword System.getenv('APP_KEYSTORE_PASS')

      else
      release
      keyAlias 'xxx'
      keyPassword 'xxx'
      storeFile file('xxx')
      storePassword 'xxx'




      defaultConfig
      applicationId "com.insiderealestate.kvCore"
      minSdkVersion 16
      targetSdkVersion 28
      versionCode generateVersionCode()
      versionName generateVersionName()
      multiDexEnabled true
      ndk
      abiFilters "armeabi-v7a", "x86"


      splits
      abi
      reset()
      enable enableSeparateBuildPerCPUArchitecture
      universalApk false // If true, also generate a universal APK
      include "armeabi-v7a", "x86"


      buildTypes
      debug
      // Note: CodePush updates should not be tested in Debug mode as they are overriden by the RN packager. However, because CodePush checks for updates in all modes, we must supply a key.
      buildConfigField "String", "CODEPUSH_KEY", '""'
      applicationIdSuffix ".debug"


      releaseStaging
      buildConfigField "String", "CODEPUSH_KEY", '""'
      minifyEnabled enableProguardInReleaseBuilds
      proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
      signingConfig signingConfigs.release

      release
      buildConfigField "String", "CODEPUSH_KEY", '""'
      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
      compile project(':react-native-code-push')
      compile project(':appcenter-crashes')
      compile project(':appcenter-analytics')
      compile project(':appcenter')
      compile (project(':react-native-intercom'))
      exclude group: 'com.android.support.graphics.drawable'

      compile project(':bugsnag-react-native')
      compile project(':react-native-sms')
      compile project(':react-native-linear-gradient')
      compile project(':react-native-immediate-phone-call')
      compile project(':react-native-fabric')
      compile project(':react-native-config')
      compile project(':react-native-i18n')
      compile project(':react-native-vector-icons')
      compile project(':react-native-device-info')
      compile fileTree(dir: "libs", include: ["*.jar"])
      compile 'com.android.support:appcompat-v7:28.0.0'
      compile "com.facebook.react:react-native:+" // From node_modules
      compile('com.crashlytics.sdk.android:crashlytics:2.8.0@aar')
      transitive = true;

      compile 'io.intercom.android:intercom-sdk-base:5.+'


      // 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'







      android react-native gradle intercom






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 14 '18 at 21:29









      Doug WatkinsDoug Watkins

      489312




      489312






















          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53309003%2ferror-more-than-one-library-with-package-name-using-react-native-intercom%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53309003%2ferror-more-than-one-library-with-package-name-using-react-native-intercom%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Top Tejano songwriter Luis Silva dead of heart attack at 64

          政党

          天津地下鉄3号線