Невозможно загрузить изображение из файла .. / url.png в flutter

#flutter #flutter-layout #flutter-dependencies

#flutter #flutter-layout #flutter-зависимости

Вопрос:

Я новичок в flutter, поэтому, возможно, это глупые вопросы, но будет полезно, если кто-нибудь проинструктирует меня, что делать.Теперь моя проблема в том, что я получаю следующую ошибку

 Xcode build done.                                           112.6s
Failed to build iOS app
Error output from Xcode build:
↳
2020-09-26 04:11:00.741 xcodebuild[90742:789061] [MT] PluginLoading: Required plug-in compatibility UUID 6C8909A0-F208-4C21-9224-504F9A70056E for plug-in at path '~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/OMColorSense.xcplugin' not present in DVTPlugInCompatibilityUUIDs
2020-09-26 04:11:04.520 xcodebuild[90742:789061] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x7fd813277b00), Emon’s iPhone, iPhone, 13.7 (17H35), 9fe97cddff9918950e20b4f3a886f364f10869de> == Underlying device preparation errors ==
2020-09-26 04:11:04.521 xcodebuild[90742:789061] [MT] iPhoneConnect: Failed _shouldMakeReadyForDevelopment check even though device is not locked by passcode.
Domain: com.apple.platform.iphoneos
Code: 5
Failure Reason: allowsSecureServices: 1. isConnected: 0. Platform: <DVTPlatform:0x7fd812812350:'com.apple.platform.iphoneos':<DVTFilePath:0x7fd8128121a0:'/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform'>>. DTDKDeviceIdentifierIsIDID: 0
User Info: {
              DVTDeviceDescription = "Ud83dUdcf1<DVTiOSDevice (0x7fd813277b00), EmonU2019s iPhone, iPhone, 13.7 (17H35), 9fe97cddff9918950e20b4f3a886f364f10869de>";
}
--
2020-09-26 04:11:04.521 xcodebuild[90742:789061] [MT] iPhoneConnect: 📱<DVTiOSDevice (0x7fd813277b00), Emon’s iPhone, iPhone, 13.7 (17H35), 9fe97cddff9918950e20b4f3a886f364f10869de> == END: Underlying device preparation errors ==
2020-09-26 04:11:18.281 xcodebuild[90742:789589] /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-17219/XCSourceControl/Service/XCSourceControlXPCServiceClient.swift: 'com.apple.dt.GitHubHostBuiltInExtension' XPC connection interrupted: <NSXPCConnection: 0x7fd8131e30d0> connection to service on pid 0 named com.apple.dt.GitHubHostBuiltInExtension
2020-09-26 04:11:19.285 xcodebuild[90742:789589] /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-17219/XCSourceControl/Service/XCSourceControlXPCServiceClient.swift: 'com.apple.dt.BitbucketHostBuiltInExtension' XPC connection interrupted: <NSXPCConnection: 0x7fd8137832f0> connection to service on pid 0 named com.apple.dt.BitbucketHostBuiltInExtension
2020-09-26 04:11:20.294 xcodebuild[90742:789589] /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-17219/XCSourceControl/Service/XCSourceControlXPCServiceClient.swift: 'com.apple.dt.GitLabSelfHostBuiltInExtension' XPC connection interrupted: <NSXPCConnection: 0x7fd813545810> connection to service on pid 0 named com.apple.dt.GitLabSelfHostBuiltInExtension
** BUILD FAILED **
Xcode's output:
↳
../../../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:88:26: Error: Type 'DiagnosticableMixin' not found.
class PictureStream with DiagnosticableMixin {
                         ^^^^^^^^^^^^^^^^^^^
../../../../.pub-cache/hosted/pub.dartlang.org/flutter_svg-0.17.4/lib/src/picture_stream.dart:192:44: Error: Type 'DiagnosticableMixin' not found.
abstract class PictureStreamCompleter with DiagnosticableMixin {

Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'path_provider' from project 'Pods')
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'image_picker' from project 'Pods')
warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99. (in target 'Flutter' from project 'Pods')
Could not build the precompiled application for the device.


It appears that your application still contains the default signing identifier.
Try replacing 'com.example' with your signing id in Xcode:
open ios/Runner.xcworkspace
  

Я подумал, что это ошибка svg, поэтому я изменил в pubspec.yaml from flutter_svg: ^0.17.4 на flutter_svg: ^0.18.0 тогда я получаю эту ошибку.Но если я использую flutter_svg: ^0.17.4 , я получаю следующую ошибку:

  Exception has occurred. FlutterError (Unable to load asset: imageurl/fs.png
  

Я также пытался использовать этот websafe_svg: ^1.1.4 пакет, но все та же ошибка.Не могли бы вы мне помочь, что я могу сделать для решения этой проблемы?

Заранее спасибо.

Ответ №1:

Извините всех за то, что потратили ваше время на чтение моего глупого вопроса.Позвольте мне прояснить, какую глупость я совершил. Для последней версии xcode (в моем случае xcode 12) я использовал cupertino_icons: ^0.1.0 in pubspec.yaml file, поэтому я получал ошибку зависимостей для пакета flutter_svg.Это должно be cupertino_icons: ^0.1.3 и flutter_svg: ^0.18.0

Вторая глупость — это попытка загрузить изображение с помощью image.asset() thats, поэтому, хотя я использовал flutter_svg: ^0.18.0 , но все же получал Exception has occurred.Because it was searching that image url in my application asset folder.FlutterError (Unable to load asset: эту ошибку. Поэтому я изменил его на FadeInImage.assetNetwork

Надеюсь, мой ответ поможет кому-то, если возникнет какая-либо проблема, подобная моей.