我在expo中为Android和ios做了一个项目,但是当我 尝试为ios创建独立应用程序,它向我显示一个错误 “您的项目必须在app.json中设置一个bundleIdentifier。请参阅 https://docs.expo.io/versions/latest/distribution/building-standalone-apps/#2-configure-appjson” 但是在ios部分的app.json文件中,我给它命名为 bundleIdentifier和我给android包相同的值, 值为““ com.react.myappname”“。只是告诉我一样 错误一次又一次。我正在使用Windows 10进行此构建,帮助 我在那。
{“博览会”:{ “ name”:“ com.projectname.app”,
"description": "This project is really great.",
"slug": "projectname",
"privacy": "public",
"sdkVersion": "31.0.0",
"platforms": ["ios"],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/iconios.png",
"splash": {
"image": "./assets/splashios.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"bundleIdentifier":"com.react.projectname"
},
},
“博览会”:{ “ name”:“ com.projectname.app”,
"description": "This project is really great.",
"slug": "projectname",
"privacy": "public",
"sdkVersion": "31.0.0",
"platforms": [ "android"],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/playstore-icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"android": {
"package":"com.react.projectname",
"config": {
"googleMaps": {
"apiKey": "AIzaSyD4KuDsSesrWf_iDn3WDTnwxqekZoC9qk0"
}
}
} } }
答案 0 :(得分:0)
对于ios,您还需要在Xcode ..和Windows10中的不可用的Xcode中设置bundleIdentifier。您需要使用Mac来构建和运行ios应用。
答案 1 :(得分:0)
首先,您无法在windows
环境中执行此操作。您需要在Windows机器中设置virtual
机器,或者明确地从朋友那里借来的ios
机器。然后,您需要安装Xcode
。所有开发项目的构建都创建了一个可以在Xcode内部打开的文件。然后,只有您可以在ios emulator
上运行它,或使用真实的iPhone设备进行调试。