cmaycumber / config-plugin-react-native-intercom

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

Build properties set to incompatible values #51

Closed billinghamj closed 1 year ago

billinghamj commented 1 year ago

Hi,

In #49, the readme was updated to tell people to set compileSdkVersion and targetSdkVersion to 33 or higher.

But this package/plugin already has that functionality built in! Except it's setting the value to 31.

https://github.com/cmaycumber/config-plugin-react-native-intercom/blob/993f0069e3e12b861706f879a49afe829b556fa6/packages/intercom-react-native/src/withIntercom.ts#L75-L77

In the app.json plugins array, it seems that precedence goes to the earlier items in the array.

So this works (builds with v33):

{
    "plugins": [
        ["expo-build-properties", { "android": { "compileSdkVersion": 33, "targetSdkVersion": 33 } }],
        ["config-plugin-react-native-intercom", {}]
    ]
}

But in the other order, it doesn't work (actually builds with v31):

{
    "plugins": [
        ["config-plugin-react-native-intercom", {}],
        ["expo-build-properties", { "android": { "compileSdkVersion": 33, "targetSdkVersion": 33 } }]
    ]
}

You could potentially fix this by updating the version in withIntercom.ts to 33, but to be honest I don't think it's really right for a plugin like this to be setting exact values for critical build settings which affect the entire project.

I'd suggest removing this package's use of expo-build-properties, and just leaving it as a documented requirement

billinghamj commented 1 year ago

Ah also, it turns out this has been forcing our minimum iOS version to v13, where we had it set to v15 😬