I am trying to login Facebook with Firebase. I have installed all the libraries required and completed the required configuration. Still, whenever I try to start my app it is giving me this error:
(node:11160) UnhandledPromiseRejectionWarning: TypeError: Cannot read
property 'manifest' of undefined
at removeOldOptions (C:\Users\Dell\Desktop\firebaseapp\plugins\cordova- universal-links-plugin\hooks\lib\android\manifestWriter.js:48:32)ished in 37.33 s
at Object.writePreferences
(C:\Users\Dell\Desktop\firebaseapp\plugins\cordova-universal-links-
plugin\hooks\lib\android\manifestWriter.js:27:19)
at activateUniversalLinksInAndroid
(C:\Users\Dell\Desktop\firebaseapp\plugins\cordova-universal-links-plugin\hooks\afterPrepareHook.js:65:25)
at C:\Users\Dell\Desktop\firebaseapp\plugins\cordova-universal-links-plugin\hooks\afterPrepareHook.js:45:11
at Array.forEach (<anonymous>)
at run (C:\Users\Dell\Desktop\firebaseapp\plugins\cordova-universal-links-plugin\hooks\afterPrepareHook.js:41:17)
at module.exports (C:\Users\Dell\Desktop\firebaseapp\plugins\cordova-universal-links-plugin\hooks\afterPrepareHook.js:18:3)
at runScriptViaModuleLoader (C:\Users\Dell\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\hooks\HooksRunner.js:188:18)
at runScript (C:\Users\Dell\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\hooks\HooksRunner.js:164:16)
(node:11160) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
Able to solve this with below changes :
Just go to the below file in Ionic
plugins/cordova-universal-links-plugin/hooks/lib/android/manifestWriter.js
I fixed issue by changing pathToManifest as below:
var pathToManifest = path.join(cordovaContext.opts.projectRoot, 'platforms', 'android', 'cordovaLib', 'AndroidManifest.xml');
to
var pathToManifest = path.join( cordovaContext.opts.projectRoot, 'platforms', 'android', 'app', 'src', 'main', 'AndroidManifest.xml');
For anyone that's looking into this these days, the actual fix for this was published by someone which you can pull in as a cordova plugin https://github.com/nordnet/cordova-universal-links-plugin/issues/133#issuecomment-369260863
@okaufmann you can use the changed version of the plugin. since it's not merged in the nordnet repository, you must remove the plugin and install again using: cordova plugin add https://github.com/walteram/cordova-universal-links-plugin
After doing...
cordova plugin rm cordova-universal-links-plugin
cordova plugin add https://github.com/walteram/cordova-universal-links-plugin
.. my project was able to build successfully.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With