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

fix(deps, android)!: switch to local maven repo for aar dependency #370

Closed mikehardy closed 3 years ago

mikehardy commented 3 years ago

Fixes #151 Fixes https://github.com/notifee/documentation/issues/8

BREAKING CHANGE: add

maven { 
  url "$rootDir/../node_modules/@notifee/react-native/android/libs" }
}

to the group of repositories inside allprojects in android/build.gradle

It will probably look like this after:


allprojects {
  task downloadDependencies() {
    description 'Download all dependencies to the Gradle cache'
  }

  repositories {
    google()
    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 {
      url "$rootDir/../node_modules/detox/Detox-android"
    }
    maven {                                                               // <--- THESE ARE THE NEW LINES
      url "$rootDir/../node_modules/@notifee/react-native/android/libs"   // <--- THESE ARE THE NEW LINES
    }                                                                     // <--- THESE ARE THE NEW LINES
    jcenter()
  }

}
mikehardy commented 3 years ago

I'm test integrating this into a work project to make sure it's good - first attempt to test it indicated it is not! :-) I'll mark it for review when it's ready

mikehardy commented 3 years ago

Okay, this works for me in my project with this reference:

    "@notifee/react-native": "github:notifee/react-native-notifee#5f8a5688b4faf56648f60696243681e3837d7715",

...and this in postinstall so it works from source:

    "postinstall": "patch-package && cd node_modules/@notifee/react-native && yarn"

...given I have this in my android/build.gradle:

allprojects {
    repositories {
       // ...other repositories here...
        maven {
            url("$rootDir/../node_modules/@notifee/react-native/android/libs")
        }

I think it is good to go but it is a breaking change and we can't tell people in enough places about this little thing they need to add in android/build.gradle :point_up: - the changelog, the release notes, everywhere...