Xcode compile error & upload ipa exception

Xcode compilation error

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

You need to right-click Reveal in Log to view the specific error reason

2) dyld: Library not loaded: 

dyld[15027]: Library not loaded: @rpath/HappyDNS.framework/HappyDNS

Solution: TARGETS > General > Frameworks, Libraries, and Embedded Content, select HappyDNS, and set Do not Embed on the right to Embed & Sign

3)unexpected duplicate task: 

Solution: File > workspace settings > Legacy Build System​​​​

4)Building for iOS, but the linked and embedded framework 'HappyDNS.framework' was built for iOS + iOS Simulator. 

Solution 1: Regenerate the framework that supports iOS + iOS Simulator (not provided by a third party)

Solution 2: File > workspace settings > Legacy Build System​​​​

5) The class declaration of OC in PCH must be placed  in #ifdef __OBJC__  , otherwise it will be defaulted to the class declaration of C language and an error will be reported.

 

6)#import "<MKKit/MKKit.h>"  file not found

Solution: Add the corresponding class library and check the search paths

Abnormality in uploading ipa

1)contains unsupported architectures [x86_64,i386]

Solution: TARGETS > Build Phases > Click '+' > New Run Script Phase  > Then copy and paste the following code

APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"

# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"

EXTRACTED_ARCHS=()

for ARCH in $ARCHS
do
echo "Extracting $ARCH from $FRAMEWORK_EXECUTABLE_NAME"
lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
done

echo "Merging extracted architectures: ${ARCHS}"
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
rm "${EXTRACTED_ARCHS[@]}"

echo "Replacing original executable with thinned version"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"

done

Guess you like

Origin blog.csdn.net/z119901214/article/details/90240680