tinycreative / react-native-intercom

React Native wrapper for Intercom.io
MIT License
406 stars 280 forks source link

Build Failed Generated APK Release #246

Closed ththugues44 closed 5 years ago

ththugues44 commented 5 years ago

Hello I see error when i build apk release : `

Task :app:bundleReleaseJsAndAssets Scanning folders for symlinks in J:\Projet\foongon\react native\Entreprise\Katika\node_modules (108ms) Scanning folders for symlinks in J:\Projet\foongon\react native\Entreprise\Katika\node_modules (131ms) Loading dependency graph, done. warning: the transform cache was reset. bundle: Writing bundle output to: J:\Projet\foongon\react native\Entreprise\Katika\android\app\build\intermediates\assets\release\index.android.bundle bundle: Done writing bundle output bundle: Copying 66 asset files bundle: Done copying assets

Task :app:generateBundledResourcesHashRelease 3d1fca80782fac0db25794f7a92901fe4e6b2f7cbda286426116f9fe371c3559

C:\Users\BRAVE.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0.aar\37f0970dffb3014c2eb0bedc86eceb26\res\values-v28\values-v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not found.

J:\Projet\foongon\react native\Entreprise\Katika\node_modules\react-native-intercom\android\build\intermediates\res\merged\release\values-v28\values-v28.xml:11: AAPT: error: resource android:attr/dialogCornerRadius not found.

C:\Users\BRAVE.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0.aar\37f0970dffb3014c2eb0bedc86eceb26\res\values\values.xml:1304:5-69: AAPT: error: resource android:attr/fontVariationSettings not found.

C:\Users\BRAVE.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0.aar\37f0970dffb3014c2eb0bedc86eceb26\res\values\values.xml:1304:5-69: AAPT: error: resource android:attr/ttcIndex not found.

error: failed linking references.

FAILURE: Build failed with an exception.

BUILD FAILED in 8m 10s 487 actionable tasks: 13 executed, 474 up-to-date

My Build.gradle is :

` apply plugin: "com.android.application" apply plugin: "io.fabric"

import com.android.build.OutputFile import groovy.json.JsonSlurper

def getVersionName() { def inputFile = new File("../package.json") def packageJson = new JsonSlurper().parseText(inputFile.text) return packageJson["version"] }

def getVersionCode() { def versionName = getVersionName() def versionCode = versionName.replace('.', '').toInteger() return versionCode }

/**

project.ext.react = [ entryFile: "index.js", bundleInRelease : true, resourcesDirRelease : "src/release/res" ]

apply from: "../../node_modules/react-native/react.gradle" apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"

/**

/**

dependencies { compile project(':react-native-sound') compile project(':react-native-push-notification') compile project(':react-native-device-info') compile project(':amazon-cognito-identity-js') compile project(':react-native-vector-icons') compile project(':react-native-android-library-freshchat-sdk') compile project(':@aws-amplify/pushnotification') implementation 'com.android.support:multidex:1.0.3' compile project(':react-native-intercom') compile project(':appcenter-push') compile project(':appcenter-crashes') compile project(':appcenter-analytics') compile project(':appcenter') compile project(':react-native-appstore-version-checker') compile project(':react-native-version-check') compile project(':react-native-code-push') compile project(':react-native-firebase') compile project(':react-native-background-timer') compile project(':react-native-facebook-account-kit') compile fileTree(dir: "libs", include: ["*.jar"]) compile "com.android.support:appcompat-v7:27.1.1" compile "com.facebook.react:react-native:+" // From node_modules compile project(':react-native-android-library-freshchat-sdk') compile 'com.github.freshdesk:freshchat-android:1.0.0' compile 'com.firebase:firebase-jobdispatcher:0.7.0'

//compile project(':reactnativenotifications')

implementation project(':react-native-firebase')
apply plugin: 'com.google.gms.google-services'
com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true

// Firebase dependencies //implementation "com.google.android.gms:play-services-base:15.0.1" implementation "com.google.firebase:firebase-core:16.0.1" implementation "com.google.firebase:firebase-functions:16.0.1" implementation 'com.google.firebase:firebase-messaging:17.1.0' implementation 'me.leolin:ShortcutBadger:1.1.21@aar' // <-- Add this line if you wish to use badge on Android implementation "com.google.firebase:firebase-firestore:17.0.2"

implementation('com.crashlytics.sdk.android:crashlytics:2.9.4@aar') { transitive = true } compile 'io.intercom.android:intercom-sdk-fcm: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' } apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

`

Please what is solution ?`

maxired commented 5 years ago

Hey @noellaby . I am facing a similar issue. Did you found a solution ?

edit: seem linked to https://github.com/tinycreative/react-native-intercom/issues/238

mtford90 commented 5 years ago

Also facing this. I had to downgrade to v10 from over a year ago.

tomhicks commented 5 years ago

I'm not a gradle expert in any way, shape or form, but I managed to hack mine around to get it to work. I think I used build tools 28, or something.

Not sure if posting my gradle file might help?

spacewinds commented 5 years ago

Yo, I fixed this by adding explicit version config in android/build.gradle:

buildscript {
ext {
        buildToolsVersion = "28.0.3"
        minSdkVersion = 16
        compileSdkVersion = 28
        targetSdkVersion = 28
        supportLibVersion = "28.0.0"
    }

If you are using different SDK - just replace version here.