我正在使用Expo来开发我的React Native应用,并已到达构建应用程序并在Play商店上部署的阶段。但是,在app.json文件中设置Android自适应图标(前景/背景)字段时,出现了问题。我遵循了Expo文档https://docs.expo.io/guides/app-icons/,但是应用程序图标只被白色圆圈包围。
{
"name": "ChowTime",
"displayName": "ChowTime",
"expo": {
"name": "ChowTime",
"slug": "ChowTime",
"version": "3.0.0",
"icon":"./assets/icon.png",
"android": {
"package": "com.yourcompany.chowtime",
"versionCode": 2,
"icon": "./assets/icon.png",
"adaptiveIcon": {
"foregroundImage": "./assets/icon.png",
"backgroundColor": "#000000"
}
},
"splash": {
"image": "./assets/splashScreen.png",
"resizeMode": "cover"
},
"platforms": ["ios", "android", "web"],
"assetBundlePatterns": ["**/*"]
}
}
expo build:android -t apk
(https://docs.expo.io/distribution/building-standalone-apps/#if-you-choose-to-build-for-android),看看新版本是否有预期的图标! - fadzb