ReactNativeJS: C++ Exception in 'nativeRequireModuleConfig' - javascript

I have a fully function react native app for iOS. I tried making android version as well. When i tried to run it on simulator it throw the following error :
E/ReactNativeJS: C++ Exception in 'nativeRequireModuleConfig': java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'java.lang.reflect.ArtMethod' appears in /system/framework/core-libart.jar)
Gradle console :
AGPBI: {"kind":"error","text":"Error converting bytecode to dex:\nCause: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/iid/MessengerCompat$1;","sources":[{}],"original":"UNEXPECTED TOP-LEVEL EXCEPTION:\ncom.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/iid/MessengerCompat$1;\n\tat com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)\n\tat com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)\n\tat com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)\n\tat com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)\n\tat com.android.dx.merge.DexMerger.merge(DexMerger.java:189)\n\tat com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)\n\tat com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)\n\tat com.android.dx.command.dexer.Main.run(Main.java:277)\n\tat com.android.dx.command.dexer.Main.main(Main.java:245)\n\tat com.android.dx.command.Main.main(Main.java:106)\n","tool":"Dex"}
:app:transformClassesWithDexForDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 2 mins 19.746 secs
I'm using following modules in my project :
Any solutions please?
UPDATE:
Logcat from Real Device :
E/AndroidRuntime: FATAL EXCEPTION: mqt_js
Process: com.opencampus, PID: 10821
java.lang.IncompatibleClassChangeError: The method 'java.io.File android.support.v4.content.ContextCompat.getNoBackupFilesDir(android.content.Context)' was expected to be of type virtual but instead was found to be of type direct (declaration of 'com.google.android.gms.iid.zzd' appears in /data/data/com.opencampus/files/instant-run/dex/slice-com.google.android.gms-play-services-gcm-8.1.0_4d535f5b5c1f36628a96d503891e7dd5c3b4eb8f-classes.dex)
at com.google.android.gms.iid.zzd.zzdo(Unknown Source)
at com.google.android.gms.iid.zzd.<init>(Unknown Source)
at com.google.android.gms.iid.zzd.<init>(Unknown Source)
at com.google.android.gms.iid.InstanceID.zza(Unknown Source)
at com.google.android.gms.iid.InstanceID.getInstance(Unknown Source)
at com.learnium.RNDeviceInfo.RNDeviceModule.getConstants(RNDeviceModule.java:83)
at com.facebook.react.cxxbridge.JavaModuleWrapper.getConstants(JavaModuleWrapper.java:130)
at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:31)
at android.os.Looper.loop(Looper.java:158)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run(MessageQueueThreadImpl.java:196)
at java.lang.Thread.run(Thread.java:818)

Related

Truffle '"Migrations" -- cb is not a function'

I wrote a simple smart contract in Solidity 0.6.6 that I'm trying to deploy to the BSC Testnet.
This is what I have in my truffle-config.js file (privateKeys is an array with a single entry of ['0x + privatekey']:
networks: {
bscTestnet: {
provider: () => new HDWalletProvider(
privateKeys,
'https://data-seed-prebsc-1-s1.binance.org:8545/'
),
network_id: 97,
skipDryRun: true
}
}
When I run the command "truffle migrate --reset --network bscTestnet" I get the following error:
Compiling your contracts...
===========================
> Everything is up to date, there is nothing to compile.
Starting migrations...
======================
> Network name: 'bscTestnet'
> Network id: 97
> Block gas limit: 30000000 (0x1c9c380)
1_initial_migration.js
======================
Deploying 'Migrations'
----------------------
Error: *** Deployment Failed ***
"Migrations" -- cb is not a function.
at /Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:365:1
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at Migration._deploy (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:70:1)
at Migration._load (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:56:1)
at Migration.run (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/migrate/Migration.js:217:1)
at Object.runMigrations (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:150:1)
at Object.runFrom (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:110:1)
at Object.runAll (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:114:1)
at Object.run (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/migrate/index.js:79:1)
at runMigrations (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate/run.js:80:1)
at Object.module.exports [as run] (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/migrate/run.js:44:1)
at Command.run (/Users/admin/.nvm/versions/node/v17.4.0/lib/node_modules/truffle/build/webpack:/packages/core/lib/command.js:189:1)
Truffle v5.4.31 (core: 5.4.31)
Node v17.4.0
Opened an Issue a about it: https://github.com/trufflesuite/truffle/issues/4676
I guess its a bug in HardwareWallet2.0.2.
Reverting to HardwareWallet2.0.0 solved the problem for me
npm i #truffle/hdwallet-provider#2.0.0
UPDATE:
Right, workaround: I rolled #HDWalletProvider back to v2.0.1 and was able to migrate.
I assume there must be an issue with the new version for ppl who updated today.
================
Same problem with Polygon Mumbai.
Function "cb" refers to the callback function. The strange part is the error message doesn't reference my own code at all; it references the migrations.js located in:
<.nvm/versions/node/v16.11.1/lib/node_modules/truffle/build/webpack:/packages/deployer/src/deployment.js:365:1
at processTicksAndRejections (node:internal/process/task_queues:96:5>
This leads me to believe there's a problem with out 1_initial_migration.js... however that's auto-generated so I can't see any problem... it's strange.
1_initial_migration.js:
const Migrations = artifacts.require("Migrations");
module.exports = function(deployer) {
deployer.deploy(Migrations);
};

android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to verify WebView provider, version code is lower than expected

Shows this error in Bugsnag. I am new to react native, I also don't know how to reproduce this error. Please comment on the solution. The webview version is "react-native-webview": "^11.3.2" and here is the full stack trace:
android.util.AndroidRuntimeException: android.webkit.WebViewFactory$MissingWebViewPackageException: Failed to verify WebView provider, version code is lower than expected: 469208733 actual: 428014133
at android.webkit.WebViewFactory.getProviderClass(WebViewFactory.java:435)
at android.webkit.WebViewFactory.getProvider(WebViewFactory.java:252)
at android.webkit.CookieManager.getInstance(CookieManager.java:50)
at com.facebook.react.modules.network.c.c(ForwardingCookieHandler.java:3)
at com.facebook.react.modules.network.c.get(ForwardingCookieHandler.java:1)
at okhttp3.JavaNetCookieJar.loadForRequest(JavaNetCookieJar.java:2)
at com.facebook.react.modules.network.l.loadForRequest(ReactCookieJarContainer.java:2)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:17)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:10)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:9)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:10)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:1)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:13)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:2)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:3)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)

Tobi example in Node.js

I am trying to reproduce Tobi test example from the book "Node.js" in Action" the first edition from chapter 10.
I created two files forms.js containing REST api and rendering to-do submit form and first.js. defining Tobi test logic. I launch HTTP server from form.js. When I fire a test in first.js adding to-do task an error happens.
(node:13137) [DEP0025] DeprecationWarning: sys is deprecated. Use util instead.
Here code is:
/home/taras/tobiframework/node_modules/tobi/lib/browser.js:93
this.window = jsdom.jsdom(wrap(html), null, options).createWindow();
^
TypeError: jsdom.jsdom is not a function
at Browser.parse (/home/taras/tobiframework/node_modules/tobi/lib/browser.js:93:23)
at IncomingMessage.<anonymous> (/home/taras/tobiframework/node_modules/tobi/lib/browser.js:280:14)
at IncomingMessage.emit (events.js:202:15)
at endReadableNT (_stream_readable.js:1129:12)
at processTicksAndRejections (internal/process/next_tick.js:76:17)
I expect the output without errors or it is deprecated?

Unhandled rejection TypeError: this.emitter.refreshFiles is not a function

Im currently testing my angular app, it's using angular (1.5) + typescript(^1.8.0) + karma (^0.13.14);
I've got the following error when trying to run karma:
"Unhandled rejection TypeError: this.emitter.refreshFiles is not a
function
at Plugin.notifyKarmaAboutChanges (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/karma-webpack-with-fast-source-maps/index.js:148:15)
at Plugin. (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/karma-webpack-with-fast-source-maps/index.js:104:9)
at Compiler.applyPlugins (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/node_modules/tapable/lib/Tapable.js:25:14)
at Watching._done (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/lib/Compiler.js:93:17)
at Watching. (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/lib/Compiler.js:76:18)
at Compiler.emitRecords (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/lib/Compiler.js:319:37)
at Watching. (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/lib/Compiler.js:59:19)
at /Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/lib/Compiler.js:312:11
at Compiler.applyPluginsAsync (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/node_modules/tapable/lib/Tapable.js:73:70)
at Compiler.afterEmit (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/lib/Compiler.js:309:8)
at Compiler. (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/lib/Compiler.js:304:14)
at /Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/node_modules/async/lib/async.js:52:16
at Object.async.forEachOf.async.eachOf (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/node_modules/async/lib/async.js:236:30)
at Object.async.forEach.async.each (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/node_modules/async/lib/async.js:209:22)
at Compiler.emitFiles (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/webpack/lib/Compiler.js:272:20)
at MemoryFileSystem.(anonymous function) [as mkdirp] (/Users/roamer/Documents/work/project/asbhub/develop/asbhub-frontend/node_modules/karma-webpack-with-fast-source-maps/node_modules/webpack-dev-middleware/node_modules/memory-fs/lib/MemoryFileSystem.js:283:10)"
So I can only restart karma to run my test again instead of letting karma to auto refresh for me. Can't find similar issue on stackoverflow, so I post my issue here. Any suggestions?

Sencha touch production build errors

Using touch 2.1.0 and Cmd 3.1.2.342
Whilst trying to create a production version of my sencha app, I get the following error:
[WRN] C1003: Unsupported Ext.define syntax -- C:\wamp\www\touch-2.1.0\axis\nativ
e\appname\touch\src\fx\TimingFunctions.js:109
[ERR] C2008: Requirement had no matching files (Ext.fx.TimingFunctions) -- C:\wa
mp\www\touch-2.1.0\axis\native\appname\touch\src\fx\Abstract.js:959
[ERR] The following error occurred while executing this line:
C:\wamp\www\touch-2.1.0\axis\native\appname.sencha\app\build-impl.xml:165:
It seems to me that it is saying a file called fx/TimingFunctions.js is required by fx/Abstract.js but cannot be found. However, this can't be what it means as the file exists in that folder.
The command I am using is:
sencha app build production
Line 109 of TimingFunctions.js looks like this:
Ext.define('Ext.fx.TimingFunctions', Ext.apply({
singleton: true,...
One solution is to change line 109 of TimingFunctions.js from:
Ext.define('Ext.fx.TimingFunctions', Ext.apply({
to:
Ext.define('Ext.fx.TimingFunctions', {
and change line 136 of the same file from:
}, EasingPrototype));
to:
}, EasingPrototype);
This then allows the build to go ahead.
However, when I then view the production app in the web browser, it freezes and I get the following error
Uncaught TypeError: Object # has no method 'call' process sencha-touch-all-debug.js:6767
(anonymous function) process sencha-touch-all-debug.js:6774
(anonymous function) sencha-touch-all-debug.js:6779
Ext.apply.onBeforeCreated sencha-touch-all-debug.js:5196
process sencha-touch-all-debug.js:5262
process sencha-touch-all-debug.js:5268
process sencha-touch-all-debug.js:5268
process sencha-touch-all-debug.js:5268
Ext.apply.process sencha-touch-all-debug.js:5272
Ext.Class.ExtClass sencha-touch-all-debug.js:5183
Ext.ClassManager.create sencha-touch-all-debug.js:6725
Ext.apply.define sencha-touch-all-debug.js:7407
(anonymous function) TimingFunctions.js?_dc=1379403994382:109
(anonymous function) TimingFunctions.js?_dc=1379403994382:138
There was a spelling mistake in the files fx/Abstract.js and fx/TimingFunctions.js
Actually, it's not a spelling mistake - more like a grammatical error.
Abstract.js calls a function in TimingFunctions.js. in Abstract.js it is referred to as EasingMap, where as in TimingFunctions.js it is called easingMap

Categories