config-plugin-react-native-intercom
config-plugin-react-native-intercom copied to clipboard
Add support for Expo 50
Expo 50 is now released and it has at least one breaking change that this config plugin must address:
Java -> Kotlin for MainApplication
React Native 0.73 changed from Java to Kotlin for Android Main* classes: MainApplication.java/MainActivity.java are now MainApplication.kt/MainActivity.kt. If you depend on any config plugins that use dangerous modifications to change these files, they may need to be updated for SDK 50 support.
You can use this patch temporarily:
config-plugin-react-native-intercom+1.10.1.patch.zip
Steps:
-
unzip it
and move the unzipped file into/patches
- install
patch-package
and follow their setup instructions here: https://github.com/ds300/patch-package - profit🥇
Would either @sync or @cmaycumber be willing to put up a PR/publish a version with that patch applied? We tried applying the patch ourselves, but ran into issues with it.
Thanks!
Yes happy to
Well, after looking for different places to get intercom support with Expo 50, I finally wrote my custom mod-plugin for it!
If anyone is still struggling with it then you can have a look around this repo
Hi guys,
I'm using this plugin for about 2 months and it worked almost good (with some crashes as everyone of course). I used : "@intercom/intercom-react-native": "^4.0.1", "config-plugin-react-native-intercom": "^1.10.1",
And in my app.json, I used :
[
"expo-build-properties",
{
android: {
compileSdkVersion: 33,
targetSdkVersion: 33
}
}
],
Since I upgraded to Expo SDK 50, I tried to build with EAS on Android and I got this error
ecution failed for task ':app:checkDebugAarMetadata'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
> 3 issues were found when checking AAR metadata:
1. Dependency 'androidx.browser:browser:1.6.0' requires libraries and applications that
depend on it to compile against version 34 or later of the
Android APIs.
:app is currently compiled against android-33.
Recommended action: Update this project to use a newer compileSdk
of at least 34, for example 34.
Note that updating a library or application's compileSdk (which
allows newer APIs to be used) can be done separately from updating
targetSdk (which opts the app in to new runtime behavior) and
minSdk (which determines which devices the app can be installed
on).
2. Dependency 'androidx.core:core:1.12.0' requires libraries and applications that
depend on it to compile against version 34 or later of the
Android APIs.
:app is currently compiled against android-33.
Recommended action: Update this project to use a newer compileSdk
of at least 34, for example 34.
Note that updating a library or application's compileSdk (which
allows newer APIs to be used) can be done separately from updating
targetSdk (which opts the app in to new runtime behavior) and
minSdk (which determines which devices the app can be installed
on).
3. Dependency 'androidx.core:core-ktx:1.12.0' requires libraries and applications that
depend on it to compile against version 34 or later of the
Android APIs.
:app is currently compiled against android-33.
Recommended action: Update this project to use a newer compileSdk
of at least 34, for example 34.
Note that updating a library or application's compileSdk (which
allows newer APIs to be used) can be done separately from updating
targetSdk (which opts the app in to new runtime behavior) and
minSdk (which determines which devices the app can be installed
on).
I updated my app.json to compileSDKVersion & targetSDKVersion to 34 and added the patch above and it's building but it's now impossible to launch my app in Android :
I'm now completely stuck. How did you manage to make it work with Expo SDK 50 ?
@yonitou have you read this thread? Have you tried @sync's or @islamashraful's solutions? As stated in the description of this issue, this config plugin doesn't currently work with expo 50
Hi @elmaxe ,
Absolutely, I read it and I tried to use the patch from @sync but it's not working, that's why I'm asking. I didn't try @islamashraful solution because it's not supporting push notifications. Did you manage to make it work with the patch ?
Thanks,
@yonitou Unfortunately, I haven't tried. I am no longer working at a project where intercom is used
I created a PR with the patch from @sync #78 I'm curious what the problems were that you ran into @daniel-sabourin
We're also upgrading for Expo 50, thank you for the PR ! :D :ok_hand: