CaiJingLong / flutter_ijkplayer

ijkplayer for flutter
MIT License
789 stars 149 forks source link

IOS打包出现错误 #181

Open aluo44 opened 4 years ago

aluo44 commented 4 years ago

简单描述 IOS打包报错

辅助信息

在执行flutter build ios --release的时候出现如下问题 一些信息:

  1. MAC系统版本 10.13.6
  2. flutter doctor信息 **- cpdeiMac:macTest1 cp$ flutter doctor
    • Doctor summary (to see all details, run flutter doctor -v):
    • [✓] Flutter (Channel stable, v1.9.1+hotfix.6, on Mac OS X 10.13.6 17G65, locale
    • zh-Hans-CN)
    • [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • [✓] Xcode - develop for iOS and macOS (Xcode 10.1)
    • [✓] Android Studio (version 3.5)
    • [!] IntelliJ IDEA Ultimate Edition (version 2019.3.1)
    • ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    • ✗ Dart plugin not installed; this adds Dart specific functionality.
    • [✓] Connected device (2 available)
    • ! Doctor found issues in 1 category.**
  3. 报错信息 http://a0cd740c707debf52abe.qiniucdn.apicloud-system.com/apicloud/40198ff1a3ed04fb072775e99bfef0c6.jpg http://a0cd740c707debf52abe.qiniucdn.apicloud-system.com/apicloud/4bda21395d3dc2fc4a0831412325fdfb.jpg

另外再附上文字信息: Last login: Mon Dec 30 18:40:38 on console cpdeiMac:pz_1215 cp$ flutter build ios --release Building com.cwflutter.app for device (ios-release)... Automatically signing iOS for device deployment using specified development team in Xcode project: R5K4QQHUNG Running pod install... 2.1s Running Xcode build...

├─Building Dart code... 48.7s ├─Generating dSYM file... 0.3s ├─Stripping debug symbols... 0.5s ├─Assembling Flutter resources... 1.1s └─Compiling, linking and signing... 1.8s Xcode build done. 62.2s Failed to build iOS app Error output from Xcode build: ↳ BUILD FAILED

Xcode's output: ↳ /Users/cp/.pub-cache/hosted/pub.flutter-io.cn/flutter_ijkplayer-0.3.5+1/ios/ Classes/IjkplayerPlugin.m:210:36: warning: enum values with underlying type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead [-Wformat] NSLog(@"orientation = %ld",orientation);


                                  %ld  (long)
    1 warning generated.
    1 warning generated.
    Building AOT snapshot in release mode (ios-release)...          
    Building App.framework for arm64...

    Building App.framework for armv7...
    Building AOT snapshot in release mode (ios-release)...             47.4s
    Built to build/aot/.
    warning: line table parameters mismatch. Cannot emit.
    note: while processing
    /Users/cp/Desktop/flutter_project/gitee/pz_1215/build/aot/armv7/snapshot_ass
    embly.o
    Project /Users/cp/Desktop/flutter_project/gitee/pz_1215 built and packaged
    successfully.
    While building module 'flutter_ijkplayer' imported from
    /Users/cp/Desktop/flutter_project/gitee/pz_1215/ios/Runner/GeneratedPluginRe
    gistrant.m:7:
    While building module 'IJKMediaFramework' imported from
    /Users/cp/Desktop/flutter_project/gitee/pz_1215/build/ios/Release-iphoneos/f
    lutter_ijkplayer/flutter_ijkplayer.framework/Headers/CoolIjkNotifyChannel.h:
    7:
    In file included from <module-includes>:1:
    In file included from
    /Users/cp/Desktop/flutter_project/gitee/pz_1215/ios/Pods/FlutterIJK/IJKMedia
    Framework.framework/Headers/IJKMediaFramework.h:34:
    /Users/cp/Desktop/flutter_project/gitee/pz_1215/ios/Pods/FlutterIJK/IJKMedia
    Framework.framework/Headers/IJKMPMoviePlayerController.h:27:41: warning:
    'MPMoviePlayerController' is deprecated: first deprecated in iOS 9.0 - Use
    AVPlayerViewController in AVKit. [-Wdeprecated-declarations]
    @interface IJKMPMoviePlayerController : MPMoviePlayerController
    <IJKMediaPlayback>
                                            ^
    In module 'MediaPlayer' imported from
    /Users/cp/Desktop/flutter_project/gitee/pz_1215/ios/Pods/FlutterIJK/IJKMedia
    Framework.framework/Headers/IJKMPMoviePlayerController.h:25:
    /Applications/myTools/Xcode10.1.app/Contents/Developer/Platforms/iPhoneOS.pl
    atform/Developer/SDKs/iPhoneOS12.1.sdk/System/Library/Frameworks/MediaPlayer
    .framework/Headers/MPMoviePlayerController.h:83:12: note:
    'MPMoviePlayerController' has been explicitly marked deprecated here
    @interface MPMoviePlayerController : NSObject <MPMediaPlayback>
               ^
    1 warning generated.
    1 warning generated.
    1 warning generated.
    error: the following command failed with exit code 0 but produced no further
    output
    CompileC
    /Users/cp/Library/Developer/Xcode/DerivedData/Runner-diisswtkdwoqyldkyotgdzk
    frufy/Build/Intermediates.noindex/Runner.build/Release-iphoneos/Runner.build
    /Objects-normal/arm64/GeneratedPluginRegistrant.o
    /Users/cp/Desktop/flutter_project/gitee/pz_1215/ios/Runner/GeneratedPluginRe
    gistrant.m normal arm64 objective-c
    com.apple.compilers.llvm.clang.1_0.compiler
    ld: warning: ignoring file
    /Users/cp/Desktop/flutter_project/gitee/pz_1215/ios/Pods/FlutterIJK/IJKMedia
    Framework.framework/IJKMediaFramework, missing required architecture armv7
    in file
    /Users/cp/Desktop/flutter_project/gitee/pz_1215/ios/Pods/FlutterIJK/IJKMedia
    Framework.framework/IJKMediaFramework (3 slices)
    Undefined symbols for architecture armv7:
      "_OBJC_CLASS_$_IJKFFOptions", referenced from:
          objc-class-ref in flutter_ijkplayer(CoolFlutterIJK.o)
      "_IJKMPMoviePlayerVideoRotationRotateUserInfoKey", referenced from:
          -[CoolIjkNotifyChannel movieRotationChange:] in
          flutter_ijkplayer(CoolIjkNotifyChannel.o)
      "_IJKMPMoviePlayerVideoRotationNotification", referenced from:
          -[CoolIjkNotifyChannel registerObserver] in
          flutter_ijkplayer(CoolIjkNotifyChannel.o)
          -[CoolIjkNotifyChannel unregisterObservers] in
          flutter_ijkplayer(CoolIjkNotifyChannel.o)
      "_IJKMPMoviePlayerPlaybackStateDidChangeNotification", referenced from:
          -[CoolIjkNotifyChannel registerObserver] in
          flutter_ijkplayer(CoolIjkNotifyChannel.o)
          -[CoolIjkNotifyChannel unregisterObservers] in
          flutter_ijkplayer(CoolIjkNotifyChannel.o)
      "_IJKMPMoviePlayerPlaybackDidFinishReasonUserInfoKey", referenced from:
          -[CoolIjkNotifyChannel moviePlayBackFinish:] in
          flutter_ijkplayer(CoolIjkNotifyChannel.o)
      "_IJKMPMoviePlayerPlaybackDidFinishNotification", referenced from:
          -[CoolIjkNotifyChannel registerObserver] in
          flutter_ijkplayer(CoolIjkNotifyChannel.o)
          -[CoolIjkNotifyChannel unregisterObservers] in
          flutter_ijkplayer(CoolIjkNotifyChannel.o)
      "_OBJC_CLASS_$_IJKFFMoviePlayerController", referenced from:
          objc-class-ref in flutter_ijkplayer(CoolFlutterIJK.o)
      "_IJKMPMoviePlayerLoadStateDidChangeNotification", referenced from:
          -[CoolIjkNotifyChannel registerObserver] in
          flutter_ijkplayer(CoolIjkNotifyChannel.o)
          -[CoolIjkNotifyChannel unregisterObservers] in
          flutter_ijkplayer(CoolIjkNotifyChannel.o)
      "_IJKMPMediaPlaybackIsPreparedToPlayDidChangeNotification", referenced
      from:
          -[CoolIjkNotifyChannel registerObserver] in
          flutter_ijkplayer(CoolIjkNotifyChannel.o)
          -[CoolIjkNotifyChannel unregisterObservers] in
          flutter_ijkplayer(CoolIjkNotifyChannel.o)
    ld: symbol(s) not found for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see
    invocation)
    note: Using new build systemnote: Planning buildnote: Constructing build
    description

Encountered error while building for device.
cpdeiMac:pz_1215 cp$ 
aluo44 commented 4 years ago

@CaiJingLong

CaiJingLong commented 4 years ago

See https://github.com/CaiJingLong/flutter_ijkplayer/issues/22#issuecomment-481976222 .

aluo44 commented 4 years ago

谢谢,参考这个已经弄好了

zmm2tysu commented 4 years ago

折腾了俩小时才找到这里...我是不是有点蠢

aluo44 commented 4 years ago

@zmm2tysu 你知足吧 我等人回答这个问题等了几天 后来才发现github还有关闭了的问题这个东西

wtus commented 4 years ago

IOS打包还是有问题

我用 CI/CD 工具 https://codemagic.io/ 进行打包 codemiage 配置‘ 2020-03-11_200518.jpg

参考了 issue22issue108

在 PodFile 配置 config.build_settings['ARCHS'] = 'arm64'

2020-03-11_193910.jpg

在PodFile 配置

      config.build_settings['VALID_ARCHS'] = 'arm64'
      config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'

2020-03-11_194522.jpg

在PodFile 配置

      config.build_settings['ARCHS'] = 'arm64'
      config.build_settings['VALID_ARCHS'] = 'arm64'
      config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES'

2020-03-11_194916.jpg 不配置 config.build_settings ,使用项目中的 PodFile 2020-03-11_195438.jpg

以上测试均是注释掉其他 plugin 之后的结果,其他 plugin 均能正常配置使用

搞一天了,求解决办法