Modify Android gradle.properties in Expo Managed App

Viewed 285

I'm working on a Expo React Native project that requires up to 15MB of local storage in android. This requires adding the following to the android/gradle.properties file.

AsyncStorage_db_size_in_MB=10

I've tried creating a plugin with

import { withGradleProperties } from "@expo/config-plugins";

export const modifyGradle = (config) => {
      const AsyncKey = "AsyncStorage_db_size_in_MB";
      return withGradleProperties(config, (config) => {
        config.modResults.push({
          type: "property",
          key: AsyncKey,
          value: 10,
        });
    
        return config;
      });
    };

And then adding to app.json as

expo:{
...
"plugins": ["./plugins/modifyGradle.js"],
...
}  

What am I doing wrong here? How can this be done without ejecting from Expo?

1 Answers
Related