Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppCenter/AppCenter.h file not found (rn 0.61.0-rc.3 - use_native_modules! & use_frameworks!) #714

Closed
brunoreis opened this issue Sep 24, 2019 · 38 comments
Labels

Comments

@brunoreis
Copy link

Description

I get the following error message on xCode 11, trying to build on an iPad pro. The message here is:

.../node_modules/appcenter/ios/AppCenterReactNative/AppCenterReactNative.m:22:9: 'AppCenter/AppCenter.h' file not found

.../node_modules/appcenter/ios/AppCenterReactNative/AppCenterReactNative.m:22:9: Did not find header 'AppCenter.h' in framework 'AppCenter' (loaded from '.../Library/Developer/Xcode/DerivedData/AppName-eesqqsqtvoykvmfvnihmjcoqltlf/Build/Products/Debug-iphoneos/appcenter'

If I go to that DerivedData folder, I don't see an AppCenter.h in there. Only appcenter-umbrella.h and AppCenterReactNative.h.

I'm new to xCode, but I could note that:

There is a pod under Development Pods called appcenter, and another one inside Pods that's called AppCenter. The AppCenter one is where the AppCenter.h lives, but the podspec just mention the AppCenterReactNativeShared.framework

Screen Shot 2019-09-24 at 11 27 24
Screen Shot 2019-09-24 at 11 27 44
Screen Shot 2019-09-24 at 11 28 49

I have to use "use_frameworks!" due to a pod that requires it. But I don't know enough to say if it's messing things up or not.

(rn is 0.61.0-rc.3, because I read it has support for use_frameworks! and appcenter is 2.3.0)

  1. Which version of the App Center SDK are you using?
    2.3.0
  2. Which OS version did you experience the issue on?
    iOS 12.3.1
  3. What device version did you see this error on? Were you using an emulator or a physical device?
    iPad Pro
  4. What third party libraries are you using?
    Bugsnag
    TextToSpeech
    fetch-blob
    RNCAsyncStorage
    RNVectorIcons
  5. Run the following command and paste the output below: react-native info
System:
    OS: macOS 10.14.5
    CPU: (4) x64 Intel(R) Core(TM) i7-4578U CPU @ 3.00GHz
    Memory: 454.96 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 10.16.3 - ~/.nvm/versions/node/v10.16.3/bin/node
    Yarn: 1.17.3 - /usr/local/bin/yarn
    npm: 6.9.0 - ~/.nvm/versions/node/v10.16.3/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.0, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
    Android SDK:
      API Levels: 23, 25, 26, 27
      Build Tools: 23.0.1, 23.0.3, 25.0.0, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 27.0.0, 27.0.3
      System Images: android-23 | Intel x86 Atom_64, android-23 | Google APIs Intel x86 Atom_64, android-26 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom
  IDEs:
    Android Studio: 3.0 AI-171.4443003
    Xcode: 11.0/11A420a - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0
    react-native: 0.61.0-rc.3 => 0.61.0-rc.3
  1. If you're developing for React Native iOS, run the following command and paste the output below: pod --version

1.5.3

  1. Please enable verbose logging for your app using [MSAppCenter setLogLevel: MSLogLevelVerbose]; before your call to [AppCenterReactNative register]; (or any other SDK registration). For Android, use AppCenter.setLogLevel(android.util.Log.VERBOSE); before your SoLoader.init call (you will need to import com.microsoft.appcenter.AppCenter;). Include the logs here:

I think this does not apply, because I can't even run.

@annakocheshkova
Copy link

Hey @brunoreis ! While I set up new RN to reproduce, would you mind answering these questions:

Does this issue reproduce only on XCode 11?
If you go under Pods project and choose AppCenterReactNative target:
image
Do use see AppCenter under Build Phases > Dependencies?
image

@annakocheshkova
Copy link

annakocheshkova commented Sep 24, 2019

Have also seen any errors/warnings during pod install?

@annakocheshkova
Copy link

And could you send your Podfile please?

@brunoreis
Copy link
Author

brunoreis commented Sep 24, 2019

Hi @annakocheshkova, I tested a fresh install here and got the same error. I think this will be easier for you to test.
1 - I installed it with:
react-native init AppCenterFrameworkTest --version 0.61.0-rc.3
added the team credentials and was able to build on the iPad using the cli and xCode 12
2 - I added the use_frameworks! to my Podfile and I was able to build it too.
3 - I added the AppCenter dependecies, cleaned the node_modules and installed it all again.

  "dependencies": {
    "react": "16.9.0",
    "react-native": "0.61.0-rc.3",
    "appcenter": "2.3.0",
    "appcenter-analytics": "2.3.0",
    "appcenter-crashes": "2.3.0"
  },

4 - I "deintegrated" the pods and run pod install, that did not complete and showed:

[!] The 'Pods-AppCenterFrameworkTest' target has transitive dependencies that include static binaries: (.../AppCenterFrameworkTest/ios/Pods/AppCenter/AppCenter-SDK-Apple/iOS/AppCenterAnalytics.framework, .../AppCenterFrameworkTest/ios/Pods/AppCenter/AppCenter-SDK-Apple/iOS/AppCenter.framework, .../AppCenterFrameworkTest/ios/Pods/AppCenter/AppCenter-SDK-Apple/iOS/AppCenterCrashes.framework, and .../AppCenterFrameworkTest/ios/Pods/AppCenterReactNativeShared/AppCenterReactNativeShared/AppCenterReactNativeShared.framework)

5 - to fix that I added this hack on the Podfile

pre_install do |installer|
	# workaround for https://github.com/CocoaPods/CocoaPods/issues/3289
	Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end

6 - pod install run ok. Then I tried to build on xCode and got that AppCenter/AppCenter.h file not found error

So, isolating things, the issue seems to be with the use_frameworks! Please notice I did not add any other packages or pods other than AppCenter and ReactNative default ones.

Podfile:

platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'AppCenterFrameworkTest' do
  # Pods for AppCenterFrameworkTest
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'

  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'

  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  use_native_modules!
  use_frameworks!
end

pre_install do |installer|
	# workaround for https://github.com/CocoaPods/CocoaPods/issues/3289
	Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end

@brunoreis
Copy link
Author

I don't see AppCenter listed in Targets:

Screen Shot 2019-09-24 at 16 53 51

@yestay90
Copy link

yestay90 commented Sep 25, 2019

I dont understand, should we put
pod 'AppCenter/Core', '> 2.3.0'
pod 'AppCenter/Crashes', '
> 2.3.0'
pod 'AppCenter/Analytics', '> 2.3.0'
pod 'AppCenterReactNativeShared', '
> 2.3.0'
to pod file , I see AppCenter in the list of targets if to add lines of which I wrote above, but dont see it on the fileSystem on left side.

I have problem on AppDelegate.m
it doesnt see these import files
#import <AppCenterReactNative.h>
#import <AppCenterReactNativeAnalytics.h>
#import <AppCenterReactNativeCrashes.h>

@brunoreis
Copy link
Author

@yestay90, I think that the use_native_modules! entry on the pod file is enough. It will look on node_modules and import app center.

@brunoreis brunoreis changed the title AppCenter/AppCenter.h file not found (rn 0.61.0-rc.3 - use_native_modules!) AppCenter/AppCenter.h file not found (rn 0.61.0-rc.3 - use_native_modules! & use_frameworks!) Sep 25, 2019
@annakocheshkova
Copy link

Hey @brunoreis. Indeed this is not working and looks like in new RN version, there's still no proper support for dynamic frameworks.
App Center RN SDK doesn’t support use_frameworks! today and the reason is latest RN doesn’t support iOS dynamic frameworks.
But there a quick workaround if you want to get it work here

@annakocheshkova
Copy link

@brunoreis just wanted to let you know that I opened an issue in react-native repo. Feel free to jump in!

@AnastasiaKubova
Copy link
Contributor

I am closing this issue. Feel free to reopen if you feel like you need support.

@brunoreis
Copy link
Author

brunoreis commented Oct 2, 2019

@annakocheshkova, thanks. Sorry for the delay answering this. I was focused on a web task. We decided to wait a little to work on the new RN build.

I think the newest 0.61.0 version already supports use_frameworks!. (https://github.com/facebook/react-native/releases/tag/v0.61.0)I was able to build with rc-3 at that moment. But was not able to build after adding the AppCenter libs.

I'll let you know when we get back to this task. Thanks a lot!

@JuanSeBestia
Copy link

Hi @annakocheshkova, I am working to solve this same problem with the flag use_framework!, any suggestion is welcome.

react-native info:

info Fetching system and libraries information...
System:
    OS: macOS Mojave 10.14.6
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    Memory: 1011.20 MB / 16.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 10.15.3 - /usr/local/bin/node
    Yarn: 1.16.0 - ~/.npm-packages/bin/yarn
    npm: 6.9.0 - ~/.npm-packages/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.0, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
  IDEs:
    Android Studio: 3.4 AI-183.5429.30.34.5452501
    Xcode: 11.0/11A420a - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0 
    react-native: 0.61.2 => 0.61.2 
  npmGlobalPackages:
    react-native-cli: 2.0.1
    react-native: 0.61.2

Podfile

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

target 'XXXProject' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  use_frameworks!

  # Pods for XXXProject
  pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
  pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
  pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
  pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
  pod 'React', :path => '../node_modules/react-native/'
  pod 'React-Core', :path => '../node_modules/react-native/'
  pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
  pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
  pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
  pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
  pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
  pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
  pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
  pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
  pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
  pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
  pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
  pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
  pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
  pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
  pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
  pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
  pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
  pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
  pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
  pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'

  # Third-party dependencies
  # pod 'lottie-react-native', :podspec => '../node_modules/lottie-react-native/lottie-react-native.podspec'
  pod 'lottie-ios', :path => '../node_modules/lottie-ios'
  pod 'lottie-react-native', :path => '../node_modules/lottie-react-native'

  # Pods for AppCenter
  pod 'appcenter', path: '../node_modules/appcenter/ios'
  pod 'appcenter-analytics', path: '../node_modules/appcenter-analytics/ios'
  pod 'appcenter-push', path: '../node_modules/appcenter-push/ios'

  target 'XXXProjectTests' do
    inherit! :search_paths
    # Pods for testing
    pod 'XCTest-Gherkin', '~> 0.18.0'
    pod 'XCTest-Gherkin/Native', '~> 0.18.0'
    pod 'SwiftyJSON', '~> 4.2.0'
    pod 'Alamofire'
    pod 'RestEssentials', '~> 4.0.3'
  end

  use_native_modules!
end

pre_install do |installer|
  Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end

Versions:
AppCenter/* 2.4.0

@Jamminroot
Copy link

@JuanSeBestia would you mind sharing step-by-step guide to repro? That would really help me investigate the problem. Thanks in advance

@JuanSeBestia
Copy link

@Jamminroot I have replicated it, in the installation of the Pods it is broken, you can read the steps in the readme of the git https://github.com/JuanSeBestia/RN-test

@arcesoj
Copy link

arcesoj commented Oct 14, 2019

This worked in my case :

  1. brew uninstall cocoapods
  2. sudo gem install cocoapods -v 1.7.5

I am using :
React Native 0.60.4
Appcenter 2.4.0

CocoaPods/CocoaPods#9214 (comment)

@russelarms
Copy link
Contributor

Downgrading cocoapods didn't fix "use_frameworks" issue for me. It is still not supported fully from react-native side.

@JuanSeBestia
Copy link

@arcesoj I need the las versión of RN 61.x :/

@freshedgarT
Copy link

I am experiencing the same incompatibility with AppCenter and use_frameworks on RN 61.3

@AnastasiaKubova
Copy link
Contributor

Hi, @freshedgarT ! It still is not supported on RN.

@ntcong91
Copy link

ntcong91 commented Nov 8, 2019

+1 for react-native 0.61.4 - the same issue with use_framework! in pod file!

@brunoreis
Copy link
Author

Hi @annakocheshkova. Are you sure it's not supported on RN? I was able to build the RN (>0.61) app with all the modules I had and 'use_framework!'.

Conflicts only happen if I try to add AppCenter. In fact, due to that, we had to remove AppCenter from our app on the recent build.

@guperrot guperrot reopened this Nov 8, 2019
@Gustash
Copy link

Gustash commented Nov 12, 2019

This is a big issue for us as well. I had to remove AppCenter and AppCenterAnalytics from our most recent build, just like @brunoreis because we need 'use_framework!'

@dhei dhei added known issue and removed support labels Nov 18, 2019
@vforvasile
Copy link

I solved the build issue by downgrading Cocoapods to 1.5.3 as a temporary solution.
sudo gem uninstall cocoapods
then
sudo gem install cocoapods -v 1.5.3

@AdrianMrn
Copy link

This isn't really a solution to this issue, but I managed to upgrade all my modules to where I didn't need use_frameworks! in my podfile anymore, and now the SDK works.

@brunoreis
Copy link
Author

if you want to use CodePush only, it seems that https://github.com/microsoft/react-native-code-push still builds on new RN versions with use_framewors!

@evelant
Copy link

evelant commented Dec 13, 2019

I had to remove all AppCenter modules except for code push to get things working because of this issue.

@gla5001
Copy link

gla5001 commented Dec 18, 2019

What is going on with this? Hitting same issue.

@guperrot guperrot added bug and removed known issue labels Dec 19, 2019
@yastrebovb
Copy link

Same...

@gla5001
Copy link

gla5001 commented Jan 23, 2020

Any updates on this?

@annakocheshkova
Copy link

Hey, this is going to be addressed in one of the next releases.

@viemic
Copy link

viemic commented Feb 7, 2020

In the meanwhile, are there any workarounds you guys came up with?

@russelarms
Copy link
Contributor

@viemic you can try to apply changes from this PR: https://github.com/microsoft/appcenter-sdk-react-native/pull/789/files

@OritKedem
Copy link

Any new about this issue?
Having the same problem using mapbox with use_framework!

@guperrot
Copy link
Member

This issue should be fixed in version 3.0.0.

@0x1bitcrack3r
Copy link

0x1bitcrack3r commented Jan 21, 2021

I am using
"appcenter": "3.0.1",
"appcenter-analytics": "3.0.1",
"appcenter-crashes": "3.0.1",
Still the same issue. I am getting following error
AppCenter/AppCenter.h file not found

RN Version: "react-native": "0.61.5"
cocoapods -v 1.5.3
Xcode Version: 12.3

I have tried all the workarounds mentioned above none of them worked for me.

@AnastasiaKubova
Copy link
Contributor

Hi! Thanks for getting in touch with us!
It can be related to the cache issue. Could you please try to:

  • rm -rf ~/Library/Developer/Xcode/DerivedData/*
  • rm -rf /Pods && rm Podfile.lock && pod install
  • Build from XCode

If the issue will persist then could you please try to reproduce this issue on an empty project and let me know about the results?

@MatkovIvan
Copy link
Contributor

@0x1bitcrack3r it's probably related to #875 - 3.0.1 pods do not pin version, so it leads to version conflict. Please update to latest (4.x) or to version with the patch for this issue (3.1.3)

@0x1bitcrack3r
Copy link

Hi! Thanks for getting in touch with us!
It can be related to the cache issue. Could you please try to:

  • rm -rf ~/Library/Developer/Xcode/DerivedData/*
  • rm -rf /Pods && rm Podfile.lock && pod install
  • Build from XCode

If the issue will persist then could you please try to reproduce this issue on an empty project and let me know about the results?

I have tried above steps in my current project still no luck. Will try checking with an empty project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests