Tag Archives: ios

[Solved] SSZipArchive Decompress Error: failed to open file in zip file

1. Add manually and drag ssziparchive library directly, and an error will be reported

Error Domain=SSZipArchiveErrorDomain Code=-2 “failed to open file in zip file”

2. Solution

Notes for using ssziparchive:



build Setting-Preprocessor Macros–Multiple values (Double-Click), add the following codes:



[Solved] Uniapp packaging IOS error: Apple root certificate is not installed in the current system

Hbuilderx: for IOS peace of mind packaging, MacOSX 10.14 and below systems need to install relevant certificates

Treatment method:

1. Open the certificate directory

2. Click the certificate, enter the computer password, allow the key chain to access, and confirm that the certificate is valid in the key chain

3. Other certificates in the certificate directory should also be obtained

IOS upgrade to xcode13 simulator running error

Xcode13 running simulator reports an error and the real machine is normal

building for iOS Simulator, but linking in object file built for iOS, xxxx for architecture arm64

Solution here is only a real and effective solution of my own

build settings -> Validate workspace (set to yes)

Set validate workspace to yes, and then run the simulator. The simulator really runs


Flutter project package IOS error [How to Solve]

Flutter packs IPA and reports an error course not find an option named “track widget creation”.
it should be caused by the different forms of dart language in debug mode and release mode.
in debug mode, flutter supports more dynamic language features such as hot overload, and these features are turned off in release mode

$flutter build ios --release


Openssh installation error after IOS jailbreak [How to Solve]

Install openssh error

Try restarting the phone to reinstall

Set the phone language to English

set the phone to flight mode and download it with WiFi (my solution)

After the above steps, IOS 8.4 jailbreak successfully downloaded openssh

Then install network command in Cydia

Run ifconfig – L and the result is as follows

 ifconfig -l
lo0 pdp_ip0 pdp_ip1 pdp_ip2 pdp_ip3 ap1 en0 en1 awdl0
wodeshouji:~ root# ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    inet netmask 0xff000000 
pdp_ip0: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
pdp_ip1: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
pdp_ip2: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
pdp_ip3: flags=8010<POINTOPOINT,MULTICAST> mtu 1500
ap1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
    ether aa:88:08:47:f0:e7 
    inet netmask 0xffffff00 broadcast
    ether a8:88:08:47:f0:e7 
    ether aa:88:08:47:f1:7f 
    ether 66:1a:ae:c0:52:0b


En0 is the local network card, packet capture command

tcpdump -X -s0 -i en0 -w /tmp/dump.pcap

Then download dump.pcap and put it into Wireshark for analysis

[IOS series] -A server with the specified hostname could not be found. Problem solved

Reveal can easily view the layout of the interface in iOS development. It is more convenient to find out that the view (etc.) does not appear or is blocked, which saves a lot of time.

But today Reveal has a problem:A server with the specified hostname could not be found.

Screenshot below:

Google took a look and found an article that might tell the truth about the problem.

Reference documents

There is a sentence in it

The real issue was that I had messed up my /etc/hots file and localhost was broken.

So that is, the hosts file is damaged, then check the hosts file and execute it in the terminal: (It is not a vim party, so I am used to using the open command, the system will call the editor to open)

 open /etc/hosts


# SwitchHosts!
# My Hosts

It turns out that the hosts have really been tampered with. Reveal seems to need port.

So change the hosts file back, as follows (how to change is described later):

# SwitchHosts!
# Host Database
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##	localhost	broadcasthost
::1             localhost 

After thinking about it, I discovered that the hosts file was modified a few days ago. The tool used is: SwitchHosts! An open source software that integrates management and switching N Hosts solutions.

SwitchHosts download page -you can choose the latest version to download

Note: It is invalid to modify the hosts file directly. I want to execute su /etc/hostsit with administrator authority , but it always returns su: Sorry, but I can modify it directly if I have SwitchHosts, so I don’t pay attention to the issue of this authority.

Modify interface of hosts file

After saving, open Reveal again to find it can be used.

[Solved] IOS Package Error: ARCHIVE FAILED:Command CodeSign failed with a nonzero exit code



Open project with Xcode

Command + K restart the computer

Reference: Xcode packing error command codesign failed with a nonzero exit code

[wrong guess]

After reading other people’s summary, I feel that it may be the problem caused by updating the Mac operating system


Xcode packaging failed: xcrun codesign failed with exit code 1


Here is the requirement after upgrading MacOS High Sierra

1. Set the login password and the password of Apple Developer account (= = icloud), otherwise

2. Later, I jumped out of the login dialog box many times and asked to enter icloud’s password – “because I couldn’t remember the password clearly at that time

3. After that, I entered the correct password immediately, but due to network problems, I failed to log in normally

4. And later, although the network was successful and the password was correct, it did not disappear because of the previous pop-up box

This seems to lead to:

The apple related (project) Certificate in login is estimated to be unable to be accessed normally

-, which leads to an error in codesign when Xcode goes to archive to package the project

The solution is:

Make sure that icloud’s login password has been updated and logged in after upgrading MacOS High Sierra

Here is:

Restart the Mac, making the previous box disappear

When you want to enter the password, enter the correct password and log in to icloud

If not, go to Keychain to reset the login password

Keychain access edit change password for Keychain login

In this way, Xcode can have the right to access the certificate in the keychain with the correct password, and can code design and package normally

[Solved] Error in uploading app icon when IOS app is released (image can’t contain alpha channels or transparencies)

Today, when I published iOS app to AppStore, the webpage prompted an error when I uploaded App icon (image can’t contain alpha channels or transparencies), and after checking online, I found that Apple officially set new rules for App icon upload. Previously, it was OK to upload a PNG image. Now you need to open the PNG image with preview to generate a JPEG image, and then upload it again.

There are other solutions, as follows.

Solution 1

AFAIK png with transparency is not allowed. use jpg OR update your png (photoshop or whatever you using to create the png) and delete the transparency areas. if you work with shadows, use jpg, that will do no headaches.

Solution 2

I’ve found you can also just re-export the png’s in Preview, but uncheck the Alpha checkbox when saving.

Solution 3

For this i made a new simple tool. You can remove alpha channel (transparency) of multiple .png files within seconds.

You can download from here http://alphachannelremover.blogspot.com

Solution 4

Usemogrifytool fromImageMagickpackage to remove alpha channel.

brew install imagemagick
cd folder_with_images
mogrify -alpha off */*.png

Update from May 3

You can tell whether image contains alpha channel by running:

sips -g all image.png

In case you render screenshots in iOS Simulator you can drop alpha channel by passingBOOL opaque = YEStoUIGraphicsBeginImageContextWithOptions:

UIGraphicsBeginImageContextWithOptions(imageSize, YES, 0); 

Solution 5

If you are using Photoshop go File > Save for web (Command + Option + Shift + S). Make sure the Transparency is unchecked and this should work.

Solution 6

i have same problem just compress your png file on https://tinypng.com/ online and then try to upload that new compressed png file.

its work for me.

Solution 7

i was able to useimageoptimto remove alpha channel and compress png files.

Solution 8

You can remove the alpha channel from a PNG file from the command line with pngcrush, using the flag “-c 2”:

$ file input.png
input.png: PNG image data, 1024 x 1024, 8-bit/color RGBA, non-interlaced
$ pngcrush -q -c 2 input.png output.png
libpng warning: iCCP: known incorrect sRGB profile
$ file output.png
output.png: PNG image data, 1024 x 1024, 8-bit/color RGB, non-interlaced

Note the change from RGBA to RGB: the Alpha channel is gone!

pngcrush lives at http://pmt.sourceforge.net/pngcrush/

Solution 9

On Pixelmator you can use ‘Share > Export for Web…’ (⇧+⌘+E)

and deselectTransparencyin the Tool Options Bar.

Solution 10

You must remove alpha channels when uploading a photo.

You can do this by Preview, Photos App (old iPhoto), Pixelmatr or even Adobe Photoshop. I will explain it in Preview.

First, open a photo in Preview. If the photo is in your photo album in Photos app (the old iPhoto), then simply drag it from the album to desktop. Then control-click (right-click when mouse) the duplicated photo and select Preview.app under Open With menu.

Second, Select Export… under File menu, and after selecting the destination, uncheck Alpha at the bottom, and export.

Finally, upload the new photo to iTunes Connect.

Solution 11

To get around the problem I batched converted using fireworks my png32 files to png24 for upload quick and easy. Jpeg works also but it is lossy.

Solution 12

If you have imagemagick installed, then you can put the following alias into your .bash_profile. It will convert every png in a directory to a jpg, which automatically removes the alpha. You can use the resulting jpg files as your screen shots.

alias pngToJpg='for i in *.png; do convert $i ${i/.png/}.jpg; done'

Solution 13

What worked for me here was using a jpg file instead of PNG as jpg files don’t use alpha or transparency features. I did it via online image converter or you can also open the image in preview and then File->Export and uncheck alpha as option to save the image and use this image.

Solution 14

Convert your PNG image to JPEG format.


The problem and solution of local storage in Safari under IOS

One of our small applications uses Baidu map API to get the user’s coordinates, and then uses localstorage to do the next cache. After the test goes online, some students from the operation feedback that the page data can’t be pulled

No problem was found during the test, and one of the two identical iPhones could work and the other could not. Finally, it was found that there was a problem with localstorage

But why is it that two mobile phones of the same version can be used one by one

And the two mobile phones are all objects. It’s strange

I didn’t find the answer on Du Niang. Finally, I went to Google and found that it was caused by private browsing mode. Then check the safari of IOS and find no privacy settings

Later, click on the small box in the lower right corner to find a traceless browsing mode. The solution is as follows:

Method 1

// Safari, in Private Browsing Mode, looks like it supports localStorage but all calls to setItem
// throw QuotaExceededError. We’re going to detect this and just silently drop any calls to setItem
// to avoid the entire page breaking, without having to do a check at each usage of Storage.
if (typeof localStorage === ‘object’) {
try {
localStorage.setItem(‘localStorage’, 1);
} catch (e) {
Storage.prototype._ setItem = Storage.prototype.setItem;
Storage.prototype.setItem = function() {};
alert(‘Your web browser does not support storing settings locally. In Safari, the most common cause of this is using “Private Browsing Mode”. Some settings may not save or some features may not work properly for you.’);

Method 2

Using cookies to store data (for small amount of data)

Traceless mode should disable the localstorage object, but window. Localstorage exists, but document. Cookie can be used

 try {
        localStorage.setItem('isPrivateMode', '1');
        window.isPrivateMode = false;
    } catch(e) {
        window.isPrivateMode = true;
    if (!window.isPrivateMode && window.localStorage) { // 不是 Safari 无痕模式并且能用 localStorage



            var cookie = new cookies();




var cookies = function(){};
cookies.prototype = {
    setCookie:function(c_name, value, expiredays){
        var exdate=new Date();
        exdate.setDate(exdate.getDate() + expiredays);
        document.cookie=c_name+ "=" + escape(value) + ((expiredays==null) ?"" : ";expires="+exdate.toGMTString());
        var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");

            return (arr[2]);
            return null;

        var cookie = new cookies();
        var exp = new Date();
        exp.setTime(exp.getTime() - 1);
        var cval=cookie.getCookie(name);
            document.cookie= name + "="+cval+";expires="+exp.toGMTString();