--- Issue 1: ---
App was crashed on the first open on iOS
Reproduction steps:
yarn ensureI
to install node modules and podApp was crash at first open.
For more details, plz see the Project files section, don't worry about secret keys, that is a public project.
--- Issue 2: ---
You can see in my Podfile, I comment a workaround for this issue:
Fix: target has transitive dependencies that include statically linked binaries:
--- Issue 3: ---
You can see in my Podfile, I comment a workaround for this issue:
post_install do |installer|
installer.pods_project.targets.each do |target|
#
# Cannot build with rnfirebase@6
# https://github.com/invertase/react-native-firebase/issues/3024
#
if ['RNFBApp', 'RNFBMessaging' ].include?(target.name)
target.add_system_framework(installer.pods_project.targets.find{|target| target.name == 'GoogleUtilities'})
elsif ['RNFBAnalytics', 'RNFBAuth'].include?(target.name)
target.add_system_framework(installer.pods_project.targets.find{|target| target.name == 'FirebaseAnalytics'})
target.add_system_framework(installer.pods_project.targets.find{|target| target.name == 'GoogleAppMeasurement'})
target.add_system_framework(installer.pods_project.targets.find{|target| target.name == 'nanopb'})
target.add_system_framework(installer.pods_project.targets.find{|target| target.name == 'GoogleUtilities'})
end
end
end
--- Issue 4: ---
Here my xCode log content:
https://github.com/Pushdy/react-native-pushdy-example/blob/eb7be26a3667eadf5bf211b6529cea4c48528f25/tmp-xcode.log
I think this is abnormal:
objc[7519]: Class FIRAnalytics is implemented in both /private/var/containers/Bundle/Application/9F4CBCCE-4A81-4E61-880B-537C69A894A3/reactNativePushdyExample.app/Frameworks/RNFBAnalytics.framework/RNFBAnalytics (0x1057a1200) and /var/containers/Bundle/Application/9F4CBCCE-4A81-4E61-880B-537C69A894A3/reactNativePushdyExample.app/reactNativePushdyExample (0x104d74a68). One of the two will be used. Which one is undefined.
--- Issue 5: ---
Do logEvent every 15 seconds
analytics().logEvent(eventName, data)
No analytics event was sent to Firebase dashboard or DebugView.
Got the error in the xCode log:
2020-02-28 17:31:01.776100+0700 reactNativePushdyExample[7519:1446198] -[APMConditionalUserPropertyController processEventOnWorkerQueue:]: unrecognized selector sent to instance 0x281205050
2020-02-28 17:31:01.777073+0700 reactNativePushdyExample[7519:1446198] 6.13.0 - [Firebase/Analytics][I-ACS030000] Exception on worker queue. Block ID=APMMeasurement:2366. Exception: -[APMMeasurement handleEventOnWorkerQueue:]: -[APMConditionalUserPropertyController processEventOnWorkerQueue:]: unrecognized selector sent to instance 0x281205050
2020-02-28 17:31:02.340375+0700 reactNativePushdyExample[7519:1446198] 6.13.0 - <AppMeasurement>[I-ACS031006] View controller already tracked. Class, ID: UIViewController, 4923640344883370886
2020-02-28 17:31:02.341178+0700 reactNativePushdyExample[7519:1446198] 6.13.0 - [Firebase/Analytics][I-ACS031006] View controller already tracked. Class, ID: UIViewController, 4923640344883370886
2020-02-28 17:31:04.662443+0700 reactNativePushdyExample[7519:1446208] -[APMConditionalUserPropertyController processEventOnWorkerQueue:]: unrecognized selector sent to instance 0x281205050
2020-02-28 17:31:04.665641+0700 reactNativePushdyExample[7519:1446482] 6.13.0 - [Firebase/Analytics][I-ACS030000] Exception on worker queue. Block ID=APMMeasurement:2366. Exception: -[APMMeasurement handleEventOnWorkerQueue:]: -[APMConditionalUserPropertyController processEventOnWorkerQueue:]: unrecognized selector sent to instance 0x281205050
Sorry for combine issues into this one, let me know if you want me to split the issue.
I've uploaded my minimal test project here: TEST_PROJECT
Please use that branch.
The reproduction step in this commit: TEST_PROJECT_COMMIT
Click To Expand
#### `package.json`:
Please see in the git repo
#### `firebase.json` for react-native-firebase v6:
Please see in the git repo
### iOS
#### `ios/Podfile`: - [ ] I'm not using Pods - [x] I'm using Pods and my Podfile looks like:
Please see in the git repo
#### `AppDelegate.m`:
Please see in the git repo
Click To Expand
#### Have you converted to AndroidX? - [ ] my application is an AndroidX application? - [ ] I am using `android/gradle.settings` `jetifier=true` for Android compatibility? - [ ] I am using the NPM package `jetifier` for react-native compatibility? #### `android/build.gradle`:
// N/A
#### `android/app/build.gradle`:
// N/A
#### `android/settings.gradle`:
// N/A
#### `MainApplication.java`:
// N/A
#### `AndroidManifest.xml`:
<!-- N/A -->
Click To Expand
**`react-native info` output:**
System:
OS: macOS Mojave 10.14.4
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz
Memory: 33.72 MB / 8.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 12.6.0 - ~/.nvm/versions/node/v12.6.0/bin/node
Yarn: 1.10.1 - /usr/local/bin/yarn
npm: 6.9.0 - ~/.nvm/versions/node/v12.6.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK:
API Levels: 23, 25, 26, 28, 29
Build Tools: 28.0.3, 29.0.2
System Images: android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom_64
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5791312
Xcode: 11.3/11C29 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5
npmGlobalPackages:
react-native-cli: 2.0.1
react-native-pushdy: 0.0.11
- **Platform that you're experiencing the issue on**:
- [ ] iOS
- [ ] Android
- [ ] **iOS** but have not tested behavior on Android
- [ ] **Android** but have not tested behavior on iOS
- [ ] Both
- **`react-native-firebase` version you're using that has this issue:**
- `e.g. 5.4.3`
- **`Firebase` module(s) you're using that has the issue:**
- `e.g. Instance ID`
- **Are you using `TypeScript`?**
- `Y/N` & `VERSION`
Think react-native-firebase
is great? Please consider supporting all of the project maintainers and contributors by donating via our Open Collective where all contributors can submit expenses. [Learn More]
React Native Firebase
and Invertase
on Twitter for updates on the library.iOS is on SDK 6.18.0 - if you want to troubleshoot a bunch of issues I'd recommend getting up-to-the-moment current such that fixes will actually be valid vs troubleshooting old code - everything else looked fairly up to date, so this should be a small change and likely not fix anything, but it gets you set up better to troubleshoot. You can specify versions like so https://github.com/mikehardy/rnfbdemo/blob/master/make-demo-v6.sh#L31
I figured out that if you use framework! You'll get the issue 3 above.
If you fix the issue 3 by my workaround, you'll get all the issue above 馃棥
You can try it on your demo project or on mine.
target 'rnfbdemo' do
use_frameworks!
...
end
#
# Fix: target has transitive dependencies that include statically linked binaries:
# (If you turn on use_frameworks!)
# Eg: Crashlytics.framework, Fabric.framework
#
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end
Indeed - I don't even attempt to do use_framework as it has been so buggy upstream (that is: in the basic react-native installations) that it did not seem worth the time. I'll open this to @Salakar and/or @Ehesp then - what do you guys think? Are guys of the opinion everything is stable enough in use_frameworks land to even attempt to start automatically verifying it and saying "yes it works" ? If so I can add that as a part of the demo script. It's definitely the source of a lot of problems.
Thank you guys,
As the docs mentioned, v5 started to support use_framework!
, we used it smoothly for a while.
https://rnfirebase.io/docs/v4.3.x/installation/ios#Option-2:-Cocoapods-(Not-Recommended)
https://rnfirebase.io/docs/v5.x.x/installation/ios#Option-2:-Cocoapods
We upgraded our codebase to [email protected] then we chose RNFirebase v6.
btw i'm not familiar with ios development so may I ask you a suggestion on:
I have a react-native-pushdy package written in Swift ==> Need use_framework!
Is there any other way to use the 3rd party libs written in Swift along with RNFirebase v6?
I'm googling + trying some other ways but your suggestion is valuable at this time!
I'll open this to @Salakar and/or @Ehesp then - what do you guys think? Are guys of the opinion everything is stable enough in use_frameworks land to even attempt to start automatically verifying it and saying "yes it works" ? If so I can add that as a part of the demo script. It's definitely the source of a lot of problems.
We built v6 with support for it, we only disabled it last minute because of RN breaking it. To reenable support you just need to set this line to true in every podspec; e.g. for analytics;
https://github.com/invertase/react-native-firebase/blob/master/packages/analytics/RNFBAnalytics.podspec#L28
So you could patch-package this locally for the time being. I'm not sure in which RN version frameworks support was fixed, was it 61? We'd have to note whichever version it was as that'd be the new minimum RN version we'd support.
We built v6 with support for it, we only disabled it last minute because of RN breaking it. To reenable support you just need to set this line to true in every podspec; e.g. for analytics;
I confirm that s.static_framework = true
worked, [email protected].
Data was appeared at Firebase Console > Analytics > DebugView.
I'm integrating admob, messaging, auth, hope it work!
Perhaps an interim step could be just to document it - I've noticed static frameworks people are very persistent in searching for documentation, they are trained to have build problems and solve them ;-) - just a page about some of the special iOS build issues, i.e. extensions, static frameworks, and the current workarounds?
I confirm that
s.static_framework = true
worked, [email protected].
FYI, a better way is modifying Podfile instead of local node_module modification:
pre_install do |installer|
#
# NOTE: This cause syntax error in pod >= v1.9
#
$static_frameworks = [
'RNPermissions',
'Permission-LocationWhenInUse',
'RNFBAdMob',
'RNFBAnalytics',
'RNFBApp',
'RNFBAuth',
'RNFBMessaging',
]
installer.pod_targets.each do |pod|
if $static_frameworks.include?(pod.name)
puts "Overriding the static_framework method for #{pod.name}"
def pod.build_type;
Pod::Target::BuildType.static_library
end
end
end
end
Hope it'll help someone else..
Hello 馃憢, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?
This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.
Thanks for all the info @luatnd - we'll make static framework = true the default for v7 (as we'll set the min supported version of RN to 0.61.x at the same time) but for the upcoming v6.4.0 release I've added a global flag that you can set in your podfile to enable all modules to use static_framework = true
, see commit: https://github.com/invertase/react-native-firebase/commit/96832939a3d0ee868074410236512177e5b79583
# Podfile...
# Allow using RNFirebase as static frameworks
$RNFirebaseAsStaticFramework = true
# ...
v6.4.0 has been released which now has a flag to toggle using RNFirebase as a static framework: https://rnfirebase.io/#allow-ios-static-frameworks
Thanks for all the info @luatnd - we'll make static framework = true the default for v7 (as we'll set the min supported version of RN to 0.61.x at the same time) but for the upcoming v6.4.0 release I've added a global flag that you can set in your podfile to enable all modules to use
static_framework = true
, see commit: 9683293# Podfile... # Allow using RNFirebase as static frameworks $RNFirebaseAsStaticFramework = true # ...
You saved my life! It is working like a charm! Thanks :)
Most helpful comment
Thanks for all the info @luatnd - we'll make static framework = true the default for v7 (as we'll set the min supported version of RN to 0.61.x at the same time) but for the upcoming v6.4.0 release I've added a global flag that you can set in your podfile to enable all modules to use
static_framework = true
, see commit: https://github.com/invertase/react-native-firebase/commit/96832939a3d0ee868074410236512177e5b79583