RCN Fetch failure: cannot parse response
Description
11.11.0 - [FirebaseRemoteConfig][I-RCN000026] RCN Fetch failure: Error Domain=NSURLErrorDomain Code=-1017 "cannot parse response"
I have implemented Firebase Remote configuration in my project. It was working fine but, suddendly it was stop working in iPhone simulator. I got the below logs in my console.
11.11.0 - [FirebaseRemoteConfig][I-RCN000026] RCN Fetch failure: Error Domain=NSURLErrorDomain Code=-1017 "cannot parse response" UserInfo={_kCFStreamErrorCodeKey=-1, NSUnderlyingError=0x600000c8fcc0 {Error Domain=kCFErrorDomainCFNetwork Code=-1017 "(null)" UserInfo={NSErrorPeerAddressKey=<CFData 0x6000026356e0 [0x1e6ebb4f0]>{length = 28, capacity = 28, bytes = 0x1c1e01bb000000002404680040090827 ... 0000200a00000000}, _kCFStreamErrorCodeKey=-1, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <75FD4372-12F3-4F23-B6C0-49509335D1FC>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask <75FD4372-12F3-4F23-B6C0-49509335D1FC>.<1>" ), NSLocalizedDescription=cannot parse response, NSErrorFailingURLStringKey=https://firebaseremoteconfig.googleapis.com/v1/projects/[projname]-88a56/namespaces/firebase:fetch?key=AIzaSyBnHsFa3O_kKPZP9FubXVLpm40YeWb0r6E, NSErrorFailingURLKey=https://firebaseremoteconfig.googleapis.com/v1/projects/[projname]-88a56/namespaces/firebase:fetch?key=AIzaSyBnHsFa3O_kKPZP9FubXVLpm40YeWb0r6E, _kCFStreamErrorDomainKey=4}. No cached config result. 11.11.0 - [FirebaseRemoteConfig][I-RCN000026] RCN Fetch failure. Response http error code: 0
What I have tried
Try Different versions of simulators, Clear Simulator data, Try diffrent models of Simulator Checked my Internet connection, and it was good Working fine with real devices
Reproducing the issue
Integrate Firebase Remote config using SPM & run in iOS Simulator.
Firebase SDK Version
11.11.0
Xcode Version
16.3
Installation Method
Swift Package Manager
Firebase Product(s)
Remote Config
Targeted Platforms
iOS
Relevant Log Output
Task <AD459EB7-46E3-416F-B8DB-390046165497>.<2> finished with error [-1005] Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={_kCFStreamErrorCodeKey=-4, NSUnderlyingError=0x600000d0a880 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={NSErrorPeerAddressKey=<CFData 0x6000026821c0 [0x1139001d0]>{length = 28, capacity = 28, bytes = 0x1c1e01bb000000002404680040090822 ... 0000200a00000000}, _kCFStreamErrorCodeKey=-4, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <AD459EB7-46E3-416F-B8DB-390046165497>.<2>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <AD459EB7-46E3-416F-B8DB-390046165497>.<2>"
), NSLocalizedDescription=The network connection was lost., NSErrorFailingURLStringKey=https://firebaseremoteconfig.googleapis.com/v1/projects/[projname]-88a56/namespaces/firebase:fetch?key=AIzaSyBnHsFa3O_kKPZP9FubXVLpm40YeWb0r6E, NSErrorFailingURLKey=https://firebaseremoteconfig.googleapis.com/v1/projects/[projname]-88a56/namespaces/firebase:fetch?key=AIzaSyBnHsFa3O_kKPZP9FubXVLpm40YeWb0r6E, _kCFStreamErrorDomainKey=4}
Error: The network connection was lost.
Task <75FD4372-12F3-4F23-B6C0-49509335D1FC>.<1> finished with error [-1017] Error Domain=NSURLErrorDomain Code=-1017 "cannot parse response" UserInfo={_kCFStreamErrorCodeKey=-1, NSUnderlyingError=0x600000c8fcc0 {Error Domain=kCFErrorDomainCFNetwork Code=-1017 "(null)" UserInfo={NSErrorPeerAddressKey=<CFData 0x6000026356e0 [0x1e6ebb4f0]>{length = 28, capacity = 28, bytes = 0x1c1e01bb000000002404680040090827 ... 0000200a00000000}, _kCFStreamErrorCodeKey=-1, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <75FD4372-12F3-4F23-B6C0-49509335D1FC>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <75FD4372-12F3-4F23-B6C0-49509335D1FC>.<1>"
), NSLocalizedDescription=cannot parse response, NSErrorFailingURLStringKey=https://firebaseremoteconfig.googleapis.com/v1/projects/[projname]-88a56/namespaces/firebase:fetch?key=AIzaSyBnHsFa3O_kKPZP9FubXVLpm40YeWb0r6E, NSErrorFailingURLKey=https://firebaseremoteconfig.googleapis.com/v1/projects/[projname]-88a56/namespaces/firebase:fetch?key=AIzaSyBnHsFa3O_kKPZP9FubXVLpm40YeWb0r6E, _kCFStreamErrorDomainKey=4}
11.11.0 - [FirebaseRemoteConfig][I-RCN000026] RCN Fetch failure: Error Domain=NSURLErrorDomain Code=-1017 "cannot parse response" UserInfo={_kCFStreamErrorCodeKey=-1, NSUnderlyingError=0x600000c8fcc0 {Error Domain=kCFErrorDomainCFNetwork Code=-1017 "(null)" UserInfo={NSErrorPeerAddressKey=<CFData 0x6000026356e0 [0x1e6ebb4f0]>{length = 28, capacity = 28, bytes = 0x1c1e01bb000000002404680040090827 ... 0000200a00000000}, _kCFStreamErrorCodeKey=-1, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <75FD4372-12F3-4F23-B6C0-49509335D1FC>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDataTask <75FD4372-12F3-4F23-B6C0-49509335D1FC>.<1>"
), NSLocalizedDescription=cannot parse response, NSErrorFailingURLStringKey=https://firebaseremoteconfig.googleapis.com/v1/projects/[projname]-88a56/namespaces/firebase:fetch?key=AIzaSyBnHsFa3O_kKPZP9FubXVLpm40YeWb0r6E, NSErrorFailingURLKey=https://firebaseremoteconfig.googleapis.com/v1/projects/[projname]-88a56/namespaces/firebase:fetch?key=AIzaSyBnHsFa3O_kKPZP9FubXVLpm40YeWb0r6E, _kCFStreamErrorDomainKey=4}. No cached config result.
11.11.0 - [FirebaseRemoteConfig][I-RCN000026] RCN Fetch failure. Response http error code: 0
Error: cannot parse response
If using Swift Package Manager, the project's Package.resolved
Expand Package.resolved snippet
{
"originHash" : "e7561c390f5dfd0c8942ab0674aaefe25f4f8b40e29a8ed50fb30accbd6c6e9d",
"pins" : [
{
"identity" : "abseil-cpp-binary",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/abseil-cpp-binary.git",
"state" : {
"revision" : "bbe8b69694d7873315fd3a4ad41efe043e1c07c5",
"version" : "1.2024072200.0"
}
},
{
"identity" : "alamofire",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Alamofire/Alamofire.git",
"state" : {
"revision" : "513364f870f6bfc468f9d2ff0a95caccc10044c5",
"version" : "5.10.2"
}
},
{
"identity" : "app-check",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/app-check.git",
"state" : {
"revision" : "61b85103a1aeed8218f17c794687781505fbbef5",
"version" : "11.2.0"
}
},
{
"identity" : "charts",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ChartsOrg/Charts",
"state" : {
"revision" : "dd9c72e3d7e751e769971092a6bd72d39198ae63",
"version" : "5.1.0"
}
},
{
"identity" : "firebase-ios-sdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/firebase-ios-sdk.git",
"state" : {
"revision" : "d1f7c7e8eaa74d7e44467184dc5f592268247d33",
"version" : "11.11.0"
}
},
{
"identity" : "googleappmeasurement",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleAppMeasurement.git",
"state" : {
"revision" : "dd89fc79a77183830742a16866d87e4e54785734",
"version" : "11.11.0"
}
},
{
"identity" : "googledatatransport",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleDataTransport.git",
"state" : {
"revision" : "617af071af9aa1d6a091d59a202910ac482128f9",
"version" : "10.1.0"
}
},
{
"identity" : "googleutilities",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleUtilities.git",
"state" : {
"revision" : "53156c7ec267db846e6b64c9f4c4e31ba4cf75eb",
"version" : "8.0.2"
}
},
{
"identity" : "grpc-binary",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/grpc-binary.git",
"state" : {
"revision" : "cc0001a0cf963aa40501d9c2b181e7fc9fd8ec71",
"version" : "1.69.0"
}
},
{
"identity" : "gtm-session-fetcher",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/gtm-session-fetcher.git",
"state" : {
"revision" : "a2ab612cb980066ee56d90d60d8462992c07f24b",
"version" : "3.5.0"
}
},
{
"identity" : "hero",
"kind" : "remoteSourceControl",
"location" : "https://github.com/HeroTransitions/Hero",
"state" : {
"revision" : "670b81ed3d95f7183bbc009d0ec67c71506557b5",
"version" : "1.6.4"
}
},
{
"identity" : "interop-ios-for-google-sdks",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/interop-ios-for-google-sdks.git",
"state" : {
"revision" : "040d087ac2267d2ddd4cca36c757d1c6a05fdbfe",
"version" : "101.0.0"
}
},
{
"identity" : "ios-branch-sdk-spm",
"kind" : "remoteSourceControl",
"location" : "https://github.com/BranchMetrics/ios-branch-sdk-spm",
"state" : {
"revision" : "e3b2b380f483ab16e072ad329c6e2c019a2e88c5",
"version" : "3.10.0"
}
},
{
"identity" : "ios-places-sdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/googlemaps/ios-places-sdk.git",
"state" : {
"revision" : "2a9c7305a0e5f83b9acdccfc74eb545ffeb476c3",
"version" : "8.5.0"
}
},
{
"identity" : "iqkeyboardcore",
"kind" : "remoteSourceControl",
"location" : "https://github.com/hackiftekhar/IQKeyboardCore.git",
"state" : {
"revision" : "ae9d197f1d8c491b312e30eafb0193d164519c5a",
"version" : "1.0.7"
}
},
{
"identity" : "iqkeyboardmanager",
"kind" : "remoteSourceControl",
"location" : "https://github.com/hackiftekhar/IQKeyboardManager",
"state" : {
"revision" : "3989683f60dfc33df6063f9a8d0fabb50a910e9d",
"version" : "7.2.0"
}
},
{
"identity" : "iqkeyboardnotification",
"kind" : "remoteSourceControl",
"location" : "https://github.com/hackiftekhar/IQKeyboardNotification.git",
"state" : {
"revision" : "25c6a83380042141d9a2f80cdb2832595a7bf6bc",
"version" : "1.0.5"
}
},
{
"identity" : "iqtextinputviewnotification",
"kind" : "remoteSourceControl",
"location" : "https://github.com/hackiftekhar/IQTextInputViewNotification.git",
"state" : {
"revision" : "4347f8eb6bf8880014606684105e447229cc29ea",
"version" : "1.0.8"
}
},
{
"identity" : "leveldb",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/leveldb.git",
"state" : {
"revision" : "a0bc79961d7be727d258d33d5a6b2f1023270ba1",
"version" : "1.22.5"
}
},
{
"identity" : "lottie-ios",
"kind" : "remoteSourceControl",
"location" : "https://github.com/airbnb/lottie-ios.git",
"state" : {
"revision" : "047aa81b77adcbf583a966dfef620d17650cc656",
"version" : "4.5.1"
}
},
{
"identity" : "mantis",
"kind" : "remoteSourceControl",
"location" : "https://github.com/guoyingtao/Mantis.git",
"state" : {
"branch" : "master",
"revision" : "f60cde72f2183fe1b2cf6e3c439e9dfa05a218ed"
}
},
{
"identity" : "marqueelabel",
"kind" : "remoteSourceControl",
"location" : "https://github.com/cbpowell/MarqueeLabel",
"state" : {
"revision" : "877e810534cda9afabb8143ae319b7c3341b121b",
"version" : "4.5.0"
}
},
{
"identity" : "moya",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Moya/Moya.git",
"state" : {
"revision" : "c263811c1f3dbf002be9bd83107f7cdc38992b26",
"version" : "15.0.3"
}
},
{
"identity" : "nanopb",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/nanopb.git",
"state" : {
"revision" : "b7e1104502eca3a213b46303391ca4d3bc8ddec1",
"version" : "2.30910.0"
}
},
{
"identity" : "phonenumberkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/marmelroy/PhoneNumberKit.git",
"state" : {
"revision" : "c107075aa8d394be7aced273a46e944afe8b321b",
"version" : "3.8.0"
}
},
{
"identity" : "promises",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/promises.git",
"state" : {
"revision" : "540318ecedd63d883069ae7f1ed811a2df00b6ac",
"version" : "2.4.0"
}
},
{
"identity" : "reactiveswift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ReactiveCocoa/ReactiveSwift.git",
"state" : {
"revision" : "c43bae3dac73fdd3cb906bd5a1914686ca71ed3c",
"version" : "6.7.0"
}
},
{
"identity" : "reusable",
"kind" : "remoteSourceControl",
"location" : "https://github.com/AliSoftware/Reusable.git",
"state" : {
"revision" : "18674709421360e210c2ecd4e8e08b217d4ea61d",
"version" : "4.1.2"
}
},
{
"identity" : "rxswift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ReactiveX/RxSwift.git",
"state" : {
"revision" : "5dd1907d64f0d36f158f61a466bab75067224893",
"version" : "6.9.0"
}
},
{
"identity" : "sdwebimage",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SDWebImage/SDWebImage.git",
"state" : {
"revision" : "cac9a55a3ae92478a2c95042dcc8d9695d2129ca",
"version" : "5.21.0"
}
},
{
"identity" : "sentry-cocoa",
"kind" : "remoteSourceControl",
"location" : "https://github.com/getsentry/sentry-cocoa/",
"state" : {
"revision" : "2c6c1b81d9f6e6178064b4e9b457abe1c118bcda",
"version" : "8.49.0"
}
},
{
"identity" : "swift-protobuf",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-protobuf.git",
"state" : {
"revision" : "d72aed98f8253ec1aa9ea1141e28150f408cf17f",
"version" : "1.29.0"
}
},
{
"identity" : "toast-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/BastiaanJansen/toast-swift",
"state" : {
"revision" : "b8f0de845abca47eee747b6e671f1141ec4dcf3e",
"version" : "2.1.3"
}
}
],
"version" : 3
}
If using CocoaPods, the project's Podfile.lock
Expand Podfile.lock snippet
Replace this line with the contents of your Podfile.lock!
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
Hi @komal-lathiya, I tried to reproduce but I'm unable to get the same issue. Have you tried connecting to different network?
We are seeing some similar issues this is happening in production on iOS only. Android seems fine. This is potentially a critical issue?
It's possible that this is related to a bug in the iOS 18.4 simulator. Does it help to use an older simulator? See https://github.com/firebase/firebase-ios-sdk/issues/14677#issuecomment-2789014541
This is a critical issue. I have tried different networks and different versions of simulators, and I have also tried erasing all data from the simulator, but nothing works.
We’re encountering the same issue on iOS devices, but it does not occur on simulators running iOS versions earlier than 18.4.
FYI I do not think this is secluded to just simulators. However to reproduce open a different iPhone simulator type each run, it will trigger it more often than not on 18.4 simulators
This happens to me in 18.4 sims but not 18.2 sims.
Firebase: 11.11.0 Xcode: 16.3
@paulb777 is there a chance you can assign it to @tusharkhandelwal8 as he is looking into this. Somehow every comment on this thread is reassigning our internal bug to me.
Hi, we are able to reproduce this issue on the iOS 18.4 Simulator. It's a known issue, as discussed here: https://developer.apple.com/forums/thread/777999. We are raising a fix for this. However, we couldn't reproduce this issue on other simulators and devices. Could you please share which other simulator versions you have tried? Also, are you getting the exact same logs? If the logs are different, could you please share them as well?
Hi @tusharkhandelwal8 , You can consider iOS 18.4 Simulators for now.
The fix was merged from #14768 and will release as part of 11.13.0 planned for the week of May 15th
I am currently having this issue on any 18.4 simulator with Firebase 11.11.0 and 11.13.0. Although it was working for half of the day yesterday, it has been a constant issue since on 18.4. It does work fine on an 18.2 simulator.
What concerns me is that @paulb777 says the fix was merged for 11.13.0 yet it makes no difference. Would love to find how to solve this issue.
Same this issue is still happening in 11.13.0 with 18.4 simulator.
11.13.0 - [FirebaseAnalytics][I-ACS023128] Network request failed to fetch remote config. Code, Error: 0, Error Domain=NSURLErrorDomain Code=-1017 "cannot parse response" UserInfo={_kCFStreamErrorCodeKey=-1, NSUnderlyingError=0x600000ed73f0 {Error Domain=kCFErrorDomainCFNetwork Code=-1017 "(null)" UserInfo={NSErrorPeerAddressKey=<CFData 0x6000023001e0 [0x1e6ebb4f0]>{length = 16, capacity = 16, bytes = 0x100201bb8efb290e0000000000000000}, _kCFStreamErrorCodeKey=-1, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <71531BA5-0F24-4FCE-BAA1-00B9459E7850>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDownloadTask <71531BA5-0F24-4FCE-BAA1-00B9459E7850>.<1>" ), NSLocalizedDescription=cannot parse response...
same issue
iOS - 18.4 "@react-native-firebase/remote-config": "^22.2.0"
[LOG] 1747989306: Remote Config fetchAndActivate NativeFirebaseError: [remoteConfig/unknown] cannot parse response
@paulb777 should we reopen this, given all the reports that the bug is still happening?
Hi, I've attempted to reproduce this issue on the 18.4 simulator, but haven't been able to. Could you please clarify if this crash occurs consistently or only intermittently? Additionally, does it seem to be specific to a particular iOS device or version within the 18.4 simulator?
I saw people saying that the fix didn't work for the flutter plugin https://github.com/firebase/flutterfire/issues/17349
Apple did call out a very similar sounding fix in the Xcode 16.4 RC release notes.
Simulator
Resolved Issues
Fixed: NSURLSession was always timing out and failing in iOS 18.3 simulator runtimes. (147849952) (FB17006003)
Haven't pulled it down but maybe will address non-Flutter scenarios?
Update: although I do get an error in addOnConfigUpdateListener when I first launch, I'm now getting a successful fetch on FIRRemoteConfig.fetch() after updating Xcode and Firebase.
I'm still getting this problem with Xcode 16.4, Firebase 11.13.0 on an iOS 18.4 simulator. This is the error I'm getting from the block set for addOnConfigUpdateListener():
Error Domain=com.google.remoteconfig.update.ErrorDomain Code=8001 "Unable to connect to the server. Check your connection and try again." UserInfo={NSLocalizedDescription=Unable to connect to the server. Check your connection and try again.}
Not sure if it's related, but I also get the following Crashlytics error message:
Task <B7FC79C8-B1DA-4133-80E3-28A486DE7E71>.<1> finished with error [-1017] Error Domain=NSURLErrorDomain Code=-1017 "cannot parse response" UserInfo={_kCFStreamErrorCodeKey=-1, NSUnderlyingError=0x600000c80690 {Error Domain=kCFErrorDomainCFNetwork Code=-1017 "(null)" UserInfo={NSErrorPeerAddressKey=<CFData 0x600002140190 [0x1e6ebb4f0]>{length = 16, capacity = 16, bytes = 0x100201bb8efa4aa30000000000000000}, _kCFStreamErrorCodeKey=-1, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <B7FC79C8-B1DA-4133-80E3-28A486DE7E71>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(
"LocalDownloadTask <B7FC79C8-B1DA-4133-80E3-28A486DE7E71>.<1>"
), NSLocalizedDescription=cannot parse response, NSErrorFailingURLStringKey=https://firebase-settings.crashlytics.com/spi/v2/platforms/ios/gmp/1:1035930775354:ios:f62e2d2ec7c97176022a03/settings?build_version=4&display_version=2.48.1&instance=60c32b72ef62994b01f87f61d7742348fa8ab121&source=1, NSErrorFailingURLKey=https://firebase-settings.crashlytics.com/spi/v2/platforms/ios/gmp/1:1035930775354:ios:f62e2d2ec7c97176022a03/settings?build_version=4&display_version=2.48.1&instance=60c32b72ef62994b01f87f61d7742348fa8ab121&source=1, _kCFStreamErrorDomainKey=4}
Hey @komal-lathiya. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Since there haven't been any recent updates here, I am going to close this issue.
@komal-lathiya if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.