I'm using config plugin to modify the content AndroidManifest in an app with expo managed builds.
but it looks like it does not do anything.
here is my app.config.js
import { AndroidConfig, withAndroidManifest } from "@expo/config-plugins";
const {
} = AndroidConfig.Manifest;
const {
removePermissions,
} = AndroidConfig.Permissions;
const withCustomConfig = (config) => {
config.name = "NEWNAME"
return withAndroidManifest(config, async (config) => {
config.modResults = await setCustomConfigAsync3(config, config.modResults);
return config;
});
};
async function setCustomConfigAsync3(config, androidManifest) {
removePermissions(androidManifest,["android.permission.SYSTEM_ALERT_WINDOW"])
return androidManifest
}
const config = {
name: "TEST",
plugins : [[withCustomConfig]],
slug: "TEST",
...
}
export default config;
it creates a package with named NEWNAME so it means that the plugin is called, but nothing in withAndroidManifest's action is called. I also tried to change other props of the AndroidManifest like meta-data but nothing is working there
i'm usig expo build:android to create the apk.
anyone has any idea that whats wrong with this pice of code? thanks.
Plugins are mostly meant to be used with expo prebuild (it generates android and ios folders that can be built with Android Studio and Xcode like any other Android or iOS app using your own hardware) or eas build commands
You can not use plugins with expo build
Reference: