punarinta / react-native-sound-level

A package to dynamically measure sound input level in React Native applications. Can be used to help user to adjust microphone sensitivity.
MIT License
79 stars 45 forks source link

'React/RCTBridgeModule.h' file not found #7

Closed hugoh59 closed 5 years ago

hugoh59 commented 5 years ago

I'm getting the following error when trying to build on ios.

'React/RCTBridgeModule.h' file not found

I'm using RN 0.60.4 and with autolink but I tried to link it manually and disable autolink for that library and none of these options work. Do you know how to properly use the library for RN 0.60+ ?

punarinta commented 5 years ago

I've just done today Android migration for the project from which this lib was split. I think it's time to do the same for iOS. :) Sorry for inconveniences, I'll try to fix this asap.

punarinta commented 5 years ago

@hugoh59 do you use CocoaPods when compiling the iOS project? I don't and probably that's why I couldn't reproduce your problem. However I've now added some compatibility code for RN 0.60.x and released a new library version. Could you please fetch it and tell me if it works now?

johnny7577 commented 5 years ago
螢幕快照 2019-08-06 下午2 50 43

RN 0.60.4

punarinta commented 5 years ago

@johnny7577 a couple questions to you.

  1. Do you use CocoaPods or do you build the app without them (see my message above)?
  2. Have you tried the new version (1.1.1)?
johnny7577 commented 5 years ago

@punarinta

  1. Not using CocoaPods
  2. yes, I use v1.1.1
johnny7577 commented 5 years ago

I create react-native-sound-level.podspec and add pod 'react-native-sound-level', :podspec => '../node_modules/react-native-sound-level/react-native-sound-level.podspec' on Podfile. execute pod install Solve the problem :)

punarinta commented 5 years ago

@johnny7577 awesome! Now I just need to incorporate your solution into the package somehow.

zoruc commented 5 years ago

@punarinta @johnny7577 any update on how to fix this, i'm experiencing the same issue when trying to install

NN01010101 commented 5 years ago

@johnny7577 can you please share the podspec file? Thank you! @punarinta would be great to add cocoapod support. BTW. Big thanks on creating this library!

NN01010101 commented 5 years ago

@zoruc Seems like I managed to get it to work. So I created the podspec file as @johnny7577 suggested and put it into node_modules/react-native-sound-level/react-native-sound-level.podspec Here is how the file looks like, maybe @punarinta you can add it to your future release and update the README:

require 'json'

package = JSON.parse(File.read(File.join(__dir__, 'package.json')))

Pod::Spec.new do |s|
  s.name         = "react-native-sound-level"
  s.version      = package['version']
  s.summary      = "React Native Sound level library"

  s.authors      = { "Vladimir Osipov" => "vladimir.osipov@gmail.com" }
  s.homepage     = "https://github.com/punarinta/react-native-sound-level"
  s.license      = "Apache License 2.0"
  s.platform     = :ios, "8.0"

  s.source       = { :git => "https://github.com/punarinta/react-native-sound-level" }
  s.source_files  = "ios/**/*.{h,m}"
  s.preserve_paths = "**/*.js"
  s.requires_arc = true
  s.dependency 'React'
end

Since I previously linked the library, I had to unlink it again with react-native unlink react-native-sound-level Then cd ios && pod install

I'm using "0.60.4"

punarinta commented 5 years ago

@NN01010101 thanks for the solution! There's this pull request: https://github.com/punarinta/react-native-sound-level/pull/8/commits/cb799af6fc75db34d913a19e80e08104becda20a#diff-fec97c807de4f8a06b87c317a83525ea Could you please double check it with your environment as well? I'd then merge it in.

NN01010101 commented 5 years ago

@punarinta I tried the pull request and it didn't work for me. I put the file in the root and in the ios directory and it cocoa pod didn't find it. I then tried again with mine podspec by following the steps of @johnny7577 and everything works fine.

punarinta commented 5 years ago

@NN01010101 ok, cool. Let me test it that way then.

punarinta commented 5 years ago

Solve with a new 1.1.2 release.

NN01010101 commented 5 years ago

Hey @punarinta, I just removed node-modules, and installed new version 1.1.2 just to make sure everything works well, but it seems like the RNSoundLevel.podspec file does not appear in the directory. How is it possible?

Also, you are missing "pod" in README instructions on iOS, should be: Add 'pod react-native-sound-level', :podspec => '../node_modules/react-native-sound-level/RNSoundLevel.podspec' to your ios/Podfile file.

punarinta commented 5 years ago

@NN01010101 it was missing in the package file. :) Try again please (mind the version bump).