RNAppAuth, iOS build failed, Unknown type name 'namespace', react-native-app-auth - ios

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:
After searching the web I found it may be connected with compilator I changed it use Objective-C++:
and now I get more errors:
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. 😞

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.

Related

Can not find module 'debug

I've been having this issue for a while and I've even opened an issue on electron-builder github page but haven't received any response.
I'm running electron builder version 20.38.4 and trying to package the app for Win 64 environment. Everything works fine when I do "yarn dev" and "yarn compile". Even "yarn dist" works without any issue.
However, when I click on the generated .exe file, I get this error message.
Any ideas?
Here's the link to the issue I've opened with some detailed screenshots and log outputs
https://github.com/electron-userland/electron-builder/issues/3561
Here's the package.json as requested
{
"name": "myproj",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"dev": "electron-webpack dev",
"compile": "electron-webpack",
"dist": "yarn compile && electron-builder",
"dist:dir": "yarn dist --dir -c.compression=store -c.mac.identity=null"
},
"dependencies": {
"#rodrigogs/mysql-events": "^0.5.2",
"electron-online": "^1.0.0",
"mysql": "^2.16.0",
"source-map-support": "^0.5.9"
},
"devDependencies": {
"electron": "3.0.10",
"electron-builder": "^20.38.4",
"electron-webpack": "^2.6.1",
"webpack": "^4.26.0"
},
"build": {
"appId": "com.teamio.app",
"productName": "Teamio",
"buildVersion": "1.0",
"copyright": "Copyright © 2018 Teamio.app",
"nsis": {
"oneClick": false,
"perMachine": true,
"allowElevation": true,
"allowToChangeInstallationDirectory": true,
"deleteAppDataOnUninstall": true,
"createDesktopShortcut": true,
"installerIcon": "build/icon.ico",
"uninstallerIcon": "build/icon.ico",
"uninstallDisplayName": "Uninstall Teamio"
},
"win": {
"target": "nsis",
"icon": "build/icon.ico"
}
}
}
Sorry to revive an old question, but what is happening is the electron-online package does not properly define its dependencies in its own package.json. So it is missing the debug package, which you have "solved" by placing another package that requires debug in your project dependencies. In reality though, the (long abandoned) package electron-online should update its dependencies and add debug, among others.
As a slightly cleaner workaround, you could add debug to your project dependencies instead of electron-webpack or webpack.
I had the same problem a few hours ago, resolved by not excluding (ignoring) the src folder from package config. Could you paste you package.json file here ?
Ok. Looks like I've solved my own problem. Not sure why exactly but it worked. What I had to do was move 2 dependencies listed below from devDependencies to dependencies section in my package.json
"electron-webpack": "^2.6.1",
"webpack": "^4.26.0"
If someone can shed some light on that, it'd be helpful. I figured I'd post it here in case someone else runs into this issue.

I can't test my app in iOS with Expo

I have some problems when i try to run my app on phones that have iOS, but in Android don't have this problem. I'm coding in Sublime Text, not in XDE and executing my project in terminal, with commands npm start and reading the QR Code. I'm coding in Windows 10.
I build the project with create-react-native-app
The erro that appears is
C:/Users/adria/Desktop/App/src/Imgs/image.png: Cannot find module
'C:/Users/adria/Desktop/App/node_moduless/expo/tools/hashAssetFiles'
In the first time i did think that image is with wrong name or wrong directory, and i go to the code and certify that is correctly. So, i resolve to try in my Android and for my surprise, work correctly.`
My project:
[https://snack.expo.io/HyKP1hyjz][1]
My package.json
{
"name": "App",
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-native-scripts": "1.11.1",
"jest-expo": "25.0.0",
"react-test-renderer": "16.2.0"
},
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
"scripts": {
"start": "react-native-scripts start",
"eject": "react-native-scripts eject",
"android": "react-native-scripts android",
"ios": "react-native-scripts ios",
"test": "node node_modules/jest/bin/jest.js" },
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"expo": "^25.0.0",
"react": "16.2.0",
"react-native": "0.52.0",
"react-navigation": "^1.5.8"
}
}
I try to remove the image from my project and try run again, and have the same problem but with another image, from react-navigation
C:\Users\adria\Desktop\App\node_modules\react-navigation\src\views\assets\back-icon.png
You'll need to have the exponent package installed, see: https://github.com/expo/expo/issues/72

Ionic/Cordova Plugins not included in Xcode project

I have a Ionic v1 project and I have an issue when building on ios. Almost all of my cordova plugins are not added in the Xcode project in the left column under the folder plugin.
Cordova version : 6.2.0
Xcode version : 8.3.3
I have done :
cordova platforms rm ios
cordova platforms add ios
cordova build ios
It compiles fine but the plugin files are not added in my Xcode project (when I run the app, I have a lot of XXXPlugin class CDVXXXX (pluginName: XXX) does not exist).
The plugin files are added in the platforms/ios/MyProject/Plugins (I can see the different folders and the files .h et .m).
But when I open the Xcode project, there are only the files of one of my plugins (Branch.io), all the others are not here (cordova-plugin-camera, cordova-plugin-geolocation, cordova-plugin-inappbrowser, etc.)
In my config.xml, seems ok (example : <plugin name="cordova-plugin-geolocation" spec="~2.4.3" />)
In platforms/ios/MyProject/config.xml, seems ok as well (example : <feature name="Geolocation"><param name="ios-package" value="CDVLocation" /></feature>)
I could add them manually but it takes time and every time I remove and re-add platform, I would have to do it again.
I don't know what to do, any ideas of what I'm doing wrong ? Why is XCode stopping importing plugin files after the first one (BranchSDK which appears to be the first one in alphabetical order by the way) ?
My package.json :
{
"name": "myapp",
"version": "1.1.1",
"description": "myapp: An Ionic project",
"dependencies": {
"grunt-contrib-compress": "^1.3.0",
"grunt-contrib-uglify": "^2.0.0",
"gulp": "^3.5.6",
"gulp-concat": "^2.2.0",
"gulp-minify-css": "^0.3.0",
"gulp-rename": "^1.2.0",
"gulp-sass": "^2.0.4",
"ionic-native-transitions": "^1.0.2",
"moment": "^2.14.1",
"ng2-translate": "^2.2.2",
"plist": "^2.0.1"
},
"devDependencies": {
"angular-translate": "^2.15.2",
"bower": "^1.3.3",
"coffee-script": "^1.10.0",
"grunt-contrib-compress": "^1.3.0",
"grunt-contrib-uglify": "^2.0.0",
"gulp-angular-templatecache": "^2.0.0",
"gulp-ng-annotate": "^2.0.0",
"gulp-useref": "^3.1.2",
"gulp-util": "^2.2.14",
"mv": "^2.1.1",
"shelljs": "^0.3.0"
},
"cordovaPlugins": [
"cordova-plugin-whitelist",
"cordova-plugin-console",
"cordova-plugin-device",
"cordova-plugin-splashscreen",
"ionic-plugin-keyboard",
"cordova-plugin-network-information",
"cordova-plugin-geolocation",
"cordova-plugin-badge"
],
"cordovaPlatforms": [
"android",
{
"platform": "ios",
"version": "4.1.1",
"locator": "ios#4.1.1"
}
]
}
Thanks
Cordova version : 6.2.0
cordova#6.2.0 was released over 1½ years ago. Try updating to the latest version cordova#7.1.0
Then install the latest iOS platform: cordova platform add ios#latest
Xcode version : 8.3.3
While you're at it, update to Xcode 9 so you can build for iOS 11 / iPhone X.
delete plugins folder, node_module folder and platform/ios folder. Then run "npm install in the project root. The add ios platform

Can not install older version of Electron through package.json

Since the current VS code doesn't support Electron v1.6, so I have to downgrade my Electron version. However, I found that I can not install the old version of Electron by giving the version number in the package.json file. The following is my configuration:
{
"name": "Example",
"version": "1.0.0",
"description": "",
"main": "./app/main.js",
"scripts": {
"postinstall": "install-app-deps",
"start": "electron ."
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"electron-builder": "^15.5.1",
"electron": "^1.4",
"electron-rebuild": "^1.5.7"
},
"dependencies": {
"jquery": "^3.1.1",
"sqlite3": "^3.1.8"
}
}
The output of the npm install is the following:
And I run the following command to check the version of Electron:
node_modules/.bin/electron -v
and the output is '1.6.2' which is the latest version of Electron.
What's more interesting is that I can install the old version of Electron successfully by directly running the following command:
npm install electron#1.4
So I want to if there is anything wrong in my package.json file which caused this problem. And if so, how can I fix it.
Actually, the Electron version 1.6 satisfies "^1.4" because the caret tells NPM the minimal version of the package to install.
As also written in an answer to the Microsoft issue on GitHub, you might use "1.4" or "~1.4.0" in order to get Electron 1.4 or any other 1.4.x version (the tilde is for minimal minor releases as shown in the NPM documentation for the cli-based update of packages).

Run shell script failed when I use Xcode to build project with release deployment.

Issue Description
The log of error when build project looks like below.
node /Users/niyao/Company/Projects/EVE/EVERN/node_modules/react-native/local-cli/cli.js bundle --entry-file index.ios.js --platform ios --dev false --reset-cache --bundle-output /Users/niyao/Library/Developer/Xcode/DerivedData/EVE-bzggtbnrxixkvwgqyewmpxepvljo/Build/Products/Release-iphonesimulator/EVE.app/main.jsbundle --assets-dest /Users/niyao/Library/Developer/Xcode/DerivedData/EVE-bzggtbnrxixkvwgqyewmpxepvljo/Build/Products/Release-iphonesimulator/EVE.app
fs.js:584
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
Error: ENOENT: no such file or directory, open 'package.json'
Error Scenario
After I use package.json as below to npm instal new version, the error happens within release deployment scheme.
{
"name": "NYProject",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"lint": "./node_modules/eslint/bin/eslint.js index.ios.js index.android.js react/",
"watch": "npm-watch"
},
"watch": {
"lint": {
"patterns": [
"react",
"index.ios.js",
"index.android.js"
],
"extensions": "js",
"ignore": ".node_modules",
"quiet": false
}
},
"dependencies": {
"react": "15.3.1",
"react-native": "^0.32.0",
"react-redux": "^4.4.5",
"redux": "^3.5.2",
"redux-logger": "^2.6.1",
"redux-thunk": "^2.1.0"
},
"devDependencies": {
"babel-eslint": "^6.1.2",
"eslint": "^3.3.1",
"eslint-plugin-react": "^6.1.2",
"eslint-plugin-react-native": "^2.0.0",
"npm-watch": "^0.1.6"
}
}
The shell runs failed when build project within Release build configuration.
"./NYProject/node_modules/react-native/packager/react-native-xcode.sh"
Expected Results
Xcode could run shell when build the project. Before I upgrade the package.json configuration, it did run successfully.
Additional Information
React Native version:
react-native-cli: 0.2.0
react-native: 0.32.0
Platform(s) (iOS, Android, or both?):
Xcode 7.3.1 iOS
Operating System (macOS, Linux, or Windows?):
OS X 10.11
I had the same issue, and for me, simply upgrading to react-native 0.33.0 solved the problem.

Resources