Skip to content

No way to add passing test_spec that doesn't cause build warning "Mapping architecture armv7 to i386. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform" #9210

@jmagman

Description

@jmagman

Report

What did you do?

Add test_spec to podspec.

s.test_spec 'Tests' do |test_spec|
  test_spec.source_files = 'Tests/**/*'
end
pod lib lint image_picker.podspec --no-clean --verbose

i386 linker errors

    Undefined symbols for architecture i386:
      "_FlutterMethodNotImplemented", referenced from:
          -[FLTImagePickerPlugin handleMethodCall:result:] in ImagePickerPlugin.o
      "_OBJC_CLASS_$_FlutterError", referenced from:
          objc-class-ref in ImagePickerPlugin.o
      "_OBJC_CLASS_$_FlutterMethodChannel", referenced from:
          objc-class-ref in ImagePickerPlugin.o
    ld: symbol(s) not found for architecture i386
    clang: error: linker command failed with exit code 1 (use -v to see invocation)

From the validator code it looks like the i386 simulator can be excluded by setting a VALID_ARCHS that includes armv7 and x86_64. See #8129.

Add s.pod_target_xcconfig = { 'VALID_ARCHS' => 'armv7 arm64 x86_64' } to podspec.

What did you expect to happen?

No build warnings or errors.

What happened instead?

Now there's a new warning, though no errors and tests pass:

warning: Mapping architecture armv7 to i386. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'image_picker' from project 'Pods')
warning: Mapping architecture arm64 to x86_64. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'image_picker' from project 'Pods')

Screen Shot 2019-10-01 at 11 20 04 AM

What's the suggested value of VALID_ARCHS that will prevent the i386 simulator from running but also not cause a build warning?

CocoaPods Environment

$ pod --version                                                               
1.8.1

Project that demonstrates the issue

https://github.com/flutter/plugins/tree/master/packages/image_picker/ios

Metadata

Metadata

Assignees

No one assigned

    Labels

    s1:awaiting inputWaiting for input from the original author

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions