iOS
"nativescript-advanced-webview": "^1.1.3",
"nativescript-angular": "~5.3.0",
"nativescript-async": "^1.0.2",
"nativescript-bottombar": "^3.0.8",
"nativescript-directions": "^1.2.0",
"nativescript-drop-down": "^3.2.4",
"nativescript-floatingactionbutton": "^3.0.0",
"nativescript-geolocation": "^3.0.0",
"nativescript-google-maps-sdk": "^2.6.0",
"nativescript-gradient": "^2.0.1",
"nativescript-input-mask": "^1.0.0",
"nativescript-iqkeyboardmanager": "~1.1.0",
"nativescript-ng-shadow": "^2.0.0",
"nativescript-plugin-firebase": "^5.3.0",
"nativescript-pro-ui": "^3.3.0",
"nativescript-snackbar": "^2.0.0",
"nativescript-theme-core": "^1.0.4",
"nativescript-unit-test-runner": "^0.3.4",
Running tns run ios --clean with this configuration produces a working build, however any changes made to the code cause the Podfile to be rebuilt in a way that causes a recursion error.
Here is my Podfile (from platforms/ios) after the initial build:
use_frameworks!
target "myproject" do
# Begin Podfile - /Users/vincecooley/Projects/myproject/node_modules/nativescript-bottombar/platforms/ios/Podfile
use_frameworks!
pod 'MiniTabBar', :git => 'https://github.com/rhanb/MiniTabBar.git'
def post_install1 (installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
# End Podfile
# Begin Podfile - /Users/vincecooley/Projects/myproject/node_modules/nativescript-floatingactionbutton/platforms/ios/Podfile
pod 'MNFloatingActionButton', '~> 0.1.5'
# End Podfile
# Begin Podfile - /Users/vincecooley/Projects/myproject/node_modules/nativescript-google-maps-sdk/platforms/ios/Podfile
source 'https://github.com/CocoaPods/Specs.git'
pod 'GoogleMaps'
# End Podfile
# Begin Podfile - /Users/vincecooley/Projects/myproject/node_modules/nativescript-input-mask/platforms/ios/Podfile
pod 'InputMask', :path => '~/Projects/input-mask-ios'
def post_install2 (installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
# End Podfile
# Begin Podfile - /Users/vincecooley/Projects/myproject/node_modules/nativescript-iqkeyboardmanager/platforms/ios/Podfile
pod 'IQKeyboardManager', '~> 4.0.0'
# End Podfile
# Begin Podfile - /Users/vincecooley/Projects/myproject/node_modules/nativescript-plugin-firebase/platforms/ios/Podfile
pod 'Firebase', '~> 4.11.0'
pod 'Firebase/Auth'
# Uncomment if you want to enable Realtime DB
pod 'Firebase/Database'
# Uncomment if you want to enable Cloud Firestore
pod 'Firebase/Firestore'
# Uncomment if you want to enable Remote Config
#pod 'Firebase/RemoteConfig'
# Uncomment if you want to enable Crash Reporting
#pod 'Firebase/Crash'
# Uncomment if you want to enable Crashlytics
pod 'Fabric'
pod 'Crashlytics'
# Crashlytics works best without bitcode
def post_install3 (installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = "NO"
end
end
end
# Uncomment if you want to enable FCM (Firebase Cloud Messaging)
#pod 'Firebase/Messaging'
# Uncomment if you want to enable Firebase Storage
#pod 'Firebase/Storage'
# Uncomment if you want to enable AdMob
#pod 'Firebase/AdMob'
# Uncomment if you want to enable Invites and/or Dynamic Links
#pod 'Firebase/Invites'
# Uncomment if you want to enable Facebook Authentication
#pod 'FBSDKCoreKit'
#pod 'FBSDKLoginKit'
# Uncomment if you want to enable Google Authentication
#pod 'GoogleSignIn'
# End Podfile
# Begin Podfile - /Users/vincecooley/Projects/myproject/node_modules/nativescript-snackbar/platforms/ios/Podfile
pod 'SSSnackbar', :git => 'https://github.com/EddyVerbruggen/SSSnackbar.git', :tag => '0.1.2.4'
# End Podfile
end
post_install do |installer|
post_install1 installer
post_install2 installer
post_install3 installer
end
And here is my Podfile after making a change within my application's code. The problem occurs in the post_install1 method, which recursively calls itself, but the entire Podfile is mangled:
use_frameworks!
target "myproject" do
# Begin Podfile - /Users/vincecooley/Projects/myproject/node_modules/nativescript-bottombar/platforms/ios/Podfile
use_frameworks!
pod 'MiniTabBar', :git => 'https://github.com/rhanb/MiniTabBar.git'
def post_install1 (installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
# End Podfile
# Begin Podfile - /Users/vincecooley/Projects/myproject/node_modules/nativescript-floatingactionbutton/platforms/ios/Podfile
pod 'MNFloatingActionButton', '~> 0.1.5'
# End Podfile
# Begin Podfile - /Users/vincecooley/Projects/myproject/node_modules/nativescript-google-maps-sdk/platforms/ios/Podfile
source 'https://github.com/CocoaPods/Specs.git'
pod 'GoogleMaps'
# End Podfile
# Begin Podfile - /Users/vincecooley/Projects/myproject/node_modules/nativescript-input-mask/platforms/ios/Podfile
pod 'InputMask', :path => '~/Projects/input-mask-ios'
def post_install2 (installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
# End Podfile
# Begin Podfile - /Users/vincecooley/Projects/myproject/node_modules/nativescript-iqkeyboardmanager/platforms/ios/Podfile
pod 'IQKeyboardManager', '~> 4.0.0'
# End Podfile
# Begin Podfile - /Users/vincecooley/Projects/myproject/node_modules/nativescript-plugin-firebase/platforms/ios/Podfile
pod 'Firebase', '~> 4.11.0'
pod 'Firebase/Auth'
# Uncomment if you want to enable Realtime DB
pod 'Firebase/Database'
# Uncomment if you want to enable Cloud Firestore
pod 'Firebase/Firestore'
# Uncomment if you want to enable Remote Config
#pod 'Firebase/RemoteConfig'
# Uncomment if you want to enable Crash Reporting
#pod 'Firebase/Crash'
# Uncomment if you want to enable Crashlytics
pod 'Fabric'
pod 'Crashlytics'
# Crashlytics works best without bitcode
def post_install3 (installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = "NO"
end
end
end
# Uncomment if you want to enable FCM (Firebase Cloud Messaging)
#pod 'Firebase/Messaging'
# Uncomment if you want to enable Firebase Storage
#pod 'Firebase/Storage'
# Uncomment if you want to enable AdMob
#pod 'Firebase/AdMob'
# Uncomment if you want to enable Invites and/or Dynamic Links
#pod 'Firebase/Invites'
# Uncomment if you want to enable Facebook Authentication
#pod 'FBSDKCoreKit'
#pod 'FBSDKLoginKit'
# Uncomment if you want to enable Google Authentication
#pod 'GoogleSignIn'
# End Podfile
# Begin Podfile - /Users/vincecooley/Projects/myproject/node_modules/nativescript-snackbar/platforms/ios/Podfile
pod 'SSSnackbar', :git => 'https://github.com/EddyVerbruggen/SSSnackbar.git', :tag => '0.1.2.4'
# End Podfile
end
def post_install1 (installer)
post_install1 installer
post_install2 installer
post_install3 installer# Begin Podfile - /Users/vincecooley/Projects/myproject/node_modules/nativescript-bottombar/platforms/ios/Podfile
use_frameworks!
pod 'MiniTabBar', :git => 'https://github.com/rhanb/MiniTabBar.git'
def post_install2 (installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
# End Podfile
# Begin Podfile - /Users/vincecooley/Projects/myproject/node_modules/nativescript-input-mask/platforms/ios/Podfile
pod 'InputMask', :path => '~/Projects/input-mask-ios'
def post_install3 (installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
# End Podfile
# Begin Podfile - /Users/vincecooley/Projects/myproject/node_modules/nativescript-plugin-firebase/platforms/ios/Podfile
pod 'Firebase', '~> 4.11.0'
pod 'Firebase/Auth'
# Uncomment if you want to enable Realtime DB
pod 'Firebase/Database'
# Uncomment if you want to enable Cloud Firestore
pod 'Firebase/Firestore'
# Uncomment if you want to enable Remote Config
#pod 'Firebase/RemoteConfig'
# Uncomment if you want to enable Crash Reporting
#pod 'Firebase/Crash'
# Uncomment if you want to enable Crashlytics
pod 'Fabric'
pod 'Crashlytics'
# Crashlytics works best without bitcode
def post_install4 (installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = "NO"
end
end
end
# Uncomment if you want to enable FCM (Firebase Cloud Messaging)
#pod 'Firebase/Messaging'
# Uncomment if you want to enable Firebase Storage
#pod 'Firebase/Storage'
# Uncomment if you want to enable AdMob
#pod 'Firebase/AdMob'
# Uncomment if you want to enable Invites and/or Dynamic Links
#pod 'Firebase/Invites'
# Uncomment if you want to enable Facebook Authentication
#pod 'FBSDKCoreKit'
#pod 'FBSDKLoginKit'
# Uncomment if you want to enable Google Authentication
#pod 'GoogleSignIn'
# End Podfile
end
post_install do |installer|
post_install1 installer
post_install2 installer
post_install3 installer
post_install4 installer
end
This seems to be caused by having comments in the merged podfiles as mentioned here:
https://github.com/EddyVerbruggen/nativescript-plugin-firebase/issues/684
My pod file keeps getting messed up as well. Increasingly so every time I try to build.
@rosen-vladimirov If you have a branch in progress perhaps could post it and reference this issue just so others can see movement here as it's big issue affecting many at moment.
Hey guys, we've investigated this issue and I confirm the unexpected behavior. It can be easily reproduced by executing the following commands:
$ tns create myApp
$ cd myApp
$ tns plugin add nativescript-input-mask
$ tns plugin add nativescript-bottombar
$ tns run ios
$ tns run ios
We are working on a fix and I'll write back once we have more information.
FWIW, we are experiencing this on iOS even if you simply issue:
$ tns prepare ios
$ tns build ios --bundle
I believe there is no livesync when one issues a tns build (but I might be wrong).
The podfile issue also occurs on repeated tns builds:
$ tns build ios --bundle
$ tns build ios --bundle
The only way around this is to remove platform, add platform, skip the prepare step and issue build directly (for every single build iteration).
$ tns info
โ Getting NativeScript components versions information...
โ Component nativescript has 4.0.2 version and is up to date.
โ Component tns-core-modules has 4.2.0-2018-05-28-04 version and is up to date.
โ Component tns-android has 4.2.0-2018-05-29-02 version and is up to date.
โ Component tns-ios has 4.1.0-2018-05-25-01 version and is up to date.
Hey @noumaans ,
Can you please post your package.json as well, so we can investigate this scenario as well. Currently I've noticed the problem occurs when several of the plugins have postinstall scripts and also when CLI tries to prepare the plugins several times. The steps I've described include the nativescript-input-mask plugin, which currently has issue with its Podfile (I've logged an issue here: https://github.com/vcooley/nativescript-input-mask/issues/2). In case all plugins have correct Podfiles, CLI should be able to handle them correctly at least in incremental builds, i.e. when the preparation of the plugins is skipped.
@rosen-vladimirov
$ grep nativescript package.json
"nativescript": {
"nativescript-angular": "^5.3.0",
"nativescript-appavailability": "^1.3.1",
"nativescript-appversion": "^1.4.1",
"nativescript-bottombar": "^3.0.8",
"nativescript-carousel": "^3.1.0",
"nativescript-directions": "^1.2.0",
"nativescript-geolocation": "^4.2.6",
"nativescript-google-maps-sdk": "^2.6.0",
"nativescript-gradient": "^2.0.1",
"nativescript-iqkeyboardmanager": "^1.3.0",
"nativescript-localstorage": "^1.1.5",
"nativescript-ngx-fonticon": "4.1.0",
"nativescript-phone": "^1.3.1",
"nativescript-plugin-firebase": "^6.0.2",
"nativescript-theme-core": "^1.0.4",
"nativescript-ui-dataform": "^3.6.0",
"nativescript-ui-listview": "^3.5.7",
"nativescript-web-image-cache": "^4.2.4",
"nativescript-css-loader": "^0.26.1",
"nativescript-dev-appium": "^3.3.0",
"nativescript-dev-sass": "^1.5.0",
"nativescript-dev-typescript": "^0.7.1",
"nativescript-dev-webpack": "^0.11.0",
"nativescript-worker-loader": "~0.8.1",
same for me:
"nativescript-appversion": "~1.4.1",
"nativescript-bitmap-factory": "^1.7.1",
"nativescript-bottom-navigation": "^1.2.0",
"nativescript-clipboard": "^1.1.7",
"nativescript-directions": "^1.0.5",
"nativescript-dom": "^2.0.0",
"nativescript-feedback": "^1.1.2",
"nativescript-geolocation": "^3.0.0",
"nativescript-google-maps-sdk": "^2.6.0",
"nativescript-iqkeyboardmanager": "^1.3.0",
"nativescript-master-technology": "^1.1.1",
"nativescript-orientation": "^1.6.1",
"nativescript-permissions": "^1.2.3",
"nativescript-plugin-firebase": "^5.3.1",
"nativescript-pro-ui": "^3.2.0",
"nativescript-pulltorefresh": "^2.1.1",
"nativescript-screenshot": "0.0.2",
"nativescript-slides": "^2.2.12",
"nativescript-social-login": "^4.0.1",
"nativescript-sqlite": "^2.0.1",
"nativescript-theme-core": "^1.0.4",
"nativescript-webview-interface": "^1.4.2",
โ Getting NativeScript components versions information...
โ Component nativescript has 4.1.0 version and is up to date.
โ Component tns-core-modules has 4.1.0 version and is up to date.
โ Component tns-android has 4.1.2 version and is up to date.
โ Component tns-ios has 4.1.0 version and is up to date.
I've done some investigation today. I've found that this problem is caused with certain combinations of plugins with Podfiles. For instance when I remove either nativescript-input-mask or nativescript-bottombar from my package and node_modules everything seems to work as expected.
I'm working on the issue mentioned by @rosen-vladimirov above. However in the meantime if you need to use the nativescript-input-mask plugin you can drop this unzip the dependency to ~/Projects/input-mask-ios.
input-mask-ios.zip
Hey @vcooley , the issue is in CLI when regenerating the Podfile and I'm working on a fix. We'll do our best to release it in one of the next patches release of NativeScript CLI.
npm i -g nativescript@next fixes this issue ๐
Thanks for the fix.
Hey @NathanWalker ,
Thanks to @sis0k0 we have fixed the case when --bundle is passed in the next version of CLI. The full fix for the Podfile regeneration will be included in 4.2.0. Thanks for your patience and cooperation.
The issue has surfaced again on iOS. disregard next - still an issue.
Hey guys,
I would like to share some details about this case, why it reappeared in master branch and what's the current plan for the fix.
The issue has been reported some time ago and at first we had some troubles reproducing it. After that we've successfully reproduced one case, but it seems to be caused by incorrect version of the nativescript-input-mask plugin. After some investigation, we confirmed there's a problem with CLI regenerating Podfile when more than one plugin has a Podfile with post_install hook.
However, we were still not sure what triggers the regeneration of Podfile - on theory it shouldn't happen when the node_modules are not modified.
Meanwhile we've received reports for similar issues for Android, where all plugins' .aar files have been rebuilt whenever there's a change in node_modules. All the reports included passing --bundle flag to the build, so we've investigated this case particularly.
At this point we did not have an idea what causes the unexpected regeneration of Podfile and rebuilding of .aar files when they shouldn't be rebuilt.
After some investigation, we have found some issues when --bundle flag is passed and these PRs should have fixed them: https://github.com/NativeScript/nativescript-cli/pull/3708/ and https://github.com/NativeScript/nativescript-cli/pull/3711
The second PR "fixed" the issues with .aar and Podfile regeneration. However, we did not notice we've broken processing of any change in node_modules - CLI was checking the state of node_modules only if you pass --syncAllFiles. This works for tns run command, but it causes really strange and unexpected behavior when you run commands like tns build <platform> or tns prepare <platform> - the changes in node_modules are never processed and moved to the device.
So we had to deal with this case and this PR was born. The description contains all the details, but the most important part is that all CLI commands like tns prepare <platform>, tns build <platform> and the initial execution of tns run <platform> (i.e. the first part of the execution of this command, not only the first time when you run it) will check the state of node_modules and prepare the files from it in case it is necessary.
The PR had a fix for rebuilding .aar files only when the source files of the plugin had changed. However, we were unable to apply the same fix for iOS at this point. So that's what caused the issue with Podfile regeneration to reappear in master branch.
We have not stopped looking into this case, but the solution of the incorrect regeneration is not a simple one. Also, we were still not sure why the Podfile is regenerated on your side.
After further investigation and by using the information provided by @NathanWalker , we were able to understand what's happening - during development, Nathan is changing some files (like .scss, .ts, etc.) in a linked plugin. CLI detects the change and as the plugin is in node_modules, CLI decides to prepare the node_modules again. For iOS this includes regeneration of the Podfile. As the applied change is not in the <plugin dir>/platforms/ios/... CLI should not regenerate the project's Podfile in such case. And that's exactly what this PR does.
This PR will allow a development workflow where a change in node_modules is applied and it is not inside plugin's native part. Please note that CLI was not designed to support changes in node_modules with such details, i.e. to understand if the plugin requires rebuild, etc. The current fixes allow such workflow and the whole approach could be considered as new feature for CLI.
Anyway, the last PR will improve the workflow, but it will not fix the issue when multiple plugins have Podfiles with post_install hooks. In case you apply a change in any of the Podfiles of such plugins, CLI will still regenerate the project's Podfile and it will again brake the project.
In order to fix this, we have applied some complex changes, they are still on a branch as more tests must be added. You can give it a try by using the vladimirov/fix-podfile-issues-2 branch of NativeScript CLI. Currently it does not include the fixes from https://github.com/NativeScript/nativescript-cli/pull/3768 as this allows easier reproducing of the issue. The branch has a high regression potential, so we'll be very careful before merging it.
Please note that we have plans to merge https://github.com/NativeScript/nativescript-cli/pull/3768 and include it in 4.2.0 release. This should resolve your development workflow issues. The real fix for Podfile regeneration most probably will be included in the 4.2.1 release as it needs to be tested carefully.
Hope this clears the case. We've not stopped working and investigating this issue. The main problem we had is to understand why CLI decides to prepare node_modules again. In order to resolve such issues faster in the future, please share all details about your steps, what's your exact workflow and where you apply changes in your source.
I just want to make sure I understand correctly; and that you have covered a corner case that I have ran into on both iOS and Android... Since my case doesn't have the --bundle flag attached to it...
I use plain NativeScript for most my projects (not Vue or Angular). So I don't use the --bundle command. However, if I am working on a plugin (which I've done several this month) for a client I will use the --syncAllFiles on the demo app.
I have noticed several times:
platforms/ folder. (This rebuild eats a lot of time)Hey @NathanaelA , the mentioned PR should fix exactly this behavior - no matter if you pass --syncAllFiles or not, CLI should not reprepare native parts of plugins in case they are not changed. That's what the PR fixes as behavior. It will soon land in the next, so you'll be able to give it a try.
So @NathanaelA , @NathanWalker - the fix is in master branch and in CLI's next version. Can you give it a try and see if it resolves your issue?
Hey @rosen-vladimirov,
I can confirm nativescript@next is working for the project @NathanWalker has been referring too. Both with and without --syncAllFiles.
Thanks again. :D
Nice work @rosen-vladimirov ๐ โค๏ธ
Most helpful comment
Hey @rosen-vladimirov,
I can confirm
nativescript@nextis working for the project @NathanWalker has been referring too. Both with and without--syncAllFiles.Thanks again. :D