Modifying Gradle file with mod or Static Modifier

So I’ve been added to a project that uses react-native-camera and I’m trying to use Expo’s Development Client to ease some of the Xcode/Android Studio development flow.

iOS builds without an issue and runs great, however, I’m having some issues w/ Android due to this package. I’m able to add the CAMERA permission (statically in the app.json file). When I go to build, I get the same error message mentioned in this issue and it looks like the solution is to add a missingDimensionStrategy to the /android/app/build.gradle file.

Reading through the plugin docs, it seems I can either create a mod or use a Static Modifier (preferred). However, from the docs I can’t quite determine how to get this to work. Can anyone point me to a repo that has an example of modifying the build.gradle file?

Hi

There are some examples of using withProjectBuildGradle in GitHub - expo/config-plugins: Out-of-tree Expo config plugins for packages that haven't adopted th

I’m still figuring out the details of Config Plugins, so can’t help more than that at this point :slight_smile:

By the way, have you seen React Native Vision Camera? It comes with a Config Plugin, so no need to write your own.

Thanks @wodin, that’s a great resource!! That lead me down a path and I found some additional examples in the expo-cli repo that includes some gradle file manipulations that I should be able to base my changes off of. When I have a solution I’ll post here for others if they’re interested.

3 Likes

Please do!

Have you got a solution :joy:

What are you trying to do?