Tag Archives: ios

[Solved] flutter Project Error: ScrollController attached to multiple scroll views, Failed assertion: line 109 pos 12

1. Explain

Recently, I encountered an error when writing the shuttle project:

The following assertion was thrown while handling a gesture:
ScrollController attached to multiple scroll views.
'package:flutter/src/widgets/scroll_controller.dart':
Failed assertion: line 109 pos 12: '_positions.length == 1'

Reasons for error reporting:
1 The drawing function added to the project needs to navigate to different pages through the menu items of the drawing
2. A bottom navigation bar is added to the home page to navigate to different pages through the pagecontroller
3. The project manages routing and status through geTx.

Description of the problem: navigate to the settings or other pages through the drawer, and then re-navigate to the home page through the drawer. Click the item item item of the BottomNavigationBar, and will appear the error messages:

Failed assertion: line 109 pos 12: ‘_positions.length == 1’


2. Solution:

1. Drawer navigation uses Get.offAndToNamed(‘12313’); to jump.
2. You need to reinitialize the pageController every time you jump to the homepage. Through the build method of GetView, the controller is reinitialized every time the homepage interface is redrawn.

Specific operation:

code for the navigation part of the drawer:

class AppRouteProvide {
  Future onRouteTo(String routeName) {
    switch (routeName) {
      case Routes.Auth:
        Get.toNamed(Routes.Auth);
        break;
      case Routes.Home:
        Get.offAndToNamed(Routes.Home);
        break;
      case Routes.Help:
        Get.offAndToNamed(Routes.Help);
        break;
      case Routes.Splash:
        Get.toNamed(Routes.Splash);
        break;
      case Routes.Connect:
        Get.offAndToNamed(Routes.Connect);
        break;
      case Routes.Setting:
        Get.offAndToNamed(Routes.Setting);
        break;
    }
    return Future.value();
  }
}

Code of home page view:

class HomeScreen extends GetView<HomeController> {
  @override
  Widget build(BuildContext context) {
    // print('HomeScreen build');
    if (controller.pageController.hasClients) {
      controller.onClose();
      controller.onInit();
    }
    return AppbarWidgetScreen(
      body: _buildBody(context),
      bottomBar: _buildBottomNavigationBar(context),
    );
  }

Home page controller part code


class HomeController extends GetxController {
  final ApiRepository apiRepository;
  RxInt selectedIndex = 0.obs;

  late PageController pageController;
  RxList<Widget> widgetPage = <Widget>[
    HomeMainScreen(),
    HomeBuyScreen(),
    HomeCertScreen(),
    HomeSellScreen(),
    HomeMineScreen(),
  ].obs;

  HomeController({required this.apiRepository});

  @override
  void onReady() {
    super.onReady();
  }

  @override
  void onInit() {
    print('HomeController onInit()');
    pageController = PageController(
      initialPage: selectedIndex.value,
      keepPage: true,
    );
    super.onInit();
  }

  @override
  void onClose() {
    super.onClose();
  }

Pod install Error: LoadError [How to Solve]

The boss told me that this is the problem that M1 may encounter, but I’m not M1, and I haven’t updated the system!!! Hahaha, fuck
these two pits are encountered
x 'require': incompatible library version........ (LoadError)

cannot load such file -- 3.0/ffi_c (LoadError)

Screenshot above
when these two pits are encountered. Baidu, there are few online solutions, and the cocoapods are deleted and retried. It’s useless
finally, read the tips carefully!! Let’s enter
gem pristine executable - hooks -- version 1.6.1
but we still can’t
finally, we found it was input 👆 This command has insufficient permissions
you can reuse cocoapods by adding sudo before this command, and pod install is normal. The correct command is as follows
sudo gem pristine executable - hooks -- version 1.6.1

Cocoapods Upgrade Error: ffi * * * * [How to Solve]

Building native extensions. This could take a while...
ERROR:  Error installing cocoapods:
	ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20211117-13754-1pf53tk.rb extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
	--with-ffi_c-dir
	--without-ffi_c-dir
	--with-ffi_c-include
	--without-ffi_c-include=${ffi_c-dir}/include
	--with-ffi_c-lib
	--without-ffi_c-lib=${ffi_c-dir}/lib
	--enable-system-libffi
	--disable-system-libffi
	--with-libffi-config
	--without-libffi-config
	--with-pkg-config
	--without-pkg-config
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `block in try_compile'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:534:in `with_werror'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:585:in `try_compile'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1109:in `block in have_header'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:357:in `postpone'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1108:in `have_header'
	from extconf.rb:10:in `system_libffi_usable?'
	from extconf.rb:42:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/ffi-1.15.4/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.4 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/ffi-1.15.4/gem_make.out

In case of the above error, pay attention to the log file on the penultimate line and open it   Mkmf.log file.

Found inside  The path to the universal-darwin20 folder, yours may be   universal-darwin21

Enter this folder and copy  A copy of universal-darwin 20 is changed to   Universal-darwin 19 will do.

[Solved] Upload object failed, error: error domain = nscocoaerrordomain code = 260 “aliyun object stores OSS IOS upload files

Aliyun object stores OSS and IOS uploaded files,

Alibaba cloud OSS object store official demo


put.uploadingFileURL = [NSURL fileURLWithPath:@"<filePath>"];
// put.uploadingData = <NSData *>; // Upload NSData

You need a file path here. You can’t write the file name directly.

Upload object failed, error: error domain = nscocoaerrordomain code = 260 “the file” 123456.PNG “couldn’t be opened because there is no such file

The correct wording should be:

    NSString * filePath = [[NSBundle mainBundle] pathForResource:@"123456" ofType:@"png"];
    put.uploadingFileURL = [NSURL fileURLWithPath:filePath];

Then it succeeded!!!

[Solved] Unity Import Xcode Project Error: iOS framework addition failed due to a CocoaPods installation failure.

iOS framework addition failed due to a CocoaPods installation failure. This will will likely result in an non-functional Xcode project.

When unity exports the Xcode project, it relies on the third-party cocoapods library. The error is as follows.

Solution:

Although the warning is written in the error, the warning problem is solved and the error is no longer reported.

cd ~
vim .profile  # If not, execute the following command, if yes, fill in export LANG=en_US.UTF-8
touch .profile # New .profile
source .profile # Let it take effect

The specific error reports are as follows (part):

iOS framework addition failed due to a CocoaPods installation failure. This will will likely result in an non-functional Xcode project.

After the failure, "pod repo update" was executed and succeeded. "pod install" was then attempted again, and still failed. This may be due to a broken CocoaPods installation. See: https://guides.cocoapods.org/using/troubleshooting.html for potential solutions.

pod install output:



    [33mWARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
    Consider adding the following to ~/.profile:

    export LANG=en_US.UTF-8
    [0m
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/unicode_normalize/normalize.rb:141:in `normalize': Unicode Normalization not appropriate for ASCII-8BIT (Encoding::CompatibilityError)
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:166:in `unicode_normalize'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:166:in `installation_root'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:226:in `podfile_path'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:105:in `markdown_podfile'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/user_interface/error_report.rb:30:in `report'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:66:in `report_error'
	from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:396:in `handle_exception'
	from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:337:in `rescue in run'
	from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:324:in `run'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
	from /usr/local/bin/pod:25:in `load'
	from /usr/local/bin/pod:25:in `<main>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/unicode_normalize/normalize.rb:141:in `normalize': Unicode Normalization not appropriate for ASCII-8BIT (Encoding::CompatibilityError)
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:166:in `unicode_normalize'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:166:in `installation_root'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:226:in `podfile_path'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/config.rb:205:in `podfile'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:160:in `verify_podfile_exists!'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command/install.rb:46:in `run'
	from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/lib/cocoapods/command.rb:52:in `run'
	from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.2/bin/pod:55:in `<top (required)>'
	from /usr/local/bin/pod:25:in `load'
	from /usr/local/bin/pod:25:in `<main>'



pod repo update output:

Updating spec repo `cocoapods`
  $ /usr/local/bin/git -C /Users/liuyongjie/.cocoapods/repos/cocoapods fetch origin --progress
  $ /usr/local/bin/git -C /Users/liuyongjie/.cocoapods/repos/cocoapods rev-parse --abbrev-ref HEAD
  master
  $ /usr/local/bin/git -C /Users/liuyongjie/.cocoapods/repos/cocoapods reset --hard origin/master
  HEAD 现在位于 9734315382c8 [Add] HBS-UI 1.1.0
Updating spec repo `ftsview-the-fotoable-cocoapods-specs`
  $ /usr/local/bin/git -C /Users/liuyongjie/.cocoapods/repos/ftsview-the-fotoable-cocoapods-specs fetch origin --progress
  $ /usr/local/bin/git -C /Users/liuyongjie/.cocoapods/repos/ftsview-the-fotoable-cocoapods-specs rev-parse --abbrev-ref HEAD
  master
  $ /usr/local/bin/git -C /Users/liuyongjie/.cocoapods/repos/ftsview-the-fotoable-cocoapods-specs reset --hard origin/master
  HEAD 现在位于 8984dba [Update] FtAdsPlatform (4.4.8.4)


    [33mWARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
    Consider adding the following to ~/.profile:

    export LANG=en_US.UTF-8

Failed to register observatory port with mDNS with error

An error is reported when Fletter runs IOS real machine: failed to register observation port with mDNS with error

Errors are reported as follows

[VERBOSE-2:FlutterObservatoryPublisher.mm(101)] Failed to register observatory port with mDNS with error -65555.
[VERBOSE-2:FlutterObservatoryPublisher.mm(103)] On iOS 14+, local network broadcast in apps need to be declared in the app's Info.plist. Debug and profile Flutter apps and modules host VM services on the local network to support debugging features such as hot reload and DevTools. To make your Flutter app or module attachable and debuggable, add a '_dartobservatory._tcp' value to the 'NSBonjourServices' key in your Info.plist for the Debug/Profile configurations.

Solution: (refer to the official link document above)

On iOS 14 and higher, enable the Dart multicast DNS service in the Debug version of your app to add debugging functionalities such as hot-reload and DevTools via flutter attach.

1. Rename the application’s info.plist to info-debug.plist. Make a copy called info-release.plist and add it to the Xcode project
2. In info-debug.plist, add the key nsbonjourservices and set the value to_ dartobservatory._ tcp

(optional) add the key nslocalnetworkusagedescription to the text of the desired custom permissions dialog box. (Note: ‘allow shutter tools on your computer to connect and debug your application. This prompt will not appear on release builds.’)

3. In target’s build settings, modify the info.plist file path path/to/info.plist to path/to/Info – $(configuration). Plist.
4. In target’s – & gt; Build Settings > Build Phases > Copy bundle resources build phase. If info-release.plist is deleted (I have deleted it in the figure below)

reference resources

[Solved] Searching for inspections failed: undefined method `map‘ for nil:NilClass“

Recently, the new project of pod reported this error. My Mac M1, record it

[cocoapods error]: searching for inspections failed: undefined method ` map ‘for nil: nilclass “error

Solution: execute the following command line

sudo arch -x86_64 gem install ffi

Then pop install

[Solved] validateNewTexture:89: failed assertion `BytesPerRow of a buffer-backed texture with pixelFormat

IPA runtime tips compiled after Xcode upgrade (version 13.1)

validateNewTexture:89: failed assertion `BytesPerRow of a buffer-backed texture with pixelFormat(MTLPixelFormatBGRA8Unorm) must be aligned to 64 bytes, found bytesPerRow(5344)'

Solution:
Product->Scheme->Edit Scheme->Diagnostics->Cancel API Validation

Reference: https://stackoverflow.com/questions/58043738/validatenewtexture89-failed-assertion-bytesperrow-of-a-buffer-backed-texture/58051893

Prompt IPA processing failed when exporting IOS adhoc

Prompt IPA processing failed when IOS adhoc

View the log of standard to view errors

View standard’s log

The log contains a large string of simulator information, so directly search the x86 keyword, and then check which framework is included, and then CD go in. Remember to enter the framework and remove i386 and x86_ 64

lipo -info xxxx

Remove command:

lipo -remove i386 xxxx -o xxxx
lipo -remove x86_64 xxxx -o xxxx

View errors

Before, I was misled by the Internet. I had to search all the "x86" keywords, and then search out Ruby (universal. X86_64) , thinking about viewing or updating with lipo , which wasted a lot of time and failed… Finally, homebrew
is also updated

Finally, I tried to search error , and found that framework was included in bundle of tent , and finally it was OK to remove it
IPA processing failed will be prompted when IOS ad hoc , the framework in tencetopen is attached with x86 , after removal, you can check the keywords of failed or error in your log.

Mon 08

03:00

06:00

09:00

12:00

03:00

06:00

09:00

Tue 09

Remove all SDK schemas

Update relevant environment

IOS tasks

IOS diagram functionality to mermaid

Follow up interest can be focused on the following column or official account number [Python2048].

"Android - the world of hackers"
"difficult and miscellaneous bugs - no language"


Author: Altman Superman dujinyang

Source: CSDN

Original text: https://dujinyang.blog.csdn.net/

Copyright notice: This is the original article of blogger Du Jinyang. Please attach the blog link for reprint!

[Solved] LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443

Error:
[!] Error installing DoubleConversion
[!] /usr/bin/git clone https://github.com/google/double-conversion.git /var/folders/_h/xtz7k0td2vv6r1hq9jswkyx40000gn/T/d20211021-51746-zrhmvm –template= –single-branch –depth 1 –branch v1.1.6
Cloning into ‘/var/folders/_h/xtz7k0td2vv6r1hq9jswkyx40000gn/T/d20211021-51746-zrhmvm’…
fatal: unable to access ‘https://github.com/google/double-conversion.git/’: LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
Solution:

git config --global --add remote.origin.proxy ""

If the above method doesn’t work

Find ways to improve the network and use mobile phone hotspots
take a look at pod install several times

Command PhaseScriptExecution failed with a nonzero exit code

1. Your project should report this problem when compiling after pod install, as shown in the figure below

2. Let’s start with the solution option CD  /Users/yixuan/Downloads/bluecollar_ gongdi_ IOS/bluecollar/pods/target support files/pods bluecollar/pods bluecollar resources.sh this file is located in the folder

3. CD to the pods directory where the error is reported, and then execute the command Chmod a + X pods-bluecollar-resources.sh to solve the problem

4. Cocoapods provides a bash script named pods-resources.sh, which will be executed every time the project is compiled to copy various resource files of the third-party library to the target directory.

5. Cocoapods sets all dependencies and parameters at compile time through a file named pods.xcconfig.

RuntimeError – [Xcodeproj] Unknown object version.

After xcode13 is upgraded, if a new project is built, pod install will report an error, as shown in the figure:

Reason: This is because the local version of Xcode does not match the version of cocoapods. You need to update cocoapods
solution:

Refer to the solution provided on the Internet and input the command at the terminal  $ gem install cocoapods --pre  

Error will be reported:     You don’t have write permissions for the /Library/Ruby/Gems/2.6.0 directory.

  Solution: input in the terminal     sudo gem install -n /usr/local/bin cocoapods –pre

It can be used normally in pod install