尝试发布 iOS 应用程序时出现黑屏问题
Posted
技术标签:
【中文标题】尝试发布 iOS 应用程序时出现黑屏问题【英文标题】:Blank Screen Problem when trying to publish iOS App 【发布时间】:2019-05-05 19:33:05 【问题描述】:我们在发布应用时遇到了一些问题。
首先在调试模式下,它适用于所有模拟器,但在发布期间,它并非一直有效。
我们在 iPad 上遇到了黑屏问题。我们在 iPhone(物理设备)上也遇到了这个问题,但在 flutter clean
和 flutter build ios -release
之后它工作了。
然后我们在 XCode 中没有选择“compress the app
”就将应用程序归档。
您能否告诉我们您是否在 iPad 上遇到过这种“黑屏问题”?我们非常感谢任何建议。谢谢!
我们使用权限来通知和定位。 我们在flutter pubspec中使用了以下包:
- cupertino_icons: ^0.1.2
- rxdart: ^0.18.0
- http: ^0.12.0+1
- firebase_database: ^2.0.2
- cloud_firestore: 0.9.13+1
- firebase_storage: ^2.1.0+1
- cached_network_image: ^0.7.0
- image_picker: ^0.5.3+1
- flutter_facebook_login: ^2.0.0
- flutter_auth_buttons: ^0.5.0
- firebase_auth: ^0.8.4+5
- url_launcher: ^5.0.2
- geolocator: ^4.0.1
- permission_handler: ^2.2.0
- shared_preferences: ^0.5.2
- flutter_range_slider: "^1.0.1"
- intl: ^0.15.8
- geocoder: ^0.1.2
- fluttertoast: ^3.0.4
- datetime_picker_formfield: ^0.1.8
- flutter_launcher_icons: ^0.7.0
- firebase_messaging: ^2.0.0
- firebase_crashlytics: ^0.0.4+2
if (geolocationStatus == GeolocationStatus.unknown)
Map<PermissionGroup, PermissionStatus> permissions =
await PermissionHandler()
.requestPermissions([PermissionGroup.location,PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse]);
void iOS_Permission()
firebaseMessaging.requestNotificationPermissions(
IosNotificationSettings(sound: true, badge: true, alert: true)
);
firebaseMessaging.onIosSettingsRegistered
.listen((IosNotificationSettings settings)
);
【问题讨论】:
【参考方案1】:是的,准确!与频道开发类似的问题
dependencies:
flutter:
sdk: flutter
redux: ^3.0.0
flutter_redux: ^0.5.3
firebase_auth: ^0.8.4+5
cloud_firestore: ^0.10.1
cloud_functions: ^0.2.0
firebase_storage: ^2.1.1+1
firebase_core: ^0.3.4
firebase_messaging: ^4.0.0+4
firebase_analytics: 2.1.1+3
flutter_facebook_login: ^2.0.0
cached_network_image: ^0.7.0
shared_preferences: ^0.5.2
font_awesome_flutter: ^8.4.0
image_picker: ^0.6.0+2
image_cropper: ^1.0.1
connectivity: ^0.4.3+1
flutter_spinkit: ^3.1.0
event_bus: ^1.1.0
flutter_app_badger: ^1.0.2
flutter_image_compress: ^0.4.0
package_info: ^0.4.0+3
device_info: ^0.4.0+1
flutter_html: ^0.9.6
path_provider: ^0.5.0+1
flutter_cache_manager: ^0.3.2
cupertino_icons: ^0.1.2
geoflutterfire: ^2.0.3+3
timeago: ^2.0.14
google_maps_flutter: ^0.5.11+1
flutter_advanced_networkimage: ^0.4.15
location: ^2.3.5
intl: ^0.15.8
flutter_range_slider: "^1.2.0"
flutter_money_formatter: ^0.8.0
【讨论】:
【参考方案2】:我解决了这个问题。 您需要在 Info.plist 中添加:
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>gps</string>
<string>location-services</string>
</array>
【讨论】:
以上是关于尝试发布 iOS 应用程序时出现黑屏问题的主要内容,如果未能解决你的问题,请参考以下文章
iOS swiftDelegate 文件在添加代码时出现黑屏,请指导