cmaycumber / config-plugin-react-native-intercom

Expo plugin for adding @intercom/react-native-intercom using expo config plugins
74 stars 38 forks source link

Add support for Expo 50 #77

Open elmaxe opened 5 months ago

elmaxe commented 5 months ago

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.
sync commented 5 months ago

You can use this patch temporarily:

config-plugin-react-native-intercom+1.10.1.patch.zip

Steps:

daniel-sabourin commented 4 months ago

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!

sync commented 4 months ago

Yes happy to

islamashraful commented 4 months ago

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

yonitou commented 4 months ago

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 ?

elmaxe commented 4 months ago

@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

yonitou commented 4 months ago

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,

elmaxe commented 4 months ago

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

Billzabob commented 4 months ago

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

TomBerriot commented 4 months ago

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