Previously encountered a variety of Xcode error! It’s all in! There will be more in the future! Equivalent to a mismemory!
CoreData (using “Class Definition”) Target “(project”) has compile command with input”
Error cause: The entity attribute Codegen (compiled, generated) value is not Manual/None, resulting in an error when the class is compiled. Solution: Select entity, change entity attribute Codegen (compiled, generated) value to Manual/None, clear current build, and compile again
Packing and shelving |
---|
WARNING ITMS-90076: "Potential Loss of Keychain Access. The previous version of software
has an application-identifier value of ['G3WRS4SYLU.com.MMP.LiLiVaVa'] and the new
version of software being submitted has an application-identifier of ['3FKGU7B68C.com.MMP.LiLiVaVa'].
This will result in a loss of keychain access."
Copy the code
⚠️ Reason for warning: The packaged application was recently transferred from another account to another account. This is only a warning and does not affect uploads and server compilation.
error |
---|
[A]. Localized string files cannot be used.
- 【 1 】 clean build folder, delete all DerivedData inside folders (located in the “/ Users/personal PC user name/Library/Developer/Xcode/DerivedData”) under the path of the cache files (accounted for a large memory space), delete the program inside, Restart Xcode and rebuild the project.
- [2.] Go to the project directory and manually create two “Infoplist. Strings” files, first in the “en.lproj” folder and second in the “fr.lproj” folder.
[ B ]. Apple Mach-O Linker Error
Linker command failed with exit code 1 (use -v to see invocation)
Example 🌰 :Cause: Multiple files or directories are repeatedly referenced
When importing, an error of”.m“File:
[C]
The installation failed Invalid argument dialog box is displayed when the application program is successfully compiled.
Cause: The Bundle indentifier in the “infor.plist” file was empty!!
Solution: Fill in the Bundle Indentifier!
An error |
---|
[A]. Unimported file (.m file)
The general isnoThere areThe introduction ofThe correspondingThe library files(or”.m“file). When introducing tripartite libraries, the”.a“fileorframework“, which is the implementation of the “. H “file provided by the third party library, only add it to find the”. H “file insidemethodstheimplementation. Solution: Check whether the project has beenThe correspondingthefileI added it in. (PROJECT -> TARGETS -> Build Settings -> Compile Sources– >”+“, add the “weiboapi. m” file) if it has already been added,build phases“Underneath.”compile sourcesIn the”addEnter the corresponding”.m“file“Or”link binary with librariesIn the”addInto the correspondingThe library files.
[B]. An object is released multiple times:Thread 1: signal SIGABRT
Often an object is released multiple times (multiple releases). Mostly due to carelessness.
There is a condition called transitional release, which is more subtle.
NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults]; self.myData = [userDefault objectForKey:@"myCollectData"]; Copy the code
This is wrong! We do not allocate memory to myData ourselves. So the compiler has control over this memory, not us!
So, at some point, we can’t guarantee that myData is valid. There is no guarantee that the program ends with “[_myData release];” Operation!
According to the principle of “he who distributes, he who governs”! I rewrote it as follows:
NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults]; NSData * my_data = [userDefault objectForKey:@"myCollectData"]; self.myData = [NSData alloc] initWithData:my_data]; Copy the code
Make sure you initialize it! That’s right!
[C].manager start failed :
“Bundle display name” must be added in “info.plist”
When using baidu Map development platform, you need to directly use “Source Code”, open “info.plist” and add:
<key>CFBundleDisplayName</key>
<string>BaiduDemo</string>
Copy the code
It’s ok!! (Of course DisplayName is mutable)
[D]. Permission Description
IOS10 click on permission access, direct Crash. And output the following information on the console:
This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSContactsUsageDescription key with a string value explaining to the user how the app uses this data. Copy the code
Meaning: you need to “info. The plist file, add a” NSContactsUsageDescription “Key, and add a description to its Value.
Steps:
1. Find the “info.plist” file in the project, right click “Open As”, and Open it As “Source Code”; 2, duplicate the following values: Value (); Key ();
// Camera permission description:Copy the code
NSCameraUsageDescription cameraDesciption / / contacts: NSContactsUsageDescription contactsDesciption / / microphone: NSMicrophoneUsageDescription microphoneDesciption / / camera: NSPhotoLibraryUsageDescription photoLibraryDesciption
3. Copy it in the info.plist file and save it. And Clean works.
[E].png image format error
When packing, this warning appears! PNG file invalid; PNG file invalid;
Re-import the PNG image and it will be ok. But know “which picture” is wrong.
[F]. End of procedure:Message from debugger: Terminated due to signal 9
Reason: The degree of active closure during debugging. For example: slide up, click the button and so on to end the program.
[G]. AFNetworking request and receive format problem
The returned data is not in the standard JSON format, and the following error is reported:
Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with array or object and option to allow fragments not set.} Copy the code
Reason: By default, AFNetworking network requests return data in JSON data format. Therefore, json is also the default format on the client side.
Solution: before sending a request, add the following code: manager. ResponseSerializer = [AFHTTPResponseSerializer serializer].
[H]. Type Conflict:[__NSCFNumber length]: unrecognized selector sent to instance 0x8b3c310 '
Cause: The NSNumber type conflicts with the NSString type. Solution: Change the required NSString type of the corresponding attribute to NSNumber (set the attribute type to NSNumber), and then convert the NSNumber type to NSString at call time.
[I].two.m files:linker command failed with exit code 1 (use -vto see invocation)
Cause: A. M header file was imported, causing two identical. M files to be compiled.
[J]. Xcode real machine test errorCould not launch...
- Solution 1:
1. Delete “/ Users/(user name)/Library/Developer/Xcode/DerivedData/(APP) folder” in the content; 2. Unplug the phone, delete the corresponding APP, and exit the Xcode tool completely. 3. Reconnect the phone for a real test.
- Solution 2:
The real machine packet capture test was performed and the HTTP proxy was disabled.
- Solution 3:
1. Select “Settings” → “General” → “Device Management” → Select your own developer app → “Delete App”; 2. Re-run the program in Xcode. 3. Enter your developer’s app again → “Verify app”; 4. Run the program in Xcode again. Reference: “Personal Account real machine Test”
[K]. Data modification:Warning! ivar size mismatch in StepUICollectionView_ of 80 bytes - can't change the superclass.
Solution: 1. Search StepUICollectionView and find the. M file. 2. Search char filler, and change the data to the warning data in [].
[L]
Cause: The Xib connection is faulty
[M]. A method is not implemented
Cause: An object does not implement a method
[N]. Network proxy: nw_proxy_resolver_create_parsed_array
2017-03-15 09:03:51.941774 cuteKids[1155:34545] PAC Fetch failed with error [NSURLErrorDomain:-1004] 2017-03-15 09:03:51.941774 cuteKids[1155:34545] PAC Fetch failed with error [NSURLErrorDomain:-1004] 2017-03-15 09:03:51.942688 cuteKids[1155:34545] [] nw_proxy_resolver_create_parsed_array PAC evaluation error: NSURLErrorDomain: - 1004.Copy the code
Cause: The MAC system network agent is faulty. Solution: System preference Settings → Network → Advanced → Agent, and then turn off “automatic agent”.
warning |
---|
[A].Data argument not used by format string
Reason:”
[ stringWithFormat: ]
“There is no idX format caused by. Solution: Modify the corresponding format inside
[B]. [c]
Failed to set () user defined inspected property on (UILabel): [<UILabel 0x7febfcf4e7b0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key .
Reason: After adding some attributes, they are removed from the code, but are still retained in the UIStoryboard.
Solution: Therefore need to change (delete) corresponding properties.
[C]. Keyboard covers textView
Error:
2017-08-11 16:33:33.293831 cuteKids[10465:317797] 0x60800014D7E0 Copy Matching Assets Reply: 2017-08-11 16:33:33.293831 cuteKids[10465:317797] 0x60800014D7E0 Copy Matching Assets Reply: XPC_TYPE_DICTIONARY <dictionary: 0x60800014d7e0> { count = 1, transaction: 0, voucher = 0x0, contents = "Result" => <int64: 0x60800003e260>: 29} 2017-08-11 16:33:33.294494 cuteKids[10465:317797] 0x60800014c8c0 Daemon Configuration Query Reply: XPC_TYPE_DICTIONARY <dictionary: 0x60800014c8c0> { count = 2, transaction: 0, voucher = 0x0, contents = "Dictionary" => <dictionary: 0x60800014c130> { count = 1, transaction: 0, voucher = 0x0, contents = "ServerURL" => <dictionary: 0x60800014daa0> { count = 3, transaction: 0, voucher = 0x0, contents = "com.apple.CFURL.magic" => <uuid: 0x608000249f30> C3853DCC-9776-4114-B6C1-FD9F51944A6D "com.apple.CFURL.string" => <string: 0x60800024bee0> { length = 30, contents = "https://mesu.apple.com/assets/" } "com.apple.CFURL.base" => <null: 0x10ac19f20>: null-object } } "Result" => <int64: 0x608000037fe0>: 0} 2017-08-11 16:33:33.294780 cuteKids[10465:317797] [MobileAssetError:29] Unable to copy Asset Information from https://mesu.apple.com/assets/ for asset type com.apple.MobileAsset.TextInput.SpellCheckerCopy the code
Reason: Since the keyboard hides the TextView, you need to implement keyboard pop-ups to change the position of the ScrollView.
Solution:
_mytextView.autocorrectionType = UITextAutocorrectionTypeNo; . / / ⭐ ️ must add ⭐ ️ _mytextView spellCheckingType = UITextSpellCheckingTypeNo;Copy the code
[D]. No protocol added: UITextFieldDelegate
Warning:Core Marketing concept: 'ID <UITextFieldDelegate> _Nullable' from the incompatible Type' A ViewController *const __strong'
Cause: The message assigned to “UITextFieldDelegate” is of the wrong type!
Solution: Add **
** protocol
[ E ].CFNetwork internal error
Warning: (Console warning message) 440: CFNetwork internal error (0 xc01a: / BuildRoot/Library/Caches/com. Apple. XBS/Sources/CFNetwork/CFNetwork 758.4.3 / Loading/URLConnectionLoader CPP: 289).
Solution: Modify ‘NSExceptionDomains’ in the’ info.plist ‘file!
NSExceptionAllowInsecureHTTPLoads : YES
NSExceptionRequiresForwardSecrecy : NO NSIncludesSubdomains : YES
“Source Code” format:
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> < key > NSExceptionAllowInsecureHTTPLoads < / key > < true / >, < the key > NSExceptionDomains < / key > < dict > < key > 192.168.3.106 < / key > <! - domain address - > < dict > < key > NSExceptionRequiresForwardSecrecy < / key > < false / >, < the key > NSIncludesSubdomains < / key > < true / > < / dict > </dict> </dict>Copy the code
More articles (Reference \ Summary)
IOS warning collection and scientific fast elimination method
Warning fixes for iOS projects
(2016.12.10)
goyohol’s essay