After running pod outdated, I get the following output
Updating spec repo `master`
Analyzing dependencies
The following pod updates are available:
- AFNetworking 2.4.4 -> 2.5.4 (latest version 3.0.0-beta.2)
- HexColors 2.2.1 -> 2.2.1 (latest version 3.0.0)
- Overcoat 3.0.0 -> (unused) (latest version 3.2.1)
- ReactiveCocoa 2.5 -> 2.5 (latest version 4.0.4-alpha-4)
I have not seen this "unused" term before
i.e.
Overcoat 3.0.0 ->(unused) (latest version 3.2.1)
What is this? And what does it mean?
After analyzing the source code, I think that (unused) means that the Pod is not in your Podfile (probably you removed it and didn't reinstall)
AFNetworking 2.4.4 -> 2.5.4 (latest version 3.0.0-beta.2)
^ ^ ^ ^
Pod name Installed version Podfile version Latest
Based on the source code which inserts this tag, which looks like this:
if source_version > lockfile_version
matching_spec = unlocked_pods.find { |s| s.name == pod_name }
matching_version =
matching_spec ? matching_spec.version : '(unused)'
[pod_name, lockfile_version, matching_version, source_version]
end
It appears that this simply means that CocoaPods could not find that Pod within your 'unlocked pods'.
I don't speak Ruby well enough to determine exactly what an "unlocked" pod is (nor am I familiar enough with CocoaPods to have heard the term necessarily... but I am aware of a 'lockfile', and maybe this is related), but here is the source code for determining that:
def unlocked_pods
#unlocked_pods ||= begin
pods = []
UI.titled_section('Analyzing dependencies') do
pods = Installer::Analyzer.new(config.sandbox, config.podfile).
analyze(false).
specs_by_target.values.flatten.uniq
end
pods
end
end
Related
I am trying to build iOS app (simulator) from expo managed project. The build fails At Pod installation step.
In Expo SDK 44 everything is okay. But when I upgrade to SDK 45 or even 46, I am facing the issue.
Here are some logs from expo server:
Run Expo Doctor
Running "expo doctor"
- Finding all copies of expo-modules-autolinking
- Finding all copies of #expo/config-plugins
[stderr]
[02:48:23] Expected package #expo/config-plugins#^5.0.0
[stderr]
[02:48:23] Found invalid:
[stderr]
[02:48:23] #expo/config-plugins#4.1.5
[stderr]
[02:48:23] (for more info, run: npm why #expo/config-plugins)
- Finding all copies of #expo/prebuild-config
- Finding all copies of #unimodules/core
- Finding all copies of #unimodules/react-native-adapter
- Finding all copies of react-native-unimodules
[stderr]
[02:48:28] Some dependencies are incompatible with the installed expo package version:
[stderr]
[02:48:28] - react - expected version: 18.0.0 - actual version installed: 17.0.2
[stderr]
[02:48:28] - react-dom - expected version: 18.0.0 - actual version installed: 17.0.2
[stderr]
[02:48:28] - react-native - expected version: 0.69.4 - actual version installed: 0.68.2
[stderr]
[02:48:28] Your project may not work correctly until you install the correct versions of the packages.
[stderr]
To install the correct versions of these packages, please run: expo doctor --fix-dependencies,
[stderr]
or install individual packages by running expo install [package-name ...]
[stderr]
[02:48:31] Warning: Invalid version react-native#0.68.2 for expo sdkVersion 46.0.0. Use react-native#0.69.4
Command "expo doctor" failed.
bash exited with non-zero code: 1
Install Pods
Installing pods
Using Expo modules
Auto-generating `.xcode.env.local` with $NODE_BINARY=/Users/expo/.nvm/versions/node/v16.13.2/bin/node
Auto-linking React Native modules for target `Classima`: RNDateTimePicker, RNGestureHandler, RNReanimated, RNSVG, RNScreens, lottie-react-native, react-native-maps, react-native-netinfo, react-native-safe-area-context, react-native-slider, react-native-webview, and stripe-react-native
[Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
[Codegen] Found FBReactNativeSpec
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `boost` from `../node_modules/react-native/third-party-podspecs/boost.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Adding spec repo `trunk` with CDN `https://cdn.cocoapods.org/`
[!] CocoaPods could not find compatible versions for pod "RCT-Folly":
In snapshot (Podfile.lock):
RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
In Podfile:
RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
It seems like you've changed the version of the dependency `RCT-Folly` and it differs from the version stored in `Pods/Local Podspecs`.
You should run `pod update RCT-Folly --no-repo-update` to apply changes made locally.
Error: Compatible versions of some pods could not be resolved.
You are seeing this error because either:
- Versions in the Podfile.lock cached by EAS do not match required values for some of the libraries, it can be triggered when upgrading Expo SDK or any other library with native code. To fix that add the "cache.key" field (it can be set to any value) in the build profile in eas.json to invalidate the cache.
- Some of your npm packages have native code that depend on different versions of the same pod. Please see logs for more info.
Fail Build
Build failed: Compatible versions of some pods could not be resolved.
You are seeing this error because either:
- Versions in the Podfile.lock cached by EAS do not match required values for some of the libraries, it can be triggered when upgrading Expo SDK or any other library with native code. To fix that add the "cache.key" field (it can be set to any value) in the build profile in eas.json to invalidate the cache.
- Some of your npm packages have native code that depend on different versions of the same pod. Please see logs for more info.
eas build -p ios --clear-cache
I am facing the same issue, i tried "eas build -p ios --clear-cache" but nothing changed. The build fails at the pod install
Here are the logs:
Adding a custom script phase for Pod RNFBApp: [RNFB] Core Configuration
Auto-linking React Native modules for target `BallNConnect`: RNCAsyncStorage, RNCMaskedView, RNDateTimePicker, RNDeviceInfo, RNFBApp, RNFBFirestore, RNGestureHandler, RNReanimated, RNScreens, RNVectorIcons, lottie-ios, lottie-react-native, react-native-maps, and react-native-safe-area-context
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Adding spec repo `trunk` with CDN `https://cdn.cocoapods.org/`
CocoaPods 1.11.3 is available.
To update use: `sudo gem install cocoapods`
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.11.3
[!] CocoaPods could not find compatible versions for pod "GoogleMaps":
In Podfile:
react-native-google-maps (from `/Users/expo/workingdir/build/node_modules/react-native-maps`) was resolved to 0.29.4, which depends on
Google-Maps-iOS-Utils (= 2.1.0) was resolved to 2.1.0, which depends on
GoogleMaps
react-native-google-maps (from `/Users/expo/workingdir/build/node_modules/react-native-maps`) was resolved to 0.29.4, which depends on
GoogleMaps (= 3.5.0)
CocoaPods could not find compatible versions for pod "nanopb":
In Podfile:
EXFirebaseCore (from `../node_modules/expo-firebase-core/ios`) was resolved to 4.1.1, which depends on
Firebase/Core (= 7.7.0) was resolved to 7.7.0, which depends on
FirebaseAnalytics (= 7.7.0) was resolved to 7.7.0, which depends on
nanopb (~> 2.30907.0)
RNFBFirestore (from `../node_modules/#react-native-firebase/firestore`) was resolved to 12.9.3, which depends on
Firebase/Firestore (= 8.8.0) was resolved to 8.8.0, which depends on
FirebaseFirestore (~> 8.8.0) was resolved to 8.8.0, which depends on
nanopb (~> 2.30908.0)
[stderr] [!] `<PBXResourcesBuildPhase UUID=`13B07F8E1A680F5B00A75B9A`>` attempted to initialize an object with an unknown UUID. `6D6F16C9EE89401295D6CEB6` for attribute: `files`. This can be the result of a merge and the unknown UUID is being discarded.
Error: Compatible versions of some pods could not be resolved.
You are seeing this error because either:
- Versions in the Podfile.lock cached by EAS do not match required values in Podspecs of some of the libraries. To fix that add the "cache.key" field (it can be set to any value) in the build profile in eas.json to invalidate the cache.
- Some of the pods used in your project depend on different versions of the same pod. See logs for more information.```
I was getting this error when running pod install for RNCPicker of version 1.6.0 with React Native 0.59
Analyzing dependencies
[!] Unable to find a specification for `React-Core` depended upon by `RNCPicker`
You have either:
* out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
* mistyped the name or version.
* not added the source repo that hosts the Podspec to your Podfile.
In my case I have to use these specific versions.
How do I get rid of this error?
React-Core is outdated and has been renamed to React
I have added the following lines to the bottom of my Podfile under ios.
def change_lines_in_file(file_path, &change)
print "Fixing #{file_path}...\n"
contents = []
file = File.open(file_path, 'r')
file.each_line do | line |
contents << line
end
file.close
File.open(file_path, 'w') do |f|
f.puts(change.call(contents))
end
end
change_lines_in_file('../node_modules/#react-native-community/picker/RNCPicker.podspec') do |lines|
lines.map { |line| line.include?("s.dependency 'React-Core'") ? "s.dependency 'React'" : line}
end
In this way, everytime when I am trying to run pod install, it finds my outdated RNCPicker and replace the React-Core dependency name to React
Im trying to upload the new version of my pod to cocoapods spec repo. The current live version is 0.3.1 and it is a framework build with swift 4.2. Now i updated the library and build with Xcode 11.1 (swift 5). But while linting the podspec file, im getting an unknown DSL error in the terminal.
I have tried with changing the name of podspec and with same framework. but no use. anyone please help
pod spec lint AsistaCore.podspec --verbose
Podspec file
Pod::Spec.new do |spec|
spec.name = 'AsistaCore'
spec.version = '1.0.0'
spec.summary = 'Official Asista SDK in Swift to access Asista Platform core feature'
spec.description = <<-DESC
The Asista SDK in Swift Core framework provides:
* Create new tickets
* Update Ticket State
* Add comments to ticket
* Asset list
* Update profile
* Knowledge Base Articles
DESC
spec.homepage = 'https://asista.com/developer'
spec.license = { :type => 'MIT', :file => 'LICENSE' }
spec.authors = { 'Cherrylabs' => 'vaisakh.kp#cherrylabs.com' }
spec.documentation_url = 'https://asista.com/developer/docs/asista-sdk-for-ios'
spec.platform = :ios
spec.source = { :git => 'https://github.com/cherrylabstech/asista-sdk-ios.git', :tag => spec.version }
spec.swift_version = '5.0'
spec.ios.deployment_target = '8.0'
spec.static_framework = true
spec.ios.vendored_frameworks = 'AsistaSupport/AsistaCore.framework'
end
-> AsistaCore (1.0.0)
- ERROR | [iOS] unknown: Encountered an unknown error (Pod::DSLError
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.8.4/lib/cocoapods-core/specification.rb:808:in `rescue in _eval_podspec'
....
...
We ran into this issue when we try creating a release and publishing a library. This error occurs when you are trying to run pod spec lint or pod repo push. The error says "DSLError" and doesn't give much information on what is causing it. I found little help online and some places they say, there could be a syntax error in the podspec file. We didn't have any in our podspec. However, this answer from stackoverflow gave me some direction https://stackoverflow.com/a/64779582
It looks like while making a release for one SDK/library, the pod spec lint and pod repo push validates all the podspecs in the folder besides the ones you ran. I don't know how that works internally. You should look for the following scenarios to identify the issue:
If there are other podspecs for capabilities that have different tags(Example: ABC.podspec pointed to source tag 1.0.0-ABC and XYZ.podspec pointed to source tag 2.0.0-XYZ)
Multiple podspecs have dependencies on different versions of the same module(Example: Module1.podspec depends on Module 5 version 10.0.0 and Module2.podspec also depends on Module 5 but on the version 11.0.0).
Syntax errors in any of the podspecs
If you come across either or both 1 & 2, it could be a potential cause for the DSLError.
When you run into this issue, make sure you look for and update the following:
All podspecs to have pointed to one source tag
All dependencies on a module pointed to one version of it in each capability.
Fix the sytanx errors.
This issue will go away or reduce significantly when the SDK libraries can be separated into their repositories instead of all in one repository, or perhaps even by keeping each podspec in their own individual folder.
I'm trying to create an iOS project that includes C code that is shared across other platforms (Android). Some of the third party libraries I'm compiling rely on having certain directories included as search paths. However, no matter what I've tried, I've been unable to the CocoaPods .podspec file to include a given directory in the compilation search path. I'm using CocoaPods 1.8.4.
Whilst this is a Flutter plugin, it's my understanding that this is an issue with CocoaPods/Xcode, since Flutter has merely set up the project files. However, it's worth noting that Flutter sets up an example workspace, which I do not want to modify. I want the Plugin itself to be modified to compile in the requisite code, not the example workspace/project. In other words, I want only the ios/repro_cocoapods_issue.podspec file to be modified.
In case it matters, I used the following Flutter command to create the project:
flutter create -t plugin -i objc -a java repro_cocoapods_issue
I have a full repro up on GitHub here. To reproduce, open the workspace at example/ios/Runner.xcworkspace in Xcode and try to build.
These are the things I've tried in the ios/repro_cocoapods_issue.podspec file:
s.xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PROJECT_DIR}/external/"'}
s.xcconfig = { 'USER_HEADER_SEARCH_PATHS' => '"${PROJECT_DIR}/external/"'}
s.user_target_xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PROJECT_DIR}/external/"'}
s.user_target_xcconfig = { 'USER_HEADER_SEARCH_PATHS' => '"${PROJECT_DIR}/external/"'}
s.pod_target_xcconfig = { 'HEADER_SEARCH_PATHS' => '"${PROJECT_DIR}/external/"'}
s.pod_target_xcconfig = { 'USER_HEADER_SEARCH_PATHS' => '"${PROJECT_DIR}/external/"'}
s.compiler_flags = '-Iexternal/'
s.preserve_paths = 'external/**'
s.preserve_paths = '${PROJECT_DIR}/external/**'
In all cases, I get:
'external_dir.c' file not found
If I change the code to #include ../external/external_dir.c then it works, but this does not help with my actual use case.
How can I configure my podspec so that a specified directory is included in the search path during compilation?
Output of pod env
Stack
CocoaPods : 1.8.4
Ruby : ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
RubyGems : 2.5.2.3
Host : Mac OS X 10.14.6 (18G95)
Xcode : 11.1 (11A1027)
Git : git version 2.23.0
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib
Repositories : master - git - https://github.com/CocoaPods/Specs.git # d13a0869021d940f32f0543a03500755b39be998
Installation Source
Executable Path: /usr/local/bin/pod
Plugins
cocoapods-deintegrate : 1.0.4
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-stats : 1.1.0
cocoapods-trunk : 1.4.1
cocoapods-try : 1.1.0
Answering my own question after finally figuring it out.
Something is aggressively caching the "output" of .podspec files. What was causing the issue is that I was changing the .podspec and cleaning+rebuilding, expecting that to be sufficient to pick up my changes, but it was not. If I instead do a git clean -xdf and then build, my changes are picked up.
I ended up using the properties I expected should work (with slight tweaks to the above that were easy to figure out once the options were actually being used):
s.source_files = [
'Classes/**/*',
'shared_c/**/*'
]
s.public_header_files = [
'Classes/**/*.h',
'shared_c/*.h'
]
s.xcconfig = {
'HEADER_SEARCH_PATHS' => [
'"${PODS_TARGET_SRCROOT}/shared_c/"'
],
'GCC_PREPROCESSOR_DEFINITIONS' => 'SOME_SYMBOL_FOR_THIRD_PARTY_CODE=1 SOME_OTHER_SYMBOL=1'
}
s.dependency 'Flutter'
s.ios.deployment_target = '9.0'
As for why the files are being so aggressively cached, I need to chase that up with the Flutter team (and I'm expecting them to say it's a CocoaPods/XCode issue).
Make sure that every edit to the podspec file also increases its version.
CocoaPods podspecs versions are assumed to be immutable and cached as such. See pod cache list and pod cache clean.
I try to install via CocoaPods AFNetworking 2.0 but got this message
[!] Invalid `AFNetworking.podspec` file: undefined method `social_media_url=' for #<Pod::Specification name="AFNetworking">. Updating CocoaPods might fix the issue.
# from /Users/mac/.cocoapods/repos/master/AFNetworking/2.2.0/AFNetworking.podspec:7
# -------------------------------------------
# s.homepage = 'https://github.com/AFNetworking/AFNetworking'
> s.social_media_url = 'https://twitter.com/AFNetworking'
# s.authors = { 'Mattt Thompson' => 'm#mattt.me' }
As jervine10 said you need to update CocoaPods. [sudo] gem install cocoapods
Edit: It's also worth noting that until CocoaPods reaches 1.0 changes are made very quickly. It's always worth making sure you're up to date when you're having issues.