2

I am trying to add react-native-app-auth to existing, but quite fresh project with Expo. I'm following your setup guide, so doing following steps:

  • yarn add react-native-app-auth@2.2.0 --dev
  • Add pod 'AppAuth', '>= 0.91'
  • cd iso && pod install
  • react-native link (EDIT: from root path of the project)

And I get:

rnpm-install info Linking react-native-app-auth ios dependency
rnpm-install WARN ERRGROUP Group 'Libraries' does not exist in your Xcode project. We have created it automatically for you.
rnpm-install info Platform 'ios' module react-native-app-auth has been successfully linked

which looks fine.

Then when I build in XCode i get the following error:

image

After searching the web I found it may be connected with compilator I changed it use Objective-C++:

image

and now I get more errors:

image

I also tried:

  • Changing Target version to 9.0
  • Doing it again
  • Praying 🙏

Nothing helps :( Xcode Version 9.3 (9E145)

app.js

{
    "expo": {
        "sdkVersion": "26.0.0",
        "ios": {
        "bundleIdentifier": "com.xxx.xxx",
        "publishBundlePath": "ios/mobile-xxx/Supporting/shell-app.bundle",
        "publishManifestPath": "ios/mobile-xxx/Supporting/shell-app-manifest.json"
        },
        "android": {
        "package": "com.xxx.xxx"
        },
        "name": "mobile-xxx",
        "slug": "mobile-xxx",
        "version": "0.1.0",
        "isDetached": true,
        "entryPoint": "./index.js",
        "detach": {
        "scheme": "exp997ce9c6b4fd43cfa14f4eede063ecf5",
        "iosExpoViewUrl": "https://s3.amazonaws.com/exp-exponent-view-code/ios-v2.4.4-sdk26.0.0-3bd935c7-cdd3-4002-8e44-4df857a675f2.tar.gz",
        "androidExpoViewUrl": "https://s3.amazonaws.com/exp-exponent-view-code/android-v2.4.0-sdk26.0.0-e63d9209-070c-4118-b06b-c60e82da0b66.tar.gz"
        }
    }
}

package.js

{
    "name": "mobile-xxx",
    "version": "0.1.0",
    "private": true,
    "devDependencies": {
        "jest-expo": "26.0.0",
        "react-native-app-auth": "2.2.0",
        "react-test-renderer": "16.3.0-alpha.1"
    },
    "main": "node_modules/expo/AppEntry.js",
    "scripts": {
        "test": "jest"
    },
    "jest": {
        "preset": "jest-expo"
    },
    "dependencies": {
        "expo": "^26.0.0",
        "prop-types": "^15.6.1",
        "react": "16.3.0-alpha.1",
        "react-native": "https://github.com/expo/react-native/archive/sdk-26.0.0.tar.gz",
        "react-native-app-auth": "^2.2.0",
        "react-native-router-flux": "^4.0.0-beta.28",
        "react-redux": "^5.0.7",
        "redux": "^3.7.2"
    }
}

UPDATE: I have just setup a fresh Expo app following this guide and have exactly the same error. 😞

3
  • Did you run link from the project root? Not clear if you did from the steps you listed. Apr 24, 2018 at 12:50
  • Yes I did. Sorry for being unclear @MichaelCheng
    – mazikwyry
    Apr 24, 2018 at 13:03
  • I believe it has something to do with boost-for-react-native, from the error logs.
    – Julian K
    Aug 1, 2018 at 22:35

1 Answer 1

4

The problem is that there is an import in header search paths, which searches in the whole /ios folder: $(SRCROOT)/../../../ios/**

If you happen to use Expo and CocoaPods, there will be boost-for-react-native as a dependency inside your Pods folder. In fact, any package depending on boost will cause this problem. XCode tries to build boost as well, but it has some non-ObjC files, so it will fail.

In order to fix the issue:

Open RNAppAuth.xcodeproj, switch to Build Settings tab and search for header search paths. Replace line $(SRCROOT)/../../../ios/** with

"$(SRCROOT)/../../../ios/YOUR_PROJECT_NAME",
"$(SRCROOT)/../../../ios/Pods/AppAuth/**",

Please note that these changes will disappear after using npm install (or yarn). To make these changes permanent, you can use patch-package.

Edit: this issue has been fixed, using the latest version of the package should work now.

2
  • This solution not working for boost-for-react-native library.
    – Priya
    Apr 17, 2020 at 11:08
  • Thank you, this helped me debug my problem. Sep 9, 2021 at 4:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.