Cannot read property 'manifest' of undefined Error in Ionic - firebase

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.

You need to update the AndroidManifest path in the plugin, which seems to be outdated. Check out this:
https://github.com/nordnet/cordova-universal-links-plugin/issues/146

Related

Can not run server after add sentry to nextjs project

I prefer the docs from https://docs.sentry.io/platforms/javascript/guides/nextjs to add #sentry/nextjs to my project. Then i added their config to my next.config.js
const { withSentryConfig } = require('#sentry/nextjs');
// module.exports = withBundleAnalyzer(nextConfig)
module.exports = {
}
const moduleExports = module.exports
const SentryWebpackPluginOptions = {
// Additional config options for the Sentry Webpack plugin. Keep in mind that
// the following options are set automatically, and overriding them is not
// recommended:
// release, url, org, project, authToken, configFile, stripPrefix,
// urlPrefix, include, ignore
silent: true, // Suppresses all logs
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options.
};
// Make sure adding Sentry options is the last code to run before exporting, to
// ensure that your source maps include changes from all other Webpack plugins
module.exports = withSentryConfig(moduleExports, SentryWebpackPluginOptions);
Everythings seem to be fine before i run my server by yarn dev and got this error
Error: Could not find a valid build in the 'C:\Users\DELL\Desktop\ws-or\fjob-frontend\.next' directory! Try building your app with 'next build' before starting the server.
at Server.readBuildId (C:\Users\DELL\Desktop\ws-or\fjob-frontend\node_modules\next\dist\next-server\server\next-server.js:137:355)
at new Server (C:\Users\DELL\Desktop\ws-or\fjob-frontend\node_modules\next\dist\next-server\server\next-server.js:3:120)
at Function.createServer [as default] (C:\Users\DELL\Desktop\ws-or\fjob-frontend\node_modules\next\dist\server\next.js:2:638)
at Object.instrumentServer (C:\Users\DELL\Desktop\ws-or\fjob-frontend\node_modules\#sentry\nextjs\dist\utils\instrumentServer.js:42:67)
at Object.<anonymous> (C:\Users\DELL\Desktop\ws-or\fjob-frontend\node_modules\#sentry\nextjs\dist\index.server.js:56:20)
at Module._compile (internal/modules/cjs/loader.js:1068:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Module.load (internal/modules/cjs/loader.js:933:32)
at Function.Module._load (internal/modules/cjs/loader.js:774:14)
at Module.require (internal/modules/cjs/loader.js:957:19)
(node:4084) Warning: Accessing non-existent property 'default' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:4084) Warning: Accessing non-existent property 'target' of module exports inside circular dependency
(node:4084) Warning: Accessing non-existent property 'amp' of module exports inside circular dependency
(node:4084) Warning: Accessing non-existent property 'experimental' of module exports inside circular dependency
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
After days of research i can not resolve this error. My nextjs config is empty and i do not think this is the problem of next. If i remove the sentry config, i can start my server like normal. Any idea?
The solution to this problem is, upgrade next.js to >= 10.0.8 github.com/getsentry/sentry-javascript/issues/3724
Upgrade Next.js version to latest works for me
run to upgrade to the latest version
npm install next#latest or yarn add next#latest
check here for more info
What worked for me was removing .sentryclirc from my .gitignore file.
It was added automatically by Sentry there, and so it wasn't being added to the build.
(In case it helps someone)

How to integrate Google Cloud Text-to-Speech with Meteor

I'm trying to use Google Cloud Text-to-Speech API in Meteor app, but get an error on the Meteor console and crash when trying to use the import function described in the instructions:
("Uncaught TypeError: Cannot convert undefined or null to object at Function.getPrototypeOf (<anonymous>)")
Here's what I've done (in app directory) before starting meteor:
meteor npm install google-tts-api
export GOOGLE_APPLICATION_CREDENTIALS="/data/authenticationinfo.json"
The problems are related to the inclusion of this line at the top of my js file:
import textToSpeech from '#google-cloud/text-to-speech';
This line cause the following Meteor startup error on the console:
"Unable to resolve some modules: "http2" in /app/node_modules/#grpc/grpc-js/build/src/channel.js (web.browser)
If you notice problems related to these missing modules, consider running:
meteor npm install --save meteor-node-stubs
Actually, I ran the above command, but it has no effect. When I run start the app, it crashes quickly with the error :
Uncaught TypeError: Cannot convert undefined or null to object
at Function.getPrototypeOf ()
at module.exports (modules.js?hash=59a3378abff937a73bf3a9865d654fce71b9583a:91277)
at index.js (modules.js?hash=59a3378abff937a73bf3a9865d654fce71b9583a:86991)
at fileEvaluate (modules-runtime.js?hash=b819d45cbf32aff410d740fac0364cb4088cd3f2:346)
at Module.require (modules-runtime.js?hash=b819d45cbf32aff410d740fac0364cb4088cd3f2:248)
at require (modules-runtime.js?hash=b819d45cbf32aff410d740fac0364cb4088cd3f2:268)
at jwtclient.js (modules.js?hash=59a3378abff937a73bf3a9865d654fce71b9583a:79821)
at fileEvaluate (modules-runtime.js?hash=b819d45cbf32aff410d740fac0364cb4088cd3f2:346)
at Module.require (modules-runtime.js?hash=b819d45cbf32aff410d740fac0364cb4088cd3f2:248)
at require (modules-runtime.js?hash=b819d45cbf32aff410d740fac0364cb4088cd3f2:268)
I have tested it on a barebones node app, and my Google authentication json file works fine, so that's definitely not the problem.
I realize there are are some Meteor packages for Google TTS, but they're really old and use Google Translate (which won't work for long) instead of the new cloud services.
So, it turns out the import has to happen on the server side, NOT the client side.

basic React Native SQLite script returning undefined which causes error

I'm trying to learn to use react-native-sqlite-storage as described on this page here:
https://github.com/andpor/react-native-sqlite-storage
I am working on a windows machine trying to build an android app. I have the following code:
import SQLite from 'react-native-sqlite-storage';
function errorCB(err) {
console.log("SQL Error: " + err);
}
function successCB() {
console.log("SQL executed fine");
}
function openCB() {
console.log("Database OPENED");
}
var db = SQLite.openDatabase("test.db", "1.0", "Test Database", 200000, openCB, errorCB);
db.transaction((tx) => {
tx.executeSql('SELECT * FROM Employees a, Departments b WHERE a.department = b.department_id', [], (tx, results) => {
console.log("Query completed");
});
});
export default 1;
When I run this, I get the error
undefined is not an object (evaluating
'NativeModules["SQLite"][method]')
The error is happening on the line var db = SQLite.openDatabase("test.db", "1.0", "Test Database", 200000, openCB, errorCB);
I suspect the reason the error is happening is because SQLite expects the existence of a database before you can actually open it. However, I do not see any instructions in the link above on how to create a database with react-native-sqlite-storage, so I'm not sure if my assumption is correct. Additionally, I assume I'd need to have a table for Employees, but again, the link above didn't explicitly state examples on how to create one. SO I don't know if my assumption is correct.
So how do I get SQLite.openDatabase() command to work?
More information
I deleted my project. Then I tried to re-install everything again, this time closely following the installation instructions for sqlite storage for android as mentioned on the andpor's github instructions (ie, modifying gradle files, updating MainApplication class etc...). Once I did that, running the command react-native run-android from the CLI causes this build error:
ERROR EPERM: operation not permitted, lstat 'C:\Users\John
Lai\Projects\ReactNative\myapp\android\app\build\intermediates\exploded-aar\myapp\realm\unspecified\jars\classes.jar'
{"errno":-4048,"code":"EPERM","syscall":"lstat","path":"C:\Users\John
Lai\Projects\ReactNative\myapp\android\app\build\intermediates\exploded-aar\myapp\realm\unspecified\jars\classes.jar"}
Error: EPERM: operation not permitted, lstat 'C:\Users\John
Lai\Projects\ReactNative\myapp\android\app\build\intermediates\exploded-aar\myapp\realm\unspecified\jars\classes.jar'
at Error (native)
I tried running this command as a regular user and as an administrator, and still the same issue.
More Information 2
I deleted my project. Then I did npm install for all my projects. Then I tried the commands rnpm link and react-native link react-native-sqlite-storage, both of which gave this error:
ERR! It seems something went wrong while linking. Error: spawn UNKNOWN
Please file an issue here: https://github.com/rnpm/rnpm/issues
So now the project won't even build. Any ideas?
the problem is the library is not linked
to link they suggest two ways
with pod (advanced)
with rnpm link (easy) but this command is deprecated
so to link the library you should use the
react-native link react-native-sqlite-storage
this command is equal to rnpm link but not deprecated
if automatic build failing try with manual linking for iOS manually linking ios and android manually linking android
lstat command error is generating on windows due to permission issues or npm version issues.
You can do 2 things to pass this.
1.Open terminal in admin mode .
2.upgrade/degrade npm version
For plugin installation, configure manually
You need change MainApplication.java with:
import org.pgsqlite.SQLitePluginPackage;
and
in getPackages:
new SQLitePluginPackage()

error using Meteor upload

i followed the Meteor Upload guide exactly , but i get this error when i load my uploading template.
any clues ?
Exception from Tracker recompute function: Cannot read property 'autoStart' of null
TypeError: Cannot read property 'autoStart' of null
at Template.upload.created (http://genjurosama-199720.euw1-2.nitrousbox.com/packages/tomi_upload-jquery.js?b6bf3c0cc365d2eb8f9acc93ee3dcc4bfd892687:2569:29)
at null.<anonymous> (http://genjurosama-199720.euw1-2.nitrousbox.com/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:2995:20)
at fireCallbacks (http://genjurosama-199720.euw1-2.nitrousbox.com/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:1835:16)
at Object.Tracker.nonreactive (http://genjurosama-199720.euw1-2.nitrousbox.com/packages/tracker.js?517c8fe8ed6408951a30941e64a5383a7174bcfa:513:12)
at http://genjurosama-199720.euw1-2.nitrousbox.com/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:1832:13
at Object.Blaze._withCurrentView (http://genjurosama-199720.euw1-2.nitrousbox.com/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:2043:12)
at Object.Blaze._fireCallbacks (http://genjurosama-199720.euw1-2.nitrousbox.com/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:1831:9)
at Object.Blaze._createView (http://genjurosama-199720.euw1-2.nitrousbox.com/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:1849:9)
at Object.Blaze._materializeView (http://genjurosama-199720.euw1-2.nitrousbox.com/packages/blaze.js?efa68f65e67544b5a05509804bf97e2c91ce75eb:1853:9)
I've just tested it with Meteor for Windows and it works perfect for me.
Meteor.startup(function () {
UploadServer.init({
tmpDir: process.env.PWD + '/.uploads/tmp',
uploadDir: process.env.PWD + '/.uploads/',
checkCreateDirectories: true
})
});
Check what you are getting at process.env.PWD, I think issues comes from your enviroment. You need write permissions to that path. Also check out latest updates with meteor update.
Btw, it can be issue with nitrous enviroment.

Install of Iron Router for Meteor 1.0.2.1 just does not work

So I've done the todo and leaderboard tutorials and now am excited to begin routing - seems like iron router is the way to go so I install it to my project using
mrt add iron-router
Seems to install ok so I start meteor and navigate to localhost:3000 and my console lights up with:
Uncaught TypeError: undefined is not a function
helpers.js:141 Uncaught TypeError: Cannot read property 'prototype' of undefined
router.js:61 Uncaught TypeError: undefined is not a function
global-imports.js?784bc180a149e4c10dff977a7f114df67d9952c6:3 Uncaught TypeError: Cannot read property 'RouteController' of undefined
template.tutorialexample.js?e119ff8df948cfe8167f49eb28794995a594841c:2 Uncaught ReferenceError: Template is not defined
tutorialexample.js?a4ef596255404350be2cc45303caea02f934cd17:1 Uncaught ReferenceError: Meteor is not defined
Mind you this is a default app, haven't touched a thing.
So if someone could point me in the right direction that would be great. I did read somewhere that I should be using 0.8.2 version of iron router - and I then did change my smart.json file to contain:
{
"packages": {
"iron-router": "0.8.2"
}
}
and then did meteor update etc but still no luck. So any help anyone could provide would be great.
Meteor has changed quite a bit & the instructions/tutorial you've been following is a bit dated.
Previously mrt was part of the meteorite packaging system, from Meteor 0.9.0 it has been integrated directly into meteor.
So now you do:
meteor add iron:router
To add it to your project. Once you start your app up it should present a basic template on how to use it.

Resources