我搜索了这个问题,但没有找到解决方案。我需要在expo中编辑android manifest或同等内容,使用此:
android:launchMode="singleTask"
字符串可以在expo中编辑这个吗?在android项目中原生我编辑androidmanifest.xml但是在react native with expo中,我没有manifest.xml
lpwwtiir1#
今天,它不再是必要的执行“弹出”。我这样做是使用插件在世博会SDK 48版本。1 -为插件创建一个文件,例如:android-manifest-launch-mode-plugin.js2 -添加此代码。
android-manifest-launch-mode-plugin.js
const { withAndroidManifest } = require('@expo/config-plugins');module.exports = function withAndroidStrategiesPlugin(config) { return withAndroidManifest(config, config => { config.modResults.manifest.application[0].activity[0].$[ 'android:launchMode' ] = 'singleTask'; // SingleTask/SingleMode return config; });};
const { withAndroidManifest } = require('@expo/config-plugins');
module.exports = function withAndroidStrategiesPlugin(config) {
return withAndroidManifest(config, config => {
config.modResults.manifest.application[0].activity[0].$[
'android:launchMode'
] = 'singleTask'; // SingleTask/SingleMode
return config;
});
};
字符串3 -在app.json中,添加插件:
...plugins: [ ['./android-manifest-launch-mode-plugin'] ]...
...
plugins: [ ['./android-manifest-launch-mode-plugin'] ]
型
sbtkgmzw2#
据我所知,你不能用expo设置这个属性。如果你想做那个级别的原生定制,你需要eject你的应用。弹出将为你生成原生项目,然后你可以像往常一样进行原生更改,但你将无法再用expo运行,你必须使用CLI或原生IDE
2条答案
按热度按时间lpwwtiir1#
今天,它不再是必要的执行“弹出”。我这样做是使用插件在世博会SDK 48版本。
1 -为插件创建一个文件,例如:
android-manifest-launch-mode-plugin.js
2 -添加此代码。
字符串
3 -在app.json中,添加插件:
型
sbtkgmzw2#
据我所知,你不能用expo设置这个属性。如果你想做那个级别的原生定制,你需要eject你的应用。弹出将为你生成原生项目,然后你可以像往常一样进行原生更改,但你将无法再用expo运行,你必须使用CLI或原生IDE