config-plugin-react-native-intercom icon indicating copy to clipboard operation
config-plugin-react-native-intercom copied to clipboard

Add support for Expo 50

Open elmaxe opened this issue 1 year ago • 10 comments

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.

elmaxe avatar Jan 19 '24 12:01 elmaxe

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🥇

sync avatar Jan 21 '24 06:01 sync

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!

daniel-sabourin avatar Feb 05 '24 19:02 daniel-sabourin

Yes happy to

sync avatar Feb 05 '24 20:02 sync

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

islamashraful avatar Feb 10 '24 08:02 islamashraful

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 : Capture d’écran 2024-02-20 à 12 21 21

I'm now completely stuck. How did you manage to make it work with Expo SDK 50 ?

yonitou avatar Feb 20 '24 11:02 yonitou

@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

elmaxe avatar Feb 20 '24 12:02 elmaxe

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 avatar Feb 20 '24 12:02 yonitou

@yonitou Unfortunately, I haven't tried. I am no longer working at a project where intercom is used

elmaxe avatar Feb 20 '24 12:02 elmaxe

I created a PR with the patch from @sync #78 I'm curious what the problems were that you ran into @daniel-sabourin

Billzabob avatar Feb 20 '24 18:02 Billzabob

We're also upgrading for Expo 50, thank you for the PR ! :D :ok_hand:

TomBerriot avatar Feb 22 '24 10:02 TomBerriot