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 while building the AppAuth pod in cordova; works directly in xcode #550

Closed
3 tasks done
shankari opened this issue Feb 26, 2019 · 5 comments
Closed
3 tasks done

Comments

@shankari
Copy link

shankari commented Feb 26, 2019

Bug Report

I seem to have found a regression in building a plugin that includes the JWT pod.
I am using the legacy build system so that is not the issue.

I have a plugin that includes the JWT pod at version 2.2.0
https://github.com/e-mission/cordova-jwt-auth/blob/master/plugin.xml

This is the most recent non-beta release of that pod
https://github.com/yourkarma/jwt

If I use the CLI to build an app with that plugin, the build fails.
If I open the same failed xcworkspace in xcode, it builds.

I am not blocked on this right now since I can use xcode, but it bothers me that the CLI gives different results.

Problem

Build through CLI fails

/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/JWT/Classes/Supplement/JWTBase64Coder.m:22:9: fatal error: 'Base64/MF_Base64Additions.h' file not found
#import <Base64/MF_Base64Additions.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
....
        CompileC /Users/shankari/Library/Developer/Xcode/DerivedData/emTripLog-gesdjyjzkxuymhcrjzidxdezczor/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/JWT.build/Objects-normal/x86_64/JWTBase64Coder.o JWT/Classes/Supplement/JWTBase64Coder.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

Build through xcode succeeds

  • open the .workspace file in xcode
  • Product -> Build
  • build succeeds

Build through CLI fails again

Just in case xcode wrote some special settings to the workspace file that made the build work, try to re-build via the CLI. It fails again.

What is expected to happen?

CLI and xcode builds should be consistent (either both should pass or both should fail)

What does actually happen?

CLI build fails and xcode build succeeds

Information

I am fairly sure this worked until pretty recently, but I can't remember exactly when. The JWT pod was added over a year ago.
https://github.com/e-mission/cordova-jwt-auth/blame/master/plugin.xml#L102
Unfortunately, I don't have CI enabled for this project :(

Command or Code

cordova build ios --buildFlag="-UseModernBuildSystem=0"

Environment, Platform, Device

OSX 10.13.6

Version information

cordova: 8.0.0
ionic: 3.19.1
jwt: 2.2.0
xcode: Version 10.0 (10A255)

I looked at the verbose logs while compiling the broken file in both the CLI and there doesn't appear to be a huge difference between them. In fact, the non-working version seems to have more directories in the include path. I have attached the working and non-working logs to this bug. I generated the working log by using the "Expand all Transcripts" option in the xcode build log and searching for the JWTBase64Coder.m file.

--- /tmp/non_working_cmd_line   2019-02-25 17:59:42.000000000 -0800
+++ /tmp/working_xcode   2019-02-25 17:59:53.000000000 -0800
...
--I/Users/shankari/e-mission/e-mission-base/platforms/ios/build/emulator/include
--I/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Pods/Headers/Private
--I/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Pods/Headers/Private/JWT
--I/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Pods/Headers/Public
--I/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Pods/Headers/Public/Base64
--I/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Pods/Headers/Public/JWT
--I/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Pods/Headers/Public/AppAuth
--I/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Pods/Headers/Public/GGLInstanceID
--I/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Pods/Headers/Public/GTMOAuth2
--I/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Pods/Headers/Public/GTMSessionFetcher
--I/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Pods/Headers/Public/GoogleCloudMessaging
--I/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Pods/Headers/Public/GoogleToolboxForMac
+-I/Users/shankari/Library/Developer/Xcode/DerivedData/emTripLog-gesdjyjzkxuymhcrjzidxdezczor/Build/Products/Debug-iphonesimulator/JWT/include
+-I/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Headers/Private
+-I/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Headers/Private/JWT
+-I/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Headers/Public
+-I/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Headers/Public/Base64
+-I/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Headers/Public/JWT
 -I/Users/shankari/Library/Developer/Xcode/DerivedData/emTripLog-gesdjyjzkxuymhcrjzidxdezczor/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/JWT.build/DerivedSources/x86_64
 -I/Users/shankari/Library/Developer/Xcode/DerivedData/emTripLog-gesdjyjzkxuymhcrjzidxdezczor/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/JWT.build/DerivedSources
--F/Users/shankari/e-mission/e-mission-base/platforms/ios/build/emulator
--F/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Pods/GoogleIPhoneUtilities/Frameworks
--F/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Pods/GoogleInterchangeUtilities/Frameworks/frameworks
--F/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Pods/GoogleSignIn/Frameworks
--F/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Pods/GoogleSymbolUtilities/Frameworks/frameworks
--F/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Pods/GoogleUtilities/Frameworks/frameworks
+-F/Users/shankari/Library/Developer/Xcode/DerivedData/emTripLog-gesdjyjzkxuymhcrjzidxdezczor/Build/Products/Debug-iphonesimulator/JWT
 -include

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

non_working_cmd_line.gz
working_xcode.gz

@shankari
Copy link
Author

I have also attached the complete verbose logs with output before and after the failure.
non_working_cmd_line_full_verbose.gz

@shankari
Copy link
Author

Note also that cordova-ios is still at 4.5.5, not the most recently released 5.0.0
I see that there was a major change to pod handling in 5.0.0 and I don't want to get caught up in that.

@shankari
Copy link
Author

shankari commented Mar 4, 2019

ok wait a bit, now that I see the diffs more carefully, the path is subtly different between the cli and xcode. There is an extra Pods in the path from the CLI.

--I/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Pods/Headers/Public/Base64
+-I/Users/shankari/e-mission/e-mission-base/platforms/ios/Pods/Headers/Public/Base64

and platforms/ios/Pods/ exists but platforms/ios/Pods/Pods does not

$ ls -l platforms/ios/Pods | grep Pods
drwxr-xr-x   2 shankari  649427843    64 Feb 25 16:55 Local Podspecs
drwxr-xr-x@  4 shankari  649427843   128 Feb 25 17:44 Pods.xcodeproj

This implies that none of the pods should work, maybe the build fails after the first error?

shankari added a commit to shankari/e-mission-base that referenced this issue Mar 4, 2019
This should resolve at least one of the issues with building from the command
line. However building from the CLI still fails due to
apache/cordova-ios#550
@shankari
Copy link
Author

I ran into a similar issue with a different pod (AppAuth) while trying to upgrade to the latest version of cordova and iOS (e-mission/e-mission-phone#804).

with cordova-ios@6.1.0, everything works, as you can see from the CI
https://github.com/e-mission/e-mission-phone/runs/3932599692?check_suite_focus=true

However, with the upgrade to cordova-ios@6.2.0, the build fails with the error

/Users/runner/work/e-mission-phone/e-mission-phone/platforms/ios/emission/Plugins/cordova-plugin-em-jwt-auth/OpenIDAuth.m:10:9: fatal error: 'AppAuth.h' file not found
#import "AppAuth.h"
        ^~~~~~~~~~~

As you can see from the Pull Request CI
https://github.com/e-mission/e-mission-phone/runs/3978587619?check_suite_focus=true

@shankari shankari changed the title error while building the JWT pod in cordova; works directly in xcode error while building the AppAuth pod in cordova; works directly in xcode Oct 22, 2021
@shankari
Copy link
Author

Changing this from #import to @import to import it as a module fixed the problem.
Closing this for now.

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

No branches or pull requests

2 participants