invertase / react-native-notifee

Moved to https://github.com/invertase/notifee
https://invertase.io/blog/open-sourcing-notifee
Other
465 stars 31 forks source link

build android failed after adding notifee.config.json to the root foulder #269

Closed muhamedzeema closed 3 years ago

muhamedzeema commented 3 years ago

Hello!, we did the integration for Notifee Lib for development and testing first and everything was working fine! then we purchased the license for production purpose. we create notifee.config.json in our app root contains this object

{
  "android": {
    "license": "xxxxxx"
  }
}

then the builds started to fail due these issue

 Configure project :notifee_react-native
:notifee_react-native package.json found at /Users/zeema/Desktop/xxxx/xxxxxxx/node_modules/@notifee/react-native/package.json
:notifee_react-native:version set from package.json: 0.16.0 (0,16,0 - 16000)
:notifee_react-native:android.compileSdk using custom value: 29
:notifee_react-native:android.targetSdk using custom value: 29
:notifee_react-native:android.minSdk using custom value: 16
:notifee_react-native:reactNativeAndroidDir /Users/zeema/Desktop/xxxxx/xxxxxx/node_modules/react-native/android

FAILURE: Build failed with an exception.

* Where:
Script '/Users/zeema/Desktop/xxxxx/xxxxxx/node_modules/@notifee/react-native/android/notifee-json.gradle' line: 190

* What went wrong:
A problem occurred configuring project ':notifee_react-native'.
> Cannot add task 'processProductionreleaseNotifeeJson' as a task with that name already exists.
Screen Shot 2021-03-22 at 4 01 40 PM

"react-native": "^0.63.3", "@notifee/react-native": "^1.1.1", distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip

so we need help with this issue please! Thank you

mikehardy commented 3 years ago

Hi there! Gradle is on 6.8.3 for what it's worth, I don't think that's the problem though Notifee is definitely not on 0.16 anymore - it is on 1.2.0, you should definitely update that - you may think you have ^1.1.1 in your package.json but if you look at the build output it is clearly seeing 0.16 for some reason

npx react-native-clean-project perhaps?

muhamedzeema commented 3 years ago

Hi @mikehardy Gradle upgraded to 6.8.3 and notfiee to 1.2.0, this build 0.16 because i was downgrading the notifee bleow 1.0 to test if its working but the same. now upgrade to 1.2.0 but the same issue image also i did clean the whole project gralde and npx react-native-clean-project

mikehardy commented 3 years ago

https://github.com/notifee/react-native-notifee/blob/269703270742a63b5cf48a988d650a3b1035fef0/android/notifee-json.gradle#L190

Strange, somehow gradle is defining the ProductionRelease task twice, without seeing your android/build.gradle / android/app/build.gradle files and the actual command line invocation that kicked off the android build I don't think I will be able to figure out what happened

muhamedzeema commented 3 years ago

@mikehardy any workaround or something ? also i did found this issue https://github.com/notifee/react-native-notifee/issues/122 he was facing the same issue

helenaford commented 3 years ago

@muhamedzeema thanks for the info. the p/r that @ismaelMiber kindly created should fix your issue. It will be out in the next few days. Sorry you've ran into this bug.

helenaford commented 3 years ago

Fix is included in v1.2.1 (https://notifee.app/react-native/docs/release-notes#121). please re-open this issue if it's still occurring.