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

Error on pod install after the release of Braintree version 6.8.0 #1120

Closed
mlazari opened this issue Oct 26, 2023 · 5 comments
Closed

Error on pod install after the release of Braintree version 6.8.0 #1120

mlazari opened this issue Oct 26, 2023 · 5 comments

Comments

@mlazari
Copy link

mlazari commented Oct 26, 2023

Braintree SDK Version

6.8.0

Environment

Both

Xcode Version

15.0.1

OS Version & Device

No response

Integration type

CocoaPods

Development Processor

Apple Silicon (M-series chips)

Describe the bug

pod install in a React Native project with react-native-braintree-dropin-ui installed throws this error after the release of Braintree 6.8.0:

JSON::ParserError - Failed to parse JSON at file: '/Users/mihai/.cocoapods/repos/trunk/Specs/d/a/5/Braintree/6.8.0/Braintree.podspec.json'.

If I open that json file, it is empty.
I tried to clean pods cache an re-run pod install, but it didn't help:

rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "${HOME}/.cocoapods"
rm -rf Pods
pod install

It seems to be related to using CocoaPods CDN - source 'https://cdn.cocoapods.org/' line in ios/Podfile. If I change that to source 'https://github.com/CocoaPods/Specs.git' it takes a lot of time to install first time after clearing the cache, but works without errors.

I am using cocoapods 1.13.0, but tried it with 1.14.0 and it's the same.

To reproduce

  1. Create a React Native project:
npx react-native init BraintreeRepro
  1. Install react-native-braintree-dropin-ui:
npm i react-native-braintree-dropin-ui@1.1.7
  1. Add this line to the beginning of the ios/Podfile file in the React Native project:
source 'https://cdn.cocoapods.org/'
  1. Clear cocoapods related caches:
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "${HOME}/.cocoapods"
cd ios
rm -rf Pods
  1. Run pod install in the ios folder:
pod install
  1. See the error:
JSON::ParserError - Failed to parse JSON at file: '/Users/mihai/.cocoapods/repos/trunk/Specs/d/a/5/Braintree/6.8.0/Braintree.podspec.json'.

Expected behavior

pod install completes without errors.

Screenshots

No response

@jaxdesmarais
Copy link
Contributor

Hello @mlazari -

The SDK react-native-braintree-dropin-ui was not developed by Braintree. I would recommend reaching out to the developers of that SDK directly for further assistance on this error. That said there are also several issues related to this opened on the Cocoapods repository - I expect this issue ultimately lies with the Cocoapods CDN which our SDK does not own.

@mlazari
Copy link
Author

mlazari commented Oct 26, 2023

@jaxdesmarais The same thing is happening in a non React Native project that uses this pod directly:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

source 'https://cdn.cocoapods.org/'

target 'BraintreeTest' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for BraintreeTest

  pod 'Braintree', '6.8.0'

end

Even if an older version is requested, like pod 'Braintree', '5.20.1', the error is still triggered.

I opened this because I thought it might be related to the release of Braintree 6.8.0, like an error during its publication, making it be in a bad state or something. But I understand it might be related just to a issue with Cocoapods CDN and not with the publication process of this version.

In any case it doesn't seem to be related to react-native-braintree-dropin-ui, that was just a way to reproduce the error, since the project in which I encountered this error is a React Native one.

@jaxdesmarais
Copy link
Contributor

Hello @mlazari -

Thanks for reaching back out with those details. This does seem specific to the Cocoapods CDN as the following Podfile downloads the dependencies as expected for multiple versions of our SDK. I was just able to test this with multiple versions successfully in a local Cocoapods project:

platform :ios, '15.0'

target 'bt-ios-cocoapods-testing-demo' do
  pod 'Braintree', '6.8.0' // can replace with any version
end

@mlazari
Copy link
Author

mlazari commented Oct 26, 2023

@jaxdesmarais Got it, thank you!

@mlazari
Copy link
Author

mlazari commented Oct 26, 2023

I just found the same issue being reported here: CocoaPods/CocoaPods#12115 for a different dependency, so indeed doesn't seem related to Braintree. Thanks for looking into it.

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

No branches or pull requests

2 participants