将flutter升级到flutter 1.22.4后。构建 Xcode 项目时出现以下错误。
Runner.app/Info.plist 不存在。Flutter“瘦二进制”构建阶段必须在“复制捆绑资源”之后运行。
已经尝试了以下选项:
尝试上述所有选项后,仍然出现相同的错误。
颤振医生:
[?] Flutter (Channel stable, 1.22.4, on macOS 11.0.1 20B50 darwin-x64, locale en-US)
• Flutter version 1.22.4 at /Users/dhavalkansara/flutter 1.22.4
• Framework revision 1aafb3a8b9 (6 weeks ago), 2020-11-13 09:59:28 -0800
• Engine revision 2c956a31c0
• Dart version 2.10.4
[?] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/dhavalkansara/Library/Android/sdk …Run Code Online (Sandbox Code Playgroud) 我们需要允许用户将文件存储在外部存储中,为此,我们MANAGE_EXTERNAL_STORAGE在应用程序中使用权限。
理想情况下,我们正在使用 Android SDK 版本 30 及以上版本,Permission.manageExternalStorage并使用Permission.storage低于 30 的 Android SDK 版本,如下面的代码所示
// This func is added to access scope storage to export csv files
static Future<bool> externalStoragePermission(BuildContext context) async {
final androidVersion = await DeviceInfoPlugin().androidInfo;
if ((androidVersion.version.sdkInt ?? 0) >= 30) {
return await checkManageStoragePermission(context);
} else {
return await checkStoragePermission(context);
}
}
static Future<bool> checkManageStoragePermission(BuildContext context) async {
return (await Permission.manageExternalStorage.isGranted ||
await Permission.manageExternalStorage.request().isGranted);
}
static Future<bool> checkStoragePermission(BuildContext context,
{String? storageTitle, String? …Run Code Online (Sandbox Code Playgroud) 我正在尝试向现有应用程序添加颤振。因此,在制作应用程序之前,我尝试使用全新的 Xcode 10 Single View Application。我在https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps上遵循了教程,但在目标的构建阶段添加运行脚本后卡住了。它给出了错误:
错误:
iphoneos/AFEiOS.build
export TEMP_ROOT=/Users/dhavalkansara/Library/Developer/Xcode/DerivedData/AFEiOS-gctxucyuhlhesnfkbuxfswkozboo/Build/Intermediates.noindex
export TOOLCHAINS=com.apple.dt.toolchain.XcodeDefault
export TOOLCHAIN_DIR=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
export TREAT_MISSING_BASELINES_AS_TEST_FAILURES=NO
export TeamIdentifierPrefix=RQ9BPQCP49.
export UID=501
export UNLOCALIZED_RESOURCES_FOLDER_PATH=AFEiOS.app
export UNSTRIPPED_PRODUCT=NO
export USER=dhavalkansara
export USER_APPS_DIR=/Users/dhavalkansara/Applications
export USER_LIBRARY_DIR=/Users/dhavalkansara/Library
export USE_DYNAMIC_NO_PIC=YES
export USE_HEADERMAP=YES
export USE_HEADER_SYMLINKS=NO
export VALIDATE_PRODUCT=NO
export VALID_ARCHS="arm64 arm64e armv7 armv7s"
export VERBOSE_PBXCP=NO
export VERSIONPLIST_PATH=AFEiOS.app/version.plist
export VERSION_INFO_BUILDER=dhavalkansara
export VERSION_INFO_FILE=AFEiOS_vers.c
export VERSION_INFO_STRING=""@(#)PROGRAM:AFEiOS PROJECT:AFEiOS-""
export WRAPPER_EXTENSION=app
export WRAPPER_NAME=AFEiOS.app
export WRAPPER_SUFFIX=.app
export WRAP_ASSET_PACKS_IN_SEPARATE_DIRECTORIES=NO
export XCODE_APP_SUPPORT_DIR=/Applications/Xcode.app/Contents/Developer/Library/Xcode
export XCODE_PRODUCT_BUILD_VERSION=10E1001
export XCODE_VERSION_ACTUAL=1020
export XCODE_VERSION_MAJOR=1000
export XCODE_VERSION_MINOR=1020
export XPCSERVICES_FOLDER_PATH=AFEiOS.app/XPCServices
export YACC=yacc
export arch=undefined_arch …Run Code Online (Sandbox Code Playgroud) 有没有办法在flutter中建立与Google IoT pub-sub API的连接?
我试过这个库,但它没有我正在寻找的配置。
我有以下数据将用于建立连接:
{
"type": ,
"project_id": ,
"private_key_id": ,
"private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
"client_email": ,
"client_id": ,
"auth_uri": ,
"token_uri": ,
"auth_provider_x509_cert_url": ,
"client_x509_cert_url":
}
Run Code Online (Sandbox Code Playgroud) 我已经这样做了。
1.在Apple Developer页面添加IOS证书。
2. 在 Apple Developer 页面中添加启用 Network Extension 的标识符 App ID。
3. 在 Apple Developer 页面中添加配置文件。
4. 创建 Xcode 项目并输入在苹果开发者页面上制作的正确包 ID。并签下合适的球队。
5. 添加能力和库(网络扩展框架)。
6. 5后,在我的Xcode项目中自动生成Entitlement文件。
7.上次我写的代码是这样的。
NSLog(@"List Scan START");
NSMutableDictionary* options = [[NSMutableDictionary alloc] init];
[options setObject:@"Try Here" forKey:kNEHotspotHelperOptionDisplayName];
dispatch_queue_t queue = dispatch_queue_create("com.miro.wifilist", 0);
BOOL isAvailable = [NEHotspotHelper registerWithOptions:options queue:queue handler: ^(NEHotspotHelperCommand * cmd) {
if (cmd.commandType == kNEHotspotHelperCommandTypeEvaluate || cmd.commandType == kNEHotspotHelperCommandTypeFilterScanList ) {
for (NEHotspotNetwork* network in cmd.networkList) {
NSLog(@"%@", network.SSID);
}
} else {
NSLog(@"there …Run Code Online (Sandbox Code Playgroud) 我想使用 dart SDK: ">=2.6.0 <3.0.0" 与颤振。但是我目前 Flutter 使用的 dart 版本是 2.5.0。
尝试后flutter upgrade我的颤振版本是:
flutter --version
Flutter 1.9.1+hotfix.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 68587a0916 (3 months ago) • 2019-09-13 19:46:58 -0700
Engine • revision b863200c37
Tools • Dart 2.5.0
Run Code Online (Sandbox Code Playgroud)
我尝试从链接下载 Flutter SDK(2.6.1) 的最新稳定版本,并将其替换为flutter > bin > cache > dart-sdk 中已经可用的dart-sdk,但在执行此步骤后,我收到以下错误:
Wrong full snapshot version, expected 'cb187597a166f2c0c64a200e22509ee3' found 'c8562f0ee0ebc38ba217c7955956d1cb'
Isolate creation failed
Run Code Online (Sandbox Code Playgroud)
有没有其他方法可以解决这些问题并在flutter中升级dart-sdk?
在使用self.imagePicker.mediaTypes = [(kUTTypeImage as String)]through 时,UIImagePicker我可以选择所有类型的图像,但我的要求是仅JPG, JPEG and PNG通过照片库选择类型图像,GIF并且HEIC不允许使用和(实时照片)。
那么,有什么方法可以阻止我选择GIF和HEIC类型的照片,同时imagePicker.sourceType = .photoLibrary
代码:
imagePicker.delegate = self
let actionSheet = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
actionSheet.addAction(UIAlertAction(title: StringConstants.Actions.Camera, style: .default, handler: { (action:UIAlertAction) in
CheckPermissions.checkPermission(permissionFor: .Camera,vc:self) { (success) in
if success {
DispatchQueue.main.async {[unowned self] in
if(UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.camera)) {
self.view.endEditing(true)
self.imagePicker.allowsEditing = false
self.imagePicker.sourceType = UIImagePickerControllerSourceType.camera
self.imagePicker.cameraCaptureMode = .photo
self.imagePicker.showsCameraControls = true
self.imagePicker.modalPresentationStyle = .overFullScreen
self.present(self.imagePicker, animated: …Run Code Online (Sandbox Code Playgroud) 当我使用wifi请求网络中的可用 wifi 列表时,出现以下异常。
例外:
E/MethodChannel#plugins.ly.com/wifi(29023): Failed to handle method call
E/MethodChannel#plugins.ly.com/wifi(29023): java.lang.IllegalStateException: Reply already submitted
E/MethodChannel#plugins.ly.com/wifi(29023): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:151)
E/MethodChannel#plugins.ly.com/wifi(29023): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.java:230)
E/MethodChannel#plugins.ly.com/wifi(29023): at com.ly.wifi.WifiDelegate.finishWithError(WifiDelegate.java:341)
E/MethodChannel#plugins.ly.com/wifi(29023): at com.ly.wifi.WifiDelegate.finishWithAlreadyActiveError(WifiDelegate.java:337)
E/MethodChannel#plugins.ly.com/wifi(29023): at com.ly.wifi.WifiDelegate.getWifiList(WifiDelegate.java:172)
E/MethodChannel#plugins.ly.com/wifi(29023): at com.ly.wifi.WifiPlugin.onMethodCall(WifiPlugin.java:58)
E/MethodChannel#plugins.ly.com/wifi(29023): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:222)
E/MethodChannel#plugins.ly.com/wifi(29023): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96)
E/MethodChannel#plugins.ly.com/wifi(29023): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:656)
E/MethodChannel#plugins.ly.com/wifi(29023): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#plugins.ly.com/wifi(29023): at android.os.MessageQueue.next(MessageQueue.java:336)
E/MethodChannel#plugins.ly.com/wifi(29023): at android.os.Looper.loop(Looper.java:174)
E/MethodChannel#plugins.ly.com/wifi(29023): at android.app.ActivityThread.main(ActivityThread.java:7356)
E/MethodChannel#plugins.ly.com/wifi(29023): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#plugins.ly.com/wifi(29023): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/MethodChannel#plugins.ly.com/wifi(29023): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
I/flutter (29023): PlatformException(error, Reply already submitted, null)
E/MethodChannel#plugins.ly.com/wifi(29023): Failed to handle method call …Run Code Online (Sandbox Code Playgroud) 我正在开发一个IoT应用程序,我必须使用类似于、和 的IoTFlutter 应用程序将我的设备连接到 wifi 网络。同样,我需要网络中所有可用的 wifi 列表。那么是否有可能在 Flutter 中获取所有可用 Wifi 列表?Google HomeAmazon EchoAlexa
在 中Android,使用wifi_flutter和wifi我可以获得可用的 wifi 列表。但我没有找到任何库或任何解决方案可以用来获取 的 wifi 列表iOS Swift。
Alexa 应用程序屏幕截图:- https://ibb.co/f9zf2qn
Google Home 应用程序屏幕截图:- https://ibb.co/B4WxvKd
如果您知道任何解决方案,请用一些代码写下您的答案。
正则表达式的要求:
我尝试在RegExr上生成相同的正则表达式,它满足了我的要求,但是当我将相同的内容应用于颤动表单 TextFormField 时,它不起作用。
正则表达式: ^[[0-9]{0,8}(\.[0-9]{1,4})?$|^[[0-9]{0,9}(\.[0-9]{1,3})?$|^[[0-9]{0,10}(\.[0-9]{1,2})?$|^[[0-9]{0,11}(\.[0-9]{1})?$|^[0-9]{0,12}
颤振文本字段代码:
TextFormField(
controller: _textEditingController,
keyboardType:TextInputType.numberWithOptions(decimal: true),
inputFormatters: <TextInputFormatter>[
WhitelistingTextInputFormatter(RegExp(r'^[[0-9]{0,8}(\.[0-9]{1,4})?$|^[[0-9]{0,9}(\.[0-9]{1,3})?$|^[[0-9]{0,10}(\.[0-9]{1,2})?$|^[[0-9]{0,11}(\.[0-9]{1})?$|^[0-9]{0,12}')),
],
),
Run Code Online (Sandbox Code Playgroud)
使用上面的代码我无法dot(.)在 TextFormField 中输入。
注意:用户不应在 中输入多于一位小数的数字TextFormField。
flutter ×8
dart ×7
ios ×5
xcode ×3
android ×2
objective-c ×2
swift ×2
certificate ×1
dart-sdk ×1
info.plist ×1
iot ×1
java ×1
mqtt ×1
regex ×1
regex-group ×1
wifi ×1
xcode8 ×1