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

[2.14.0] iOS build error #528

Closed
Bardiamist opened this issue Oct 10, 2022 · 25 comments · Fixed by #555
Closed

[2.14.0] iOS build error #528

Bardiamist opened this issue Oct 10, 2022 · 25 comments · Fixed by #555
Labels

Comments

@Bardiamist
Copy link
Contributor

Not building after update from 2.13.3 to 2.14.0

** BUILD FAILED **


The following build commands failed:
	CompileC /Users/bardiamist/Library/Developer/Xcode/DerivedData/proj-gcfwctharjklzxamsqckslyxgkbd/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/A0Auth0.build/Objects-normal/arm64/A0Auth0.o /Users/bardiamist/Documents/proj/proj-mobile/node_modules/react-native-auth0/ios/A0Auth0.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'A0Auth0' from project 'Pods')
(1 failure)
Screenshot Screenshot 2022-10-10 at 16 58 07
@poovamraj
Copy link
Contributor

Hi @Bardiamist, Can you try cleaning your project and trying to build again.

This would mean you must delete the folder in which your pods and node_modules are installed and do pod install and yarn install again.

@Bardiamist
Copy link
Contributor Author

Hi @poovamraj

Not helped:

  1. Remove: node_modules, Pods, yarn.lock, Podfile.lock
  2. yarn
  3. pod install
  4. Xcode -> Product -> Clean Build Folder

@poovamraj
Copy link
Contributor

@Bardiamist I am not able to reproduce this issue. Can you try and reproduce in this sample repository.

The header file you mentioned is used for interop between Swift and ObjC code and it is autogenerated. That is why I assumed clean up should fix it :\

@Bardiamist
Copy link
Contributor Author

Bardiamist commented Oct 11, 2022

Not reproducing on the fresh project but still can't update my project. In my project I can't jump into #import "A0Auth0-Swift.h". Maybe need to add something to my Bridging-Header.h

@poovamraj
Copy link
Contributor

Hi @Bardiamist where you able to fix this by any chance or any success in creating a reproducible sample for us?

@Bardiamist
Copy link
Contributor Author

No, waiting now for something

@SmartByt3r
Copy link

Hi! I have the same issue, with version 2.14.0

@shrekuu
Copy link

shrekuu commented Oct 13, 2022

image

image

It seems this file is not there.

@poovamraj
Copy link
Contributor

Hi @shrekuu @SmartByt3r @Bardiamist Can you try the suggestion from this Stackoverflow Thread.

It asks for the "Defines Module" setting under "Packaging" of "Build Settings" to be set to Yes

@Bardiamist
Copy link
Contributor Author

My target already has "Defines Module" "YES"
I tried to set "Defines Module" "YES" for the full project but not helped
A fresh project works and without it

@poovamraj
Copy link
Contributor

Hi, @Bardiamist any progress on this issue? It would be great to have a reproducible environment. Can you try to use a build setup similar to the one which is causing the issue on the sample app and then update it to see if the issue is reproducible?

@Bardiamist
Copy link
Contributor Author

Bardiamist commented Oct 17, 2022

@poovamraj Hello

any progress on this issue?

No, I'm still use react-native-auth0 2.13.3

It would be great to have a reproducible environment. Can you try to use a build setup similar to the one which is causing the issue on the sample app and then update it to see if the issue is reproducible?

Unfortunatelly my project is big and I have no idea what could be causing this problem

You can create branch based on 2.13.3 and checrry pick only related change and I can test this branch. Then we can localize the problem.

@ebg1223
Copy link

ebg1223 commented Oct 19, 2022

Same issue here. @poovamraj happy to help diagnose.

@poovamraj
Copy link
Contributor

@ebg1223 can you provide a reproducible sample so that we can look into this?

@poovamraj
Copy link
Contributor

@Bardiamist The changes related to this should be out of this commit here

@ebg1223
Copy link

ebg1223 commented Oct 19, 2022

@poovamraj I think I figured out the issue. I am attempting to migrate from firebase auth(I am guessing a possibly common use case).
react-native-firebase requires the following to be in app.json plugins array:

[
        "expo-build-properties",
        {
          "ios": {
            "useFrameworks": "static"
          }
        }
      ]

Removing this code allows the build to complete successfully. I am assuming it is useFrameworks:static that is preventing proper generation of headers. I know there are other libraries that require this, so I am sure the community would benefit from a solution that allows building in auth0 with useFrameworks: static, but at least for now, maybe docs can include something stating that it is incompatible with this build property and any libraries requiring it.

@poovamraj
Copy link
Contributor

@ebg1223 That's a great find! I'll check this one out and get the docs ready. @Bardiamist Can you verify this as well?

@ebg1223
Copy link

ebg1223 commented Oct 19, 2022

@poovamraj Thank you!!

I wish i knew more about the expo native build process to give insight into the importance of this flag, or how to correct it on the native side, but I have seen this requirement in other libs besides firebase.

Maybe someone more knowledgeable in this aspect can suggest a fix to allow for useFrameworks:static to maintain compatibility with other libs.

@Bardiamist
Copy link
Contributor Author

Bardiamist commented Oct 20, 2022

@poovamraj Hello, yes I'm use Firebase and it's require use_frameworks!

I use bare React native project so repro steps:

  1. npx react-native init AwesomeProject
  2. yarn add react-native-auth0
  3. Add use_frameworks! :linkage => :static to Podfile
  4. Don't forget to comment :flipper_configuration => FlipperConfiguration.enabled in Podfile
  5. cd ios/ && pod install
  6. yarn ios

Or you can clone this repro: https://github.com/Bardiamist/diff/tree/auth0-use-frameworks

Looks need to add use_frameworks! support

@shrekuu
Copy link

shrekuu commented Oct 20, 2022

@poovamraj Sorry I can't reproduce this. I messed up with code base during debugging. I end up creating a new repo and test react-native-auth0 first and move the rest of the code to the new repo code incrementally.

I am not using Firebase. I only have the this default in Podfile:

use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']

@poovamraj
Copy link
Contributor

Hey all 👋 I figured out what is causing the issue! So we are referencing the file from local context. So if you change the

- #import "A0Auth0-Swift.h"
+ #import <A0Auth0/A0Auth0-Swift.h>

In A0Auth0.m in your node_modules, this should start working (There are tones of problems with Hermes and New architecture if you enable use_frameworks which is mentioned in Firebase docs itself)

Can someone verify this? I can try to figure out a patch.

@Widcket
Copy link
Contributor

Widcket commented Nov 11, 2022

Hi all, does your app build if you add "${PODS_ROOT}/Headers/Public/A0Auth0" to the header search paths in the Xcode project?

@Bardiamist
Copy link
Contributor Author

Bardiamist commented Nov 14, 2022

- #import "A0Auth0-Swift.h"
+ #import <A0Auth0/A0Auth0-Swift.h>

@poovamraj yes, it helped

Hi all, does your app build if you add "${PODS_ROOT}/Headers/Public/A0Auth0" to the header search paths in the Xcode project?

@Widcket Tried to add it to Library Search Paths and Runpatch Search Paths: not helped

@Widcket
Copy link
Contributor

Widcket commented Nov 15, 2022

@Bardiamist can you please try out the branch feature/static-linking-support?

@Bardiamist
Copy link
Contributor Author

Tried, it works

"react-native-auth0": "git+ssh://git@github.com/auth0/react-native-auth0.git#feature/static-linking-support",

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

Successfully merging a pull request may close this issue.

6 participants