CocoaPods for MaterialComponents/TextControls fails
dangrima90 opened this issue ยท 14 comments
A bit of a weird issue but I can't seem to figure out what the issue is. When trying to use @nativescript-community/ui-material-textfield
I can't use version 7 of the package on iOS.
I'm always getting the following error:
The screenshot displays the error being shown for MaterialComponents/TextControls+UnderlinedTextFields
, but each time I try to run a different MaterialComponents/TextControls
Pod gets listed. Basically it's always one of the following:
pod 'MaterialComponents/TextControls+FilledTextFields'
pod 'MaterialComponents/TextControls+UnderlinedTextFields'
pod 'MaterialComponents/TextControls+OutlinedTextFields'
pod 'MaterialComponents/TextControls+FilledTextFieldsTheming'
pod 'MaterialComponents/TextControls+UnderlinedTextFieldsTheming'
pod 'MaterialComponents/TextControls+OutlinedTextFieldsTheming'
Which of course it's understandable as these are the dependencies of @nativescript-community/ui-material-textfield
.
I've tried countless things from updating pods, to reinstalling pods, clearing the cache, trying to force the pods version myself, trying different 7.x versions - but no luck whatsoever.
With @nativescript-community/ui-material-textfield
version 6 I've seen no problems. However I'm at a point where I need to use both @nativescript-community/ui-material-textfield
and @nativescript-community/ui-material-bottomsheet
. Since I need bottom sheet v7, all material components should be using v7 so that the core is using the same version. However I'm stuck as when trying to run on iOS it always fails due to MaterialComponents/TextControls
.
I understand that it might be difficult to deduce what the issue is, but any idea what could be the problem here?
@dangrima90 did you run pod repo update
?
@farfromrefug Yes ran pod repo update
. Same goes for pod install --repo-update
. I've also tried clearing the cache: pod cache clean --all
. No luck
@dangrima90 you can look in the podfile lock to see what version is installing. It should be the latest.
If not then something is preventing you from installing latest from cocoapod. maybe you need platform :ios, '10.0'
in your pdofile?
@dangrima90 cant tell you much more. The pod specs are correct https://github.com/CocoaPods/Specs/blob/master/Specs/0/1/9/MaterialComponents/124.2.0/MaterialComponents.podspec.json and MaterialComponents/TextControls+UnderlinedTextFields
exists. There must be another plugin which prevent you from installing latest. Like another plugin forcing MaterialComponents
pod version
@farfromrefug Understood, thanks for the info. So I've analysed the generated podfile and here's all the references to MaterialComponents
:
# Begin Podfile - /Users/gria001/Code/transfers/node_modules/@nativescript-community/ui-material-textfield/platforms/ios/Podfile
pod 'MaterialComponents/TextControls+FilledTextFields'
pod 'MaterialComponents/TextControls+UnderlinedTextFields'
pod 'MaterialComponents/TextControls+OutlinedTextFields'
pod 'MaterialComponents/TextControls+FilledTextFieldsTheming'
pod 'MaterialComponents/TextControls+UnderlinedTextFieldsTheming'
pod 'MaterialComponents/TextControls+OutlinedTextFieldsTheming'
# pod 'MaterialComponents/TextFields+Theming'
# End Podfile
# Begin Podfile - /Users/gria001/Code/transfers/node_modules/@nativescript/core/platforms/ios/Podfile
# platform :ios, '12.0'
use_frameworks!
pod 'MaterialComponents/Tabs', '~> 94.5'
def post_install_nativescript_core_0 (installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
end
end
end
# End Podfile
# Begin Podfile - /Users/gria001/Code/transfers/node_modules/@nativescript-community/ui-material-core/platforms/ios/Podfile
pod 'MaterialComponents/schemes/Color'
pod 'MaterialComponents/Ripple'
# End Podfile
Could any of these be creating a problem?
@dangrima90 this is /your issue pod 'MaterialComponents/Tabs', '~> 94.5'
You are not using N 8? You might need to upgrade because of this.
Ehh thought so - We're stuck with NativeScript 7 unfortunately ๐ Not sure if there's a way for us to "override that part". In our app we don't use the tabs themselves.
Asking as I saw this a few moments ago (NativeScript/nativescript-cli#5061) But I'm not so sure how it can be used.
@dangrima90 you can create a hook to modify the podfile and remove it. This is what i did in 5.x and 6.x of material components. You should be able to find it in git history
Alright time to go back in history then ๐ thanks for your help
@farfromrefug I solved it. Didn't need to use the hooks.
nativescript.config.ts
import { NativeScriptConfig } from '@nativescript/core';
export default {
id: 'transfers.medirect',
appPath: 'src',
appResourcesPath: 'App_Resources',
android: {
v8Flags: '--expose_gc',
markingMode: 'none'
},
overridePods: 'true' // <----- set overridePods to true
} as NativeScriptConfig;
App_Resources/iOS/Podfile
pod 'MaterialComponents/Tabs'
Thanks for your help :)
@dangrima90 wow did not know about that option !!!
From what I'm seeing in NativeScript 6 it used to exist but it was a boolean in a JSON file.
Now for NativeScript 7 I'm seeing a TypeScript config file and not a JSON one. Now for some reason the type is set to a string - I thought let me try true as a string instead. Just my luck it worked :)