2016-09-14 16 views
9

Ứng dụng của tôi chạy tốt trên thiết bị & trình mô phỏng, nhưng khi tôi gửi nó, tôi nhận được gói không hợp lệ - Một hoặc nhiều thư viện động được tham chiếu bởi ứng dụng của bạn không có trong đường dẫn tìm kiếm dylib lỗi được gửi qua email cho tôi khoảng nửa giờ sau khi quá trình tải lên hoàn tất thành công.Lỗi gói không hợp lệ từ iTC, không thể gửi ứng dụng - vì 4 dylibs nhanh không thể nhúng

Tiếp theo những lời khuyên trên thead này here, cụ thể là chạy otool -L, tôi có thể thấy rằng thực thi chính của ứng dụng có tất cả các @rpath/...dylib file của nó trong thư mục Frameworks/ như mong đợi, nhưng, thực thi của appex đang thiếu một số libs Swift.

Dưới đây là kết quả từ otool -L trên appex:

Watch Extension: 
    /System/Library/Frameworks/WatchKit.framework/WatchKit (compatibility version 1.0.0, current version 1.0.0) 
    /System/Library/Frameworks/Foundation.framework/Foundation (compatibility version 300.0.0, current version 1349.0.0) 
    /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0) 
    /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.0.0) 
    /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation (compatibility version 150.0.0, current version 1348.0.0) 
    /System/Library/Frameworks/UIKit.framework/UIKit (compatibility version 1.0.0, current version 3599.4.0) 
    /System/Library/Frameworks/WatchConnectivity.framework/WatchConnectivity (compatibility version 1.0.0, current version 116.0.0) 
    @rpath/libswiftCore.dylib (compatibility version 1.0.0, current version 800.0.46) 
    @rpath/libswiftCoreGraphics.dylib (compatibility version 1.0.0, current version 800.0.46) 
    @rpath/libswiftCoreLocation.dylib (compatibility version 1.0.0, current version 800.0.46) 
    @rpath/libswiftDarwin.dylib (compatibility version 1.0.0, current version 800.0.46) 
    @rpath/libswiftDispatch.dylib (compatibility version 1.0.0, current version 800.0.46) 
    @rpath/libswiftFoundation.dylib (compatibility version 1.0.0, current version 800.0.46) 
    @rpath/libswiftHomeKit.dylib (compatibility version 1.0.0, current version 800.0.46) 
    @rpath/libswiftObjectiveC.dylib (compatibility version 1.0.0, current version 800.0.46) 
    @rpath/libswiftSceneKit.dylib (compatibility version 1.0.0, current version 800.0.46) 
    @rpath/libswiftUIKit.dylib (compatibility version 1.0.0, current version 800.0.46) 
    @rpath/libswiftWatchKit.dylib (compatibility version 1.0.0, current version 800.0.46) 
    @rpath/libswiftsimd.dylib (compatibility version 1.0.0, current version 800.0.46) 

Sau đây là KHÔNG trong thư mục Frameworks/ (nhưng tất cả những người khác):

@rpath/libswiftHomeKit.dylib (compatibility version 1.0.0, current version 800.0.46) 
    @rpath/libswiftSceneKit.dylib (compatibility version 1.0.0, current version 800.0.46) 
    @rpath/libswiftWatchKit.dylib (compatibility version 1.0.0, current version 800.0.46) 
    @rpath/libswiftsimd.dylib (compatibility version 1.0.0, current version 800.0.46) 

Tại sao điều này? Tôi đã tạo lại dự án nhóm của mình qua pod install, không thay đổi bất cứ điều gì. Tôi không thấy bất kỳ cảnh báo nào. Tôi đã kiểm tra kết xuất nhật ký của bản dựng (lưu trữ), không có cảnh báo nào. Làm thế nào tôi có thể nhận được những bao gồm như họ nên?

Trong mục tiêu ứng dụng chính của tôi, Luôn nhúng Thư viện chuẩn Swift được đặt thành có. Trong mục tiêu Appex Watch và Watch, điều này được đặt thành không để tránh bị từ chối vì có bản sao (tốt). Tôi đã cố gắng thiết lập EMBEDDED_CONTENT_CONTAINS_SWIFT để có trong appex của tôi như mô tả trong chủ đề khác, nhưng điều đó đã không thực hiện bất kỳ sự khác biệt.

Cập nhật 1 - Tôi cũng không thể xuất dưới dạng bản dựng ADHOC từ trình tổ chức xcode, nó không thành công vì lý do tương tự trên bước "bit biên dịch". con đường tìm kiếm thời gian chạy được quy định như thế này:

Runtime search paths in build settings

Dưới đây là một đoạn ghi từ việc xuất khẩu thất bại, bất kỳ ý tưởng làm thế nào để khắc phục những? Tôi thấy không có lý do tại sao các libs bị thiếu.

Debug: Command took 0 seconds 
    Debug: Found framework/dylib: /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS3.0.sdk/System/Library/Frameworks/WatchKit.framework/WatchKit.tbd 
    Debug: Found framework/dylib: /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS3.0.sdk/System/Library/Frameworks/Foundation.framework/Foundation.tbd 
    Debug: Found framework/dylib: /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS3.0.sdk/usr/lib/libobjc.A.tbd 
    Debug: Found framework/dylib: /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS3.0.sdk/usr/lib/libSystem.B.tbd 
    Debug: Found framework/dylib: /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS3.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation.tbd 
    Debug: Found framework/dylib: /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS3.0.sdk/System/Library/Frameworks/UIKit.framework/UIKit.tbd 
    Debug: Found framework/dylib: /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS3.0.sdk/System/Library/Frameworks/WatchConnectivity.framework/WatchConnectivity.tbd 
    Debug: Found framework/dylib: /Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS3.0.sdk/usr/lib/libobjc.A.tbd 
    Debug: Search Path: ['/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/8.0.0/lib/darwin', '/Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS3.0.sdk/usr/lib', '/Applications/Xcode.app/Contents/Developer/Platforms/WatchOS.platform/Developer/SDKs/WatchOS3.0.sdk/System/Library/Frameworks'] 
    error: libswiftCore.dylib not found in dylib search path 


Stderr: 
    from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1974:in `block in CompileOrStripBitcodeInBundle' 
    from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1931:in `each' 
    from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1931:in `CompileOrStripBitcodeInBundle' 
    from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1921:in `block in CompileOrStripBitcodeInBundle' 
    from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1920:in `each' 
    from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1920:in `CompileOrStripBitcodeInBundle' 
    from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2106:in `ProcessIPA' 
    from /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2674:in `<main>' 
2016-09-14 15:33:40 +0000 /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool exited with 1 
2016-09-14 15:33:40 +0000 ipatool JSON: { 
    alerts =  (
      { 
     code = 2554; 
     description = "Configuration issue: platform AppleTVSimulator.platform doesn't have any non-simulator SDKs; ignoring it"; 
     info =    { 
     }; 
     level = WARN; 
    }, 
      { 
     code = 2554; 
     description = "Configuration issue: platform iPhoneSimulator.platform doesn't have any non-simulator SDKs; ignoring it"; 
     info =    { 
     }; 
     level = WARN; 
    }, 
      { 
     code = 2554; 
     description = "Configuration issue: platform WatchSimulator.platform doesn't have any non-simulator SDKs; ignoring it"; 
     info =    { 
     }; 
     level = WARN; 
    }, 
      { 
     code = 284; 
     description = "Failed to resolve linkage dependency Watch Extension armv7k -> @rpath/libswiftCore.dylib: Could not find image to link for armv7k in /private/var/folders/yl/mw_r1p4j3vj2mfp32rqs0y7r0000gn/T/XcodeDistPipeline.6Tu/Root/Payload/Photobooth.app/Frameworks/libswiftCore.dylib"; 
     info =    { 
     }; 
     level = WARN; 
    }, 
      { 
     code = 284; 
     description = "Failed to resolve linkage dependency Watch Extension armv7k -> @rpath/libswiftCoreGraphics.dylib: Could not find image to link for armv7k in /private/var/folders/yl/mw_r1p4j3vj2mfp32rqs0y7r0000gn/T/XcodeDistPipeline.6Tu/Root/Payload/Photobooth.app/Frameworks/libswiftCoreGraphics.dylib"; 
     info =    { 
     }; 
     level = WARN; 
    }, 
      { 
     code = 284; 
     description = "Failed to resolve linkage dependency Watch Extension armv7k -> @rpath/libswiftCoreLocation.dylib: Could not find image to link for armv7k in /private/var/folders/yl/mw_r1p4j3vj2mfp32rqs0y7r0000gn/T/XcodeDistPipeline.6Tu/Root/Payload/Photobooth.app/Frameworks/libswiftCoreLocation.dylib"; 
     info =    { 
     }; 
     level = WARN; 
    }, 
      { 
     code = 284; 
     description = "Failed to resolve linkage dependency Watch Extension armv7k -> @rpath/libswiftDarwin.dylib: Could not find image to link for armv7k in /private/var/folders/yl/mw_r1p4j3vj2mfp32rqs0y7r0000gn/T/XcodeDistPipeline.6Tu/Root/Payload/Photobooth.app/Frameworks/libswiftDarwin.dylib"; 
     info =    { 
     }; 
     level = WARN; 
    }, 
      { 
     code = 284; 
     description = "Failed to resolve linkage dependency Watch Extension armv7k -> @rpath/libswiftDispatch.dylib: Could not find image to link for armv7k in /private/var/folders/yl/mw_r1p4j3vj2mfp32rqs0y7r0000gn/T/XcodeDistPipeline.6Tu/Root/Payload/Photobooth.app/Frameworks/libswiftDispatch.dylib"; 
     info =    { 
     }; 
     level = WARN; 
    }, 
      { 
     code = 284; 
     description = "Failed to resolve linkage dependency Watch Extension armv7k -> @rpath/libswiftFoundation.dylib: Could not find image to link for armv7k in /private/var/folders/yl/mw_r1p4j3vj2mfp32rqs0y7r0000gn/T/XcodeDistPipeline.6Tu/Root/Payload/Photobooth.app/Frameworks/libswiftFoundation.dylib"; 
     info =    { 
     }; 
     level = WARN; 
    }, 
      { 
     code = 284; 
     description = "Failed to resolve linkage dependency Watch Extension armv7k -> @rpath/libswiftHomeKit.dylib: Could not resolve @rpath in @rpath/libswiftHomeKit.dylib from Watch Extension"; 
     info =    { 
     }; 
     level = WARN; 
    }, 
      { 
     code = 284; 
     description = "Failed to resolve linkage dependency Watch Extension armv7k -> @rpath/libswiftObjectiveC.dylib: Could not find image to link for armv7k in /private/var/folders/yl/mw_r1p4j3vj2mfp32rqs0y7r0000gn/T/XcodeDistPipeline.6Tu/Root/Payload/Photobooth.app/Frameworks/libswiftObjectiveC.dylib"; 
     info =    { 
     }; 
     level = WARN; 
    }, 
      { 
     code = 284; 
     description = "Failed to resolve linkage dependency Watch Extension armv7k -> @rpath/libswiftSceneKit.dylib: Could not resolve @rpath in @rpath/libswiftSceneKit.dylib from Watch Extension"; 
     info =    { 
     }; 
     level = WARN; 
    }, 
      { 
     code = 284; 
     description = "Failed to resolve linkage dependency Watch Extension armv7k -> @rpath/libswiftUIKit.dylib: Could not find image to link for armv7k in /private/var/folders/yl/mw_r1p4j3vj2mfp32rqs0y7r0000gn/T/XcodeDistPipeline.6Tu/Root/Payload/Photobooth.app/Frameworks/libswiftUIKit.dylib"; 
     info =    { 
     }; 
     level = WARN; 
    }, 
      { 
     code = 284; 
     description = "Failed to resolve linkage dependency Watch Extension armv7k -> @rpath/libswiftWatchKit.dylib: Could not resolve @rpath in @rpath/libswiftWatchKit.dylib from Watch Extension"; 
     info =    { 
     }; 
     level = WARN; 
    }, 
      { 
     code = 284; 
     description = "Failed to resolve linkage dependency Watch Extension armv7k -> @rpath/libswiftsimd.dylib: Could not resolve @rpath in @rpath/libswiftsimd.dylib from Watch Extension"; 
     info =    { 
     }; 
     level = WARN; 
    }, 

Trả lời

15

Phải mất 12 giờ để con số này ra, nhưng đây là những gì cố định nó - thay đổi các thiết lập như thế này ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES xây dựng:

App mục tiêu (mục tiêu chính) - thiết lập để NO (tôi là YES)

Xem nhắm mục tiêu - thiết lập để YES (mỏ là NO)

Xem App mở rộng nhắm mục tiêu - được đặt thành NO (tôi đã CÓ)

Chỉnh sửa: Tôi đã tìm ra điều này bằng cách tạo dự án đồng hồ mới, trống trong xcode 8 và tham chiếu chéo sự khác biệt giữa cài đặt xây dựng trong xcode mới 8 dự án mẫu, và dự án cổ xưa cũ của tôi. Các thiết lập ở trên là những gì dự án mẫu xcode 8 có.

+0

Bạn sử dụng Cocoapod ở đâu? Tôi đang gặp lỗi này tuy nhiên các thư viện nhanh chóng có vẻ đúng trong trường hợp của tôi. Tôi cũng đã thử cờ '$ (thừa kế) 'cho mỗi thông điệp cảnh báo của cụm ca cao cho thấy. Tôi đang vào ngày thứ 3 chiến đấu này. :( – kev

+0

@kev: vâng, tôi đề xuất tạo một dự án trống mới trong xcode 8 và tham chiếu chéo các khác biệt trong cài đặt xây dựng từ dự án mới/mẫu cho dự án hiện tại của bạn. 'gem update cocoapods' trong trường hợp bạn không làm điều này gần đây – xaphod

+0

Điều này làm việc cho tôi. Trong trường hợp của tôi, tôi đã để mục tiêu ứng dụng được đặt thành CÓ. Vấn đề duy nhất là mục tiêu Watch cần thay đổi thành YES ngay bây giờ Ứng dụng đồng hồ cũng bao gồm Swift. – robotspacer

4

Tôi muốn xây dựng dựa trên kinh nghiệm của mình về vấn đề này để hy vọng cứu người khác một thời gian nếu họ gặp phải vấn đề này.

Bối cảnh:

  1. dự án cũ có nguồn gốc với iOS 8, watchos 1.0 App và Hôm nay mở rộng
  2. Đang cập nhật ứng dụng từ Swift 1.0 đến Swift 3.0.1, mục tiêu được cập nhật iOS 8-10, watchos 1,0-3,0
  3. Bắt đầu sử dụng Cocoa Pods với refresh này, không phải là ban đầu

@xaphod có thiếu thư viện, khi tôi chạy otool -L tất cả các thư viện đều chính xác trong mỗi mục tiêu.

Sau nhiều mã nhị phân từ chối tôi cuối cùng:

  1. gỡ Cocoapods từ dự án, như suggested here
  2. Cocoapods Cập nhật đến mới nhất non-beta, phiên bản
  3. cài đặt lại Cocoapods, mục tiêu giảm pod từ ứng dụng , ứng dụng xem, tiện ích mở rộng xem, tiện ích mở rộng ngày hôm nay và mục tiêu thử nghiệm cho chỉ ứng dụng (vì ứng dụng chính chỉ là điều sử dụng nhóm)
  4. @xaphod đề nghị được đăng ở đây để tạo ra một dự án mẫu mới (không sử dụng vỏ) và so sánh với xây dựng các thiết lập Tiếp theo, đặc biệt là ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES
  5. Đặt ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES

Main App Target = $(inherited) mỗi vỏ Cocoa cảnh báo đề nghị. Giá trị mặc định là YES và được hiển thị là YES - $(inherited) trong Xcode. Cuối cùng, EMBEDDED_CONTENT_CONTAINS_SWIFT = YES mỗi thiết lập pod mà kén làm cho bạn

Xem App = YES

Xem Extension = NO

Hôm nay mở rộng = NO

Trước khi các thiết lập ở trên, Tôi đã cố gắng $(inherited) cho mọi thứ để làm cho quả ca cao hạnh phúc. Điều này rõ ràng là một quyết định cuộc sống nghèo nàn.

Cuối cùng tôi đã tìm cách xuất là AD HOC sẽ thất bại nếu nhị phân không được chấp nhận bởi iTunes Connect, vì vậy tôi có thể tiết kiệm thời gian thử nghiệm lý thuyết trước khi ném bản dựng tại Apple. Tôi đã cố gắng so sánh nhị phân thành công với số nhị phân thất bại nhưng thực sự không thấy bất kỳ điều gì đặc biệt nổi bật với tôi về sự khác biệt.

Tôi vẫn không cảm thấy thoải mái 100% với cách tôi làm việc này nhưng hạnh phúc tôi cuối cùng có thể tải lên một tệp nhị phân. Chúc mừng và chúc may mắn!

0

Awesome, tôi gặp vấn đề tương tự

hãy xem bạn Embeded Binaries Section, nếu bạn có thể thấy một số đường dẫn tuyệt đối trong đường dẫn tài liệu tham khảo. Bạn có thể xóa khuôn khổ khỏi cây dự án ở bên trái và thêm lại khung. Hãy chắc chắn rằng, đường dẫn là ..in build/Debug-iphoneos

Chúc bạn may mắn!

Các vấn đề liên quan