SolvedTelegram iOS Build failed version 6.3
43 Answers
Share
Original✔️Accepted Answer
Run 7.0.1 successfully in the simulator. (6.3 to 7.0.1 should be fine)
Steps:
- Check out the
Telegram-iOS release-7.0.1
code. - Modify
Makefile
andConfig/utils.bzl
. Reference #219 (comment) - Modify
submodules/Display/Source/PointerInteraction.swift
. Comment out the code related toUIPointerInteraction
.
@@ -12,79 +12,79 @@ public enum PointerStyle {
@available(iOSApplicationExtension 13.4, iOS 13.4, *)
private final class PointerInteractionImpl: NSObject, UIPointerInteractionDelegate {
- weak var pointerInteraction: UIPointerInteraction?
-
- private let style: PointerStyle
-
- private let willEnter: () -> Void
- private let willExit: () -> Void
-
- init(style: PointerStyle, willEnter: @escaping () -> Void, willExit: @escaping () -> Void) {
- self.style = style
- self.willEnter = willEnter
- self.willExit = willExit
-
- super.init()
- }
-
- deinit {
- if let pointerInteraction = self.pointerInteraction {
- pointerInteraction.view?.removeInteraction(pointerInteraction)
- }
- }
-
+// weak var pointerInteraction: UIPointerInteraction?
+//
+// private let style: PointerStyle
+//
+// private let willEnter: () -> Void
+// private let willExit: () -> Void
+//
+// init(style: PointerStyle, willEnter: @escaping () -> Void, willExit: @escaping () -> Void) {
+// self.style = style
+// self.willEnter = willEnter
+// self.willExit = willExit
+//
+// super.init()
+// }
+//
+// deinit {
+// if let pointerInteraction = self.pointerInteraction {
+// pointerInteraction.view?.removeInteraction(pointerInteraction)
+// }
+// }
+//
func setup(view: UIView) {
- let pointerInteraction = UIPointerInteraction(delegate: self)
- view.addInteraction(pointerInteraction)
- self.pointerInteraction = pointerInteraction
- }
-
- func pointerInteraction(_ interaction: UIPointerInteraction, styleFor region: UIPointerRegion) -> UIPointerStyle? {
- var pointerStyle: UIPointerStyle? = nil
- if let interactionView = interaction.view {
- let targetedPreview = UITargetedPreview(view: interactionView)
- switch self.style {
- case .default:
- let horizontalPadding: CGFloat = 10.0
- let verticalPadding: CGFloat = 4.0
- let minHeight: CGFloat = 40.0
- let size: CGSize = CGSize(width: targetedPreview.size.width + horizontalPadding * 2.0, height: max(minHeight, targetedPreview.size.height + verticalPadding * 2.0))
- pointerStyle = UIPointerStyle(effect: .highlight(targetedPreview), shape: .roundedRect(CGRect(origin: CGPoint(x: targetedPreview.view.center.x - size.width / 2.0, y: targetedPreview.view.center.y - size.height / 2.0), size: size), radius: UIPointerShape.defaultCornerRadius))
- case let .rectangle(size):
- pointerStyle = UIPointerStyle(effect: .highlight(targetedPreview), shape: .roundedRect(CGRect(origin: CGPoint(x: targetedPreview.view.center.x - size.width / 2.0, y: targetedPreview.view.center.y - size.height / 2.0), size: size), radius: UIPointerShape.defaultCornerRadius))
- case .circle:
- let maxSide = max(targetedPreview.size.width, targetedPreview.size.height)
- pointerStyle = UIPointerStyle(effect: .highlight(targetedPreview), shape: .path(UIBezierPath(ovalIn: CGRect(origin: CGPoint(), size: CGSize(width: maxSide, height: maxSide)))))
- case .caret:
- pointerStyle = UIPointerStyle(shape: .verticalBeam(length: 24.0), constrainedAxes: .vertical)
- case .lift:
- pointerStyle = UIPointerStyle(effect: .lift(targetedPreview))
- case .hover:
- pointerStyle = UIPointerStyle(effect: .hover(targetedPreview, preferredTintMode: .none, prefersShadow: false, prefersScaledContent: false))
- }
- }
- return pointerStyle
- }
-
- func pointerInteraction(_ interaction: UIPointerInteraction, willEnter region: UIPointerRegion, animator: UIPointerInteractionAnimating) {
- guard let _ = interaction.view else {
- return
- }
-
- animator.addAnimations {
- self.willEnter()
- }
- }
-
- func pointerInteraction(_ interaction: UIPointerInteraction, willExit region: UIPointerRegion, animator: UIPointerInteractionAnimating) {
- guard let _ = interaction.view else {
- return
- }
-
- animator.addAnimations {
- self.willExit()
- }
+// let pointerInteraction = UIPointerInteraction(delegate: self)
+// view.addInteraction(pointerInteraction)
+// self.pointerInteraction = pointerInteraction
}
+//
+// func pointerInteraction(_ interaction: UIPointerInteraction, styleFor region: UIPointerRegion) -> UIPointerStyle? {
+// var pointerStyle: UIPointerStyle? = nil
+// if let interactionView = interaction.view {
+// let targetedPreview = UITargetedPreview(view: interactionView)
+// switch self.style {
+// case .default:
+// let horizontalPadding: CGFloat = 10.0
+// let verticalPadding: CGFloat = 4.0
+// let minHeight: CGFloat = 40.0
+// let size: CGSize = CGSize(width: targetedPreview.size.width + horizontalPadding * 2.0, height: max(minHeight, targetedPreview.size.height + verticalPadding * 2.0))
+// pointerStyle = UIPointerStyle(effect: .highlight(targetedPreview), shape: .roundedRect(CGRect(origin: CGPoint(x: targetedPreview.view.center.x - size.width / 2.0, y: targetedPreview.view.center.y - size.height / 2.0), size: size), radius: UIPointerShape.defaultCornerRadius))
+// case let .rectangle(size):
+// pointerStyle = UIPointerStyle(effect: .highlight(targetedPreview), shape: .roundedRect(CGRect(origin: CGPoint(x: targetedPreview.view.center.x - size.width / 2.0, y: targetedPreview.view.center.y - size.height / 2.0), size: size), radius: UIPointerShape.defaultCornerRadius))
+// case .circle:
+// let maxSide = max(targetedPreview.size.width, targetedPreview.size.height)
+// pointerStyle = UIPointerStyle(effect: .highlight(targetedPreview), shape: .path(UIBezierPath(ovalIn: CGRect(origin: CGPoint(), size: CGSize(width: maxSide, height: maxSide)))))
+// case .caret:
+// pointerStyle = UIPointerStyle(shape: .verticalBeam(length: 24.0), constrainedAxes: .vertical)
+// case .lift:
+// pointerStyle = UIPointerStyle(effect: .lift(targetedPreview))
+// case .hover:
+// pointerStyle = UIPointerStyle(effect: .hover(targetedPreview, preferredTintMode: .none, prefersShadow: false, prefersScaledContent: false))
+// }
+// }
+// return pointerStyle
+// }
+//
+// func pointerInteraction(_ interaction: UIPointerInteraction, willEnter region: UIPointerRegion, animator: UIPointerInteractionAnimating) {
+// guard let _ = interaction.view else {
+// return
+// }
+//
+// animator.addAnimations {
+// self.willEnter()
+// }
+// }
+//
+// func pointerInteraction(_ interaction: UIPointerInteraction, willExit region: UIPointerRegion, animator: UIPointerInteractionAnimating) {
+// guard let _ = interaction.view else {
+// return
+// }
+//
+// animator.addAnimations {
+// self.willExit()
+// }
+// }
}
public final class PointerInteraction {
@ -96,10 +96,10 @@ public final class PointerInteraction {
@available(iOSApplicationExtension 13.4, iOS 13.4, *)
private func withImpl(_ f: (PointerInteractionImpl) -> Void) {
- if self.impl == nil {
- self.impl = PointerInteractionImpl(style: self.style, willEnter: self.willEnter, willExit: self.willExit)
- }
- f(self.impl as! PointerInteractionImpl)
+// if self.impl == nil {
+// self.impl = PointerInteractionImpl(style: self.style, willEnter: self.willEnter, willExit: self.willExit)
+// }
+// f(self.impl as! PointerInteractionImpl)
}
public convenience init(node: ASDisplayNode, style: PointerStyle = .default, willEnter: @escaping () -> Void = {}, willExit: @escaping () -> Void = {}) {
- Modify
third-party/mozjpeg/BUCK
andthird-party/webrtc/BUCK
. Make the static library include x64.
# third-party/mozjpeg/BUCK
PATH="$PATH:$CMAKE_DIR/bin" sh $BUILD_DIR/build-mozjpeg-buck.sh $BUILD_ARCH "$BUILD_DIR/mozjpeg" "$BUILD_DIR"
- lipo -create $OUT/arm64/build/libjpeg.a $OUT/armv7/build/libjpeg.a -output $OUT/Public/lib/libjpeg.a
- lipo -create $OUT/arm64/build/libturbojpeg.a $OUT/armv7/build/libturbojpeg.a -output $OUT/Public/lib/libturbojpeg.a
+ BUILD_ARCH="x86_64"
+ BUILD_DIR="$OUT/$BUILD_ARCH"
+ rm -rf "$BUILD_DIR"
+ mkdir -p "$BUILD_DIR"
+ cp "$SRCDIR/build-mozjpeg-buck.sh" "$BUILD_DIR/"
+ cp -R "$SRCDIR/mozjpeg" "$BUILD_DIR/"
+ mkdir -p "$BUILD_DIR/Public/mozjpeg"
+ PATH="$PATH:$CMAKE_DIR/bin" sh $BUILD_DIR/build-mozjpeg-buck.sh $BUILD_ARCH "$BUILD_DIR/mozjpeg" "$BUILD_DIR"
+
+ lipo -create $OUT/arm64/build/libjpeg.a $OUT/armv7/build/libjpeg.a $OUT/x86_64/build/libjpeg.a -output $OUT/Public/lib/libjpeg.a
+ lipo -create $OUT/arm64/build/libturbojpeg.a $OUT/armv7/build/libturbojpeg.a $OUT/x86_64/build/libturbojpeg.a -output $OUT/Public/lib/libturbojpeg.a
""",
out = "libmozjpeg",
visibility = [
# third-party/webrtc/BUCK
sh $SRCDIR/build-webrtc-buck.sh "$BUILD_DIR" $BUILD_ARCH
+ BUILD_ARCH=x64
+ BUILD_DIR_X64="$SRCDIR/$BUILD_ARCH"
+ BUILD_DIR="$BUILD_DIR_X64"
+ rm -rf "$BUILD_DIR"
+ mkdir -p "$BUILD_DIR"
+ mkdir -p "$BUILD_DIR/webrtc-ios"
+ cp -R "$SRCDIR/webrtc-ios/src" "$BUILD_DIR/webrtc-ios/src"
+ DEPOT_TOOLS_PATH="$(location //third-party:depot_tools_sources)"
+ rm -rf "$BUILD_DIR/depot_tools"
+ cp -R "$DEPOT_TOOLS_PATH" "$BUILD_DIR/"
+ rm -rf "$BUILD_DIR/openssl"
+ cp -R "$(location //submodules/openssl:openssl_build_merged)" "$BUILD_DIR/openssl/"
+ cp -R "$(location //submodules/openssl:openssl_libssl_merged)" "$BUILD_DIR/libssl/"
+ sh $SRCDIR/build-webrtc-buck.sh "$BUILD_DIR" $BUILD_ARCH
mkdir -p "$OUT"
- lipo -create "$BUILD_DIR_ARMV7/webrtc-ios/src/out/ios/obj/sdk/libframework_objc_static.a" "$BUILD_DIR_ARM64/webrtc-ios/src/out/ios_64/obj/sdk/libframework_objc_static.a" -output "$OUT/libframework_objc_static.a"
+ lipo -create "$BUILD_DIR_ARMV7/webrtc-ios/src/out/ios/obj/sdk/libframework_objc_static.a" "$BUILD_DIR_ARM64/webrtc-ios/src/out/ios_64/obj/sdk/libframework_objc_static.a" "$BUILD_DIR_X64/webrtc-ios/src/out/ios_sim/obj/sdk/libframework_objc_static.a" -output "$OUT/libframework_objc_static.a"
""",
out = "libwebrtc",
visibility = ["PUBLIC"]
- Execute the command
make project
to generate theTelegram_Buck.xcworkspace
file.
Related Issues:
12
Telegram iOS Build failed version 6.3
Run 7.0.1 successfully in the simulator (6.3 to 7.0.1 should be fine) Steps: Check out the Telegram-...
Hello
Has anyone encountered a same problem?
Checklist
Screenshots and Videos
Description
Undefined symbols for architecture x86_64:
"static UIKit.UIPointerShape.defaultCornerRadius.getter : CoreGraphics.CGFloat", referenced from:
Display.(PointerInteractionImpl in B39DD7E7F85F24DF4F7212BCFE28692F).pointerInteraction(: __C.UIPointerInteraction, styleFor: __C.UIPointerRegion) -> __C.UIPointerStyle? in PointerInteraction.o
"enum case for UIKit.UIPointerShape.roundedRect(UIKit.UIPointerShape.Type) -> (__C.CGRect, CoreGraphics.CGFloat) -> UIKit.UIPointerShape", referenced from:
Display.(PointerInteractionImpl in B39DD7E7F85F24DF4F7212BCFE28692F).pointerInteraction(: __C.UIPointerInteraction, styleFor: __C.UIPointerRegion) -> __C.UIPointerStyle? in PointerInteraction.o
"enum case for UIKit.UIPointerEffect.highlight(UIKit.UIPointerEffect.Type) -> (__C.UITargetedPreview) -> UIKit.UIPointerEffect", referenced from:
Display.(PointerInteractionImpl in B39DD7E7F85F24DF4F7212BCFE28692F).pointerInteraction(: __C.UIPointerInteraction, styleFor: __C.UIPointerRegion) -> __C.UIPointerStyle? in PointerInteraction.o
"(extension in UIKit):__C.UIPointerStyle.init(shape: UIKit.UIPointerShape, constrainedAxes: __C.UIAxis) -> __C.UIPointerStyle", referenced from:
Display.(PointerInteractionImpl in B39DD7E7F85F24DF4F7212BCFE28692F).pointerInteraction(: __C.UIPointerInteraction, styleFor: __C.UIPointerRegion) -> __C.UIPointerStyle? in PointerInteraction.o
"enum case for UIKit.UIPointerShape.path(UIKit.UIPointerShape.Type) -> (__C.UIBezierPath) -> UIKit.UIPointerShape", referenced from:
Display.(PointerInteractionImpl in B39DD7E7F85F24DF4F7212BCFE28692F).pointerInteraction(: __C.UIPointerInteraction, styleFor: __C.UIPointerRegion) -> __C.UIPointerStyle? in PointerInteraction.o
"enum case for UIKit.UIPointerEffect.lift(UIKit.UIPointerEffect.Type) -> (__C.UITargetedPreview) -> UIKit.UIPointerEffect", referenced from:
Display.(PointerInteractionImpl in B39DD7E7F85F24DF4F7212BCFE28692F).pointerInteraction(: __C.UIPointerInteraction, styleFor: __C.UIPointerRegion) -> __C.UIPointerStyle? in PointerInteraction.o
"type metadata accessor for UIKit.UIPointerEffect", referenced from:
Display.(PointerInteractionImpl in B39DD7E7F85F24DF4F7212BCFE28692F).pointerInteraction(: __C.UIPointerInteraction, styleFor: __C.UIPointerRegion) -> __C.UIPointerStyle? in PointerInteraction.o
"type metadata accessor for UIKit.UIPointerEffect.TintMode", referenced from:
Display.(PointerInteractionImpl in B39DD7E7F85F24DF4F7212BCFE28692F).pointerInteraction(: __C.UIPointerInteraction, styleFor: __C.UIPointerRegion) -> __C.UIPointerStyle? in PointerInteraction.o
"type metadata accessor for UIKit.UIPointerShape", referenced from:
Display.(PointerInteractionImpl in B39DD7E7F85F24DF4F7212BCFE28692F).pointerInteraction(: __C.UIPointerInteraction, styleFor: __C.UIPointerRegion) -> __C.UIPointerStyle? in PointerInteraction.o
default argument 1 of (extension in UIKit):__C.UIPointerStyle.init(effect: UIKit.UIPointerEffect, shape: UIKit.UIPointerShape?) -> __C.UIPointerStyle in PointerInteraction.o
"enum case for UIKit.UIPointerEffect.hover(UIKit.UIPointerEffect.Type) -> (__C.UITargetedPreview, UIKit.UIPointerEffect.TintMode, Swift.Bool, Swift.Bool) -> UIKit.UIPointerEffect", referenced from:
Display.(PointerInteractionImpl in B39DD7E7F85F24DF4F7212BCFE28692F).pointerInteraction(: __C.UIPointerInteraction, styleFor: __C.UIPointerRegion) -> __C.UIPointerStyle? in PointerInteraction.o
"enum case for UIKit.UIPointerEffect.TintMode.none(UIKit.UIPointerEffect.TintMode.Type) -> UIKit.UIPointerEffect.TintMode", referenced from:
Display.(PointerInteractionImpl in B39DD7E7F85F24DF4F7212BCFE28692F).pointerInteraction(: __C.UIPointerInteraction, styleFor: __C.UIPointerRegion) -> __C.UIPointerStyle? in PointerInteraction.o
"enum case for UIKit.UIPointerShape.verticalBeam(UIKit.UIPointerShape.Type) -> (CoreGraphics.CGFloat) -> UIKit.UIPointerShape", referenced from:
Display.(PointerInteractionImpl in B39DD7E7F85F24DF4F7212BCFE28692F).pointerInteraction(: __C.UIPointerInteraction, styleFor: __C.UIPointerRegion) -> __C.UIPointerStyle? in PointerInteraction.o
"(extension in UIKit):__C.UIPointerStyle.init(effect: UIKit.UIPointerEffect, shape: UIKit.UIPointerShape?) -> __C.UIPointerStyle", referenced from:
Display.(PointerInteractionImpl in B39DD7E7F85F24DF4F7212BCFE28692F).pointerInteraction(: __C.UIPointerInteraction, styleFor: __C.UIPointerRegion) -> __C.UIPointerStyle? in PointerInteraction.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Steps to Reproduce
Environment
macOS: 10.15.5
xcode: 11.6