Tag Archives: ios

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

 

Error reporting and resolution of #selector above swift5

Error reporting and resolution of #selector above swift5

The version of swift has changed a lot recently. If you add an event to a button, you must be very skilled in OC. How do you define functions and pass parameters in
swift

 let btn = UIButton()
 btn.tag = 2
 btn.addTarget(self, action: #selector(buttonClick(button:)), for: .touchUpInside)

  @objc func buttonClick(button: UIButton) {
       button.isSelected = true
       print(btn.tag!)
        print("\(btn.tag)")
 }

The custom method must be preceded by @ objc to follow the OC mechanism, otherwise an error will be reported

Xcode12.5 package framework error [How to Solve]

1. General

Today, Xcode was upgraded to 12.5.1. When compiling the existing project, the problem of swift incompatibility reported by referring to the framework compiled by swift appeared again. According to previous experience, just pack it again with the latest version of Xcode, but my colleague recommended a configuration to avoid the problem of swift incompatibility in the later stage, but this configuration was set, But it triggered a series of changes.

2. Project configuration and script modification

2.1. Modify the build libraries for distribution configuration item

This upgrade will ‘build settings’ – & gt` Build Options`->` Build libraries for distribution ` is set to yes, which has solved the problem of incompatibility in the later stage (it is set temporarily and needs to be verified in the later stage).

two point two   Modify project build system

Because ‘build libraries for distribution’ is set to yes, ‘project settings’ – & gt; under’ file ‘in the Project menu` Build system needs to be changed from ‘legacy build system’ to ‘new build system (default)’. Otherwise, packaging will fail with the following error.

  two point three   Modify the universal aggregate script file

Our project uses a universalaggregate script file to execute the other two script files. One is xxxxkitaggregate of IOS_ IOS, one is xxxxkitaggregate of tvos_ tvOS。 In the universalaggregate script, add ` – usemodernbuildsystem = no ‘after the two instructions respectively. If it is set to no, it means that the build system adopts’ legacy build system’, and if it is set to yes, it adopts’ new build system (default) ‘. As follows:

xcodebuild -target "XXXXKitAggregate_iOS" BUILD_DIR="${BUILD_DIR}" -UseModernBuildSystem=NO
xcodebuild -target "XXXXKitAggregate_tvOS" BUILD_DIR="${BUILD_DIR}" -UseModernBuildSystem=NO

Add ` – usemodernbuildsystem = no ‘to avoid disk read-write errors caused by simultaneous packaging of IOS and tvos
the error is as follows:

--error: error: accessing build database "xxx/build/XCBuildData/build.db": disk I/O error

Or:

accessing build database "/Users/xxxx/Work/Git/NLDFramework/XXXToolKit/build/XCBuildData/build.db": database is locked Possibly there are two concurrent builds running in the same filesystem location.

2.4 modify the packaging script (xxxxkitaggregate_ios, xxxxkitaggregate_tvos)

Add ‘RM – RF ${build_dir}’ before the ‘xcodebuild – target “XXXX’ command, and remove ‘clean’ from the ‘xcodebuild’ command, as shown in the following figure:

Before each build, delete the build file directory to avoid the following errors:

Could not delete `/Users/xxxx/Work/Git/NLDFramework/XXXMenuKit/build` because it was not created by the build system.

2.5 modify the configuration in Jenkins project

If the framework is packaged through Jenkins, you need to find the build configuration under the corresponding project configuration in Jenkins and check ‘allow failing build results’. Otherwise, Jenkins packaging will fail due to disk read-write exceptions. Check it, that is, ignore the exceptions and put the packaged framework in the specified location.

If not checked, Jenkins’s final output results are as follows:

When checked, Jenkins’s final output results are as follows: