maplibre / maplibre-react-native

A MapLibre react native module for creating custom maps
Other
168 stars 39 forks source link

iOS Build Error (dev) #366

Closed Craytor closed 1 week ago

Craytor commented 1 week ago

When running npm run ios, the build command keeps failing. I am getting multiple "fatal error: module 'Mapbox' not found" in the logs.

Some logs:

CompileC /Users/USER/Library/Developer/Xcode/DerivedData/LiveChasing-echlwoqshkynkjbhpgyozzjvtvvl/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/maplibre-react-native.build/Objects-normal/arm64/RCTMGLShapeSourceManager.o /Users/USER/Code/livestormchasing-mobile/node_modules/@maplibre/maplibre-react-native/ios/RCTMGL/RCTMGLShapeSourceManager.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'maplibre-react-native' from project 'Pods')
    cd /Users/USER/Code/livestormchasing-mobile/ios/Pods
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -ivfsstatcache /Users/USER/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphonesimulator17.4-21E210-aa93b11c43e2d16681ac3fa171344f4f.sdkstatcache -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fno-color-diagnostics -fmodules-prune-interval\=86400 -fmodules-prune-after\=345600 -fbuild-session-file\=/Users/USER/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror\=non-modular-include-in-framework-module -Wno-trigraphs -Wno-missing-field-initializers -Wno-missing-prototypes -Werror\=return-type -Wdocumentation -Wunreachable-code -Wno-implicit-atomic-properties -Werror\=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror\=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -Wno-implicit-fallthrough -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -Wunguarded-availability -index-store-path /Users/USER/Library/Developer/Xcode/DerivedData/LiveChasing-echlwoqshkynkjbhpgyozzjvtvvl/Index.noindex/DataStore @/Users/USER/Library/Developer/Xcode/DerivedData/LiveChasing-echlwoqshkynkjbhpgyozzjvtvvl/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/maplibre-react-native.build/Objects-normal/arm64/e6072d4f65d7061329687fe24e3d63a7-common-args.resp -include /Users/USER/Code/livestormchasing-mobile/ios/Pods/Target\ Support\ Files/maplibre-react-native/maplibre-react-native-prefix.pch -MMD -MT dependencies -MF /Users/USER/Library/Developer/Xcode/DerivedData/LiveChasing-echlwoqshkynkjbhpgyozzjvtvvl/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/maplibre-react-native.build/Objects-normal/arm64/RCTMGLShapeSourceManager.d --serialize-diagnostics /Users/USER/Library/Developer/Xcode/DerivedData/LiveChasing-echlwoqshkynkjbhpgyozzjvtvvl/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/maplibre-react-native.build/Objects-normal/arm64/RCTMGLShapeSourceManager.dia -c /Users/USER/Code/livestormchasing-mobile/node_modules/@maplibre/maplibre-react-native/ios/RCTMGL/RCTMGLShapeSourceManager.m -o /Users/USER/Library/Developer/Xcode/DerivedData/LiveChasing-echlwoqshkynkjbhpgyozzjvtvvl/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/maplibre-react-native.build/Objects-normal/arm64/RCTMGLShapeSourceManager.o -index-unit-output-path /Pods.build/Debug-iphonesimulator/maplibre-react-native.build/Objects-normal/arm64/RCTMGLShapeSourceManager.o

CompileC /Users/USER/Library/Developer/Xcode/DerivedData/LiveChasing-echlwoqshkynkjbhpgyozzjvtvvl/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/maplibre-react-native.build/Objects-normal/arm64/RCTMGLShapeSource.o /Users/USER/Code/livestormchasing-mobile/node_modules/@maplibre/maplibre-react-native/ios/RCTMGL/RCTMGLShapeSource.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'maplibre-react-native' from project 'Pods')
    cd /Users/USER/Code/livestormchasing-mobile/ios/Pods
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -ivfsstatcache /Users/USER/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphonesimulator17.4-21E210-aa93b11c43e2d16681ac3fa171344f4f.sdkstatcache -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fno-color-diagnostics -fmodules-prune-interval\=86400 -fmodules-prune-after\=345600 -fbuild-session-file\=/Users/USER/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror\=non-modular-include-in-framework-module -Wno-trigraphs -Wno-missing-field-initializers -Wno-missing-prototypes -Werror\=return-type -Wdocumentation -Wunreachable-code -Wno-implicit-atomic-properties -Werror\=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror\=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -Wno-implicit-fallthrough -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -Wunguarded-availability -index-store-path /Users/USER/Library/Developer/Xcode/DerivedData/LiveChasing-echlwoqshkynkjbhpgyozzjvtvvl/Index.noindex/DataStore @/Users/USER/Library/Developer/Xcode/DerivedData/LiveChasing-echlwoqshkynkjbhpgyozzjvtvvl/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/maplibre-react-native.build/Objects-normal/arm64/e6072d4f65d7061329687fe24e3d63a7-common-args.resp -include /Users/USER/Code/livestormchasing-mobile/ios/Pods/Target\ Support\ Files/maplibre-react-native/maplibre-react-native-prefix.pch -MMD -MT dependencies -MF /Users/USER/Library/Developer/Xcode/DerivedData/LiveChasing-echlwoqshkynkjbhpgyozzjvtvvl/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/maplibre-react-native.build/Objects-normal/arm64/RCTMGLShapeSource.d --serialize-diagnostics /Users/USER/Library/Developer/Xcode/DerivedData/LiveChasing-echlwoqshkynkjbhpgyozzjvtvvl/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/maplibre-react-native.build/Objects-normal/arm64/RCTMGLShapeSource.dia -c /Users/USER/Code/livestormchasing-mobile/node_modules/@maplibre/maplibre-react-native/ios/RCTMGL/RCTMGLShapeSource.m -o /Users/USER/Library/Developer/Xcode/DerivedData/LiveChasing-echlwoqshkynkjbhpgyozzjvtvvl/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/maplibre-react-native.build/Objects-normal/arm64/RCTMGLShapeSource.o -index-unit-output-path /Pods.build/Debug-iphonesimulator/maplibre-react-native.build/Objects-normal/arm64/RCTMGLShapeSource.o
In file included from /Users/USER/Code/livestormchasing-mobile/node_modules/@maplibre/maplibre-react-native/ios/RCTMGL/RCTMGLShapeSource.m:9:
In file included from /Users/USER/Code/livestormchasing-mobile/node_modules/@maplibre/maplibre-react-native/ios/RCTMGL/RCTMGLShapeSource.h:10:
In file included from /Users/USER/Code/livestormchasing-mobile/node_modules/@maplibre/maplibre-react-native/ios/RCTMGL/RCTMGLSource.h:10:
/Users/USER/Code/livestormchasing-mobile/node_modules/@maplibre/maplibre-react-native/ios/RCTMGL/RCTMGLLayer.h:15:9: fatal error: module 'Mapbox' not found
@import Mapbox;
 ~~~~~~~^~~~~~

CompileC /Users/USER/Library/Developer/Xcode/DerivedData/LiveChasing-echlwoqshkynkjbhpgyozzjvtvvl/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/maplibre-react-native.build/Objects-normal/arm64/RCTMGLRasterSourceManager.o /Users/USER/Code/livestormchasing-mobile/node_modules/@maplibre/maplibre-react-native/ios/RCTMGL/RCTMGLRasterSourceManager.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'maplibre-react-native' from project 'Pods')
    cd /Users/USER/Code/livestormchasing-mobile/ios/Pods
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -ivfsstatcache /Users/USER/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphonesimulator17.4-21E210-aa93b11c43e2d16681ac3fa171344f4f.sdkstatcache -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fno-color-diagnostics -fmodules-prune-interval\=86400 -fmodules-prune-after\=345600 -fbuild-session-file\=/Users/USER/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror\=non-modular-include-in-framework-module -Wno-trigraphs -Wno-missing-field-initializers -Wno-missing-prototypes -Werror\=return-type -Wdocumentation -Wunreachable-code -Wno-implicit-atomic-properties -Werror\=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror\=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -Wno-implicit-fallthrough -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -Wunguarded-availability -index-store-path /Users/USER/Library/Developer/Xcode/DerivedData/LiveChasing-echlwoqshkynkjbhpgyozzjvtvvl/Index.noindex/DataStore @/Users/USER/Library/Developer/Xcode/DerivedData/LiveChasing-echlwoqshkynkjbhpgyozzjvtvvl/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/maplibre-react-native.build/Objects-normal/arm64/e6072d4f65d7061329687fe24e3d63a7-common-args.resp -include /Users/USER/Code/livestormchasing-mobile/ios/Pods/Target\ Support\ Files/maplibre-react-native/maplibre-react-native-prefix.pch -MMD -MT dependencies -MF /Users/USER/Library/Developer/Xcode/DerivedData/LiveChasing-echlwoqshkynkjbhpgyozzjvtvvl/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/maplibre-react-native.build/Objects-normal/arm64/RCTMGLRasterSourceManager.d --serialize-diagnostics /Users/USER/Library/Developer/Xcode/DerivedData/LiveChasing-echlwoqshkynkjbhpgyozzjvtvvl/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/maplibre-react-native.build/Objects-normal/arm64/RCTMGLRasterSourceManager.dia -c /Users/USER/Code/livestormchasing-mobile/node_modules/@maplibre/maplibre-react-native/ios/RCTMGL/RCTMGLRasterSourceManager.m -o /Users/USER/Library/Developer/Xcode/DerivedData/LiveChasing-echlwoqshkynkjbhpgyozzjvtvvl/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/maplibre-react-native.build/Objects-normal/arm64/RCTMGLRasterSourceManager.o -index-unit-output-path /Pods.build/Debug-iphonesimulator/maplibre-react-native.build/Objects-normal/arm64/RCTMGLRasterSourceManager.o

warning: Run script build phase '[CP-User] [Hermes] Replace Hermes for the right configuration, if needed' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'hermes-engine' from project 'Pods')
warning: Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'LiveChasing' from project 'LiveChasing')

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:02436BBA-E56B-436B-B16E-CF09B08B600D, OS:17.4, name:iPhone SE (3rd generation) }
{ platform:iOS Simulator, id:02436BBA-E56B-436B-B16E-CF09B08B600D, OS:17.4, name:iPhone SE (3rd generation) }
** BUILD FAILED **

The following build commands failed:
        CompileC /Users/USER/Library/Developer/Xcode/DerivedData/LiveChasing-echlwoqshkynkjbhpgyozzjvtvvl/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/maplibre-react-native.build/Objects-normal/arm64/RCTMGLVectorSource.o /Users/USER/Code/livestormchasing-mobile/node_modules/@maplibre/maplibre-react-native/ios/RCTMGL/RCTMGLVectorSource.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'maplibre-react-native' from project 'Pods')
(1 failure)

Version(s) affected

Additional context

Craytor commented 1 week ago

This also occurs on maplibre-react-native: ^10.0.0-alpha.4, along with version 9 releases.

Craytor commented 1 week ago

This was due to the incorrect MapLibre GL Native Version (6 vs 5.13.0). Info on how to set the correct version in the podfile is in the docs.

tyrauber commented 1 week ago

@Craytor, thanks for reporting back. For others that might be experiencing this issue, was this the proper solution here:

$RNMBGL_Use_SPM = {
  url: "https://github.com/maplibre/maplibre-gl-native-distribution",
  requirement: {
    kind: "upToNextMajorVersion",
    minimumVersion: "5.13.0"
  },
  product_name: "Mapbox"
}