Tag Archives: ios

Could not find module ‘xxxxxxx‘ for target ‘arm64-apple-ios-simulator‘;

Xcode12 simulator compilation error

After upgrading Xcode to 12.0.1, the following error occurred in simulator compilation
Could not find module ‘xxxxxxx’ for target ‘arm64-apple-ios-simulator’; found: x86_ 64-apple-ios-simulator, x86_ 64
many methods have been found on the Internet, but they can’t be solved. Later, they have been solved through research. Here’s a record

First of all, make clear the concept

There is an architecture option in

    Xcode, and its value is standard architectures – $(arcs)_ Standard) is (armv7 and arm64) in real machine compilation, and (x86) in simulator compilation_ If the build active architectures only option in Xcode is yes, it means that only the current architecture will be compiled. For real computers, it is generally arm64, and the emulator is usually x86_ 64. If it is no, it means that the supported architectures are compiled at the same time. The exclusive architectures option in Xcode of the above architectures means that the excluded architectures are filled in here. Therefore, if arm64 is used here, it means that you do not want to compile the valid in Xcode_ As for the arcs option, it’s the current effective architecture (I’m also dizzy. Apple is so complicated that it needs this when it has 1). Generally, the value filled in here is the same as 1

    So here comes the question…. The problem I encountered was that I filled in arm64 arm64e in 4, so the compiler simulator kept reporting errors, and then changed all kinds of things, including the architecture of the third Library in pods.

    Solution
    although Standard Architecture (x86) is set in 1_ However, the effective architecture in 4 is arm64, arm64e, so only arm64 can be used for the simulator. (it is said that the simulator of xcode12 supports arm64, but my computer is i5, so this one doesn’t use arm64). So the module he compiled is for ‘arm64 Apple IOS simulator’, but the simulator is found: x86_ 64-apple-ios-simulator。 So I made a mistake if you encounter the same type of mistakes, you can think clearly about the relationship between 1, 2, 3 and 4.

    Pod component

    post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            if config.name == 'Debug'
              config.build_settings["VALID_ARCHS"] = "arm64 arm64e x86_64 i386"
            else
              config.build_settings["VALID_ARCHS"] = "arm64 arm64e"
            end
        end
    end
    end
    

    Finally, the project clean recompile, OK

[app] install and compile libimobililedevice, How to solve the error

Problem Description:

Error: Failure while executing; `tar --extract --no-same-owner --file /Users/xmly/Library/Caches/Homebrew/downloads/58f1d108442b2cdceb8e86e7d05328381fd0a85b67ae46a66fa710f8f1786b02--libtasn1-4.16.0_1.big_sur.bottle.tar.gz --directory /private/tmp/d20210629-40261-ibafl5` exited with 1. Here's the output:
tar: Error opening archive: Failed to open '/Users/xmly/Library/Caches/Homebrew/downloads/58f1d108442b2cdceb8e86e7d05328381fd0a85b67ae46a66fa710f8f1786b02--libtasn1-4.16.0_1.big_sur.bottle.tar.gz'

Cause of the problem:

Maybe some of the dependent libraries were not downloaded
later, after the installation environment was prepared, they succeeded


* brew install build-essential automake autoconf git cmake pkg-config libtool

install

* Method 1:
	git clone https://github.com/libimobiledevice/libimobiledevice.git
	cd libimobiledevice
	./autogen.sh
	make
	sudo make install

* Method 2:
	brew install --HADE libmobliedevice
	# If you do not add - HADE installation is an older version, does not support IOS 10 or above

It is invalid to submit the content directly after pasting it on the mobile terminal of Vue HTML5 editor

Modify the source code vue-html5-editor.js
Directory:

open this file, search for contenteditable, add id = “container”

and then search for Keyup
comment code

 // content.addEventListener('keyup', function () {
 //     this$1.$emit('change', content.innerHTML);
 //     this$1.saveCurrentRange();
 // }, false);

Add code

const handleListenChange = (mutationsList, observer) => {
 this$1.$emit('change', content.innerHTML);
 this$1.saveCurrentRange();
}
const mutationObserver = new MutationObserver(handleListenChange)
const element = document.querySelector('#container')
const options = {
 attributes: true,
 childList: true,
 subtree: true,
 characterData: true
}

It’s like this on the whole

I’ve looked at others and modified it myself. This question is more detailed than that of the blogger. Link to attach. If you have any other questions, take a look
CSDN of Dashen

The solution of MAC OpenSSL is not available

Mac OpenSSL not found/loading failed

OpenSSL is a secure socket layer cipher library, including the main cryptographic algorithms, commonly used key and certificate encapsulation management functions and SSL protocol, and provides a wealth of applications for testing or other purposes.

Mac OSX install new OpenSSL

Currently, Mac OSX can install the specified version of OpenSSL through brew.

Confirm the version and location of the installed OpenSSL

$ which openssl

Determine version

$ openssl version

Brew install OpenSSL

$ brew install openssl

Brew update OpenSSL

$ brew upgrade openssl

Brew force link to OpenSSL

$ brew link openssl –force

The above is the introduction of updating OpenSSL under Mac to the latest version.

 
An error occurred when installing the software through homebrew or other ways

Error running ‘requirements_ osx_ brew_ libs_ install openssl’Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib (LoadError)

It may be caused by not installing or environment variable problems (you can judge by inputting OpenSSL command in the terminal and viewing feedback information)

1. You can solve this problem by re installing OpenSSL

Steps to re install OpenSSL:

Remove OpenSSL (other versions may exist in the removal method. It is recommended to uninstall all versions through uninstall)

brew remove openssl

Uninstall all versions of OpenSSL

brew uninstall –force openssl

Install OpenSSL

brew install openssl

Configure environment variables

echo ‘export PATH=”/usr/local/opt/openssl/bin:$PATH”‘ >& gt; ~/. bash_ profile

 

IOS app connect error store submitted for review

Recently, an error was reported when submitting the audit package: app store connect operation error.

You must be an Admin or Technical user in order to deliver content or metada.(1070)

Screenshot of error report:

 

Solution: use the transporter tool to upload, once OK. (I tried other methods in the middle, but I won’t talk about them one by one. I successfully uploaded this method, and the transporter tool can be found in the app store. Good luck to you.).

IOS error: linker command failed with exit code 1 solution

The error is as follows:

ld: library not found for -lXXX

clang: error: linker command failed with exit code 1 (use -v to see invocati

When we refer to static libraries, we do not configure library search paths, which results in an error

resolvent:

Build settings – library search paths view the path of the XXX file. If the path is wrong or there is no path, add the correct path again, and then compile Xcode.

Ambiguous reference to member ‘dataTask(with:completionHandler:)’

Ambiguous reference to member ‘dataTask(with:completionHandler:)’
let request = NSMutableURLRequest(url: URL(string: “Your API URL here” ,param: param))!,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval:”Your request timeout time in Seconds”)
request.httpMethod = “POST”
request.allHTTPHeaderFields = headers as? [String : String]
let dataTask = URLSession.shared.dataTask(with: request ) {data,response,error in
let httpResponse = response as? HTTPURLResponse

    if (error != nil) {
     print(error)
     } else {
     print(httpResponse)
     }

    DispatchQueue.main.async {
       //Update UI here
    }

}
dataTask.resume()

Solution: just make request as URLRequest
let dataTask = URLSession.shared.dataTask(with: request as URLRequest)

[solution] LD: warning: directory not found for option

In the process of IOS development, this problem is easy to be confused. Let’s have a break today.

Problems and Solutions

In short, there are two aspects to this problem.

The error is as follows, which means that it is an exception when querying Library .

"directory not found for option '-L/..."

resolvent:

Project – & gt; targets – & gt; build setting – & gt; library search paths

Delete the path inside

The error is as follows, which means that it is an exception when querying framework .

"directory not found for option '-F/..."

resolvent:

Project – & gt; targets – & gt; build setting – & gt; framework search paths

Delete the path inside

OK, it’s done.

The above problems have been solved. If you want to know more, you can continue to look down.

explain

Briefly speaking, library search paths and framework search paths .

Framework Search Paths

The explanation that can be found in official documents is as follows:

Locating Frameworks in Non-Standard Directories

If your project links to frameworks that are not included in any of the standard locations, you must explicitly specify the location of that framework before Xcode can locate its header files. To specify the location of such a framework, add the directory containing the framework to the “Framework Search Paths” option of your Xcode project. Xcode passes this list of directories to the compiler and linker, which both use the list to search for the framework resources.

Note: The standard locations for frameworks are the /System/Library/Frameworks directory and the /Library/Frameworks directory on the local system.

If the frameworks you refer to are not in standard locations, you need to set “framework search paths” in the configuration file of the project to specify search paths for compilers and linkers.

Library Search Paths

As for “library search paths”, there is no decent official document, but the content should be similar, but one is used to search framework , and the other is used to search Library .

Although it is said that, what is library and what is framework are still very vague.

However, we found some blogs to illustrate this problem, which are quoted below.

quote

Search paths settings in IOS development

In the development of IOS, we often encounter some path settings, such as the introduction of Baidu map SDK, copying projects to other computers, or reporting the error of library not found when multiple people develop at the same time, or introducing a third-party library, such as asihttprequest / retableview often reporting ? Include & lt; & gt; error, so we need to configure some search paths.

Framework/Library Search Paths

1、Framework Search Paths

The search path of the framework (. Framework bundles ) attached to the project is not widely used in IOS development. Generally, the framework built in the system is used for IOS development.

2、Library Search Paths

Xcode will automatically set the search path of the. A file to be dragged to the third-party library (. A files ) in the project. In order to facilitate transplantation or multi person collaborative development, it will usually be manually set.

For example, we will set the SDK of Baidu map as follows:

$(SRCROOT)/../libs/Release$(EFFECTIVE_ PLATFORM_ Name) , where $(srcroot) macro represents your project file directory, $(effective) _ PLATFORM_ Name) macro represents whether the current configuration is OS or simulator

Header Search Path

1. C / C + + header file reference

In C / C + +, include is a mutation instruction. When compiling, the compiler will replace the relative path with the absolute path. Therefore, the absolute path of the header file is equal to the search path + relative path.

(1) ? Include & lt; iostream. H & gt; : refers to the header file under the compiler’s class library path

(2) ? Include "hello. H" : the header file that refers to the relative path of the project directory

2、(User) Header Search Path

(1) header search path refers to the search path of the header file.

(2) User header search paths refers to the search path of user-defined header files

3、Always Search User Paths

If always search user paths is set to Yes , the compiler will first search the path configured by User header search paths . In this case, ? Include & lt; string. H & gt; , User header search paths the files under the search directory will cover the header files of the system.

reference material

    search paths settings in IOS development, IOS: clarify different search paths, IOS developer Library – including frameworks

[problem record] objc_ Too many arguments to function call

Objc_msgSend can be used with arguments before Xcode 6. Too many arguments to function call after Xcode 6. ;
The solution

Build Settings -> Enable Strict Checking of objc_msgSend Calls to NO.
br>
<>nt>

this method fails in Xcode 12.
2, Through type casting

((void (*)(id, SEL, id))objc_msgSend)(target, sel, value);

The number of parameters to be passed is self-defined