React native build fail react-native-fbsdk - gradle

Trying to build react-native android app but following error
info Running jetifier to migrate libraries to AndroidX. You can
disable it using "--no-jetifier" flag. Jetifier found 1108 file(s) to
forward-jetify. Using 12 workers... info JS server already running.
info Installing the app...
Task :react-native-fbsdk:compileDebugJavaWithJavac FAILED
Deprecated Gradle features were used in this build, making it
incompatible with Gradle 6.0. Use '--warning-mode all' to show the
individual deprecation warnings. See
https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings
26 actionable tasks: 2 executed, 24 up-to-date
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':react-native-fbsdk:compileDebugJavaWithJavac'.
Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_231 contains a valid JDK installation.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 4s
error Failed to install the app. Make sure you have the Android
development environment set up:
https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment.
Run CLI with --verbose flag for more details. Error: Command failed:
gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':react-native-fbsdk:compileDebugJavaWithJavac'.
Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_231 contains a valid JDK installation.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 4s
at checkExecSyncError (child_process.js:603:11)
at execFileSync (child_process.js:621:13)
at runOnAllDevices (G:\work\upveda\app\2019\rn_subhakamana\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at buildAndRun (G:\work\upveda\app\2019\rn_subhakamana\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at then.result (G:\work\upveda\app\2019\rn_subhakamana\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12)
at process._tickCallback (internal/process/next_tick.js:68:7) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! Subhakamana#0.0.1
android: react-native run-android npm ERR! Exit status 1 npm ERR!
npm ERR! Failed at the Subhakamana#0.0.1 android script. npm ERR! This
is probably not a problem with npm. There is likely additional logging
output above.
npm ERR! A complete log of this run can be found in: npm ERR!
C:\Users\sheye\AppData\Roaming\npm-cache_logs\2019-12-19T11_54_40_308Z-debug.log

So basically the problem was you have to perform an AndroidX migration on your linked source every time you update react native modules that ship native Java code. That is what this tool(i.e jetifier and jetify command) does - it can rewrite the source in node_modules every time you call it.
the commands are first try npm i jetifier and then npx jetify to solve your problem.
Hope it helps, feel free for doubts

Related

Issues running "yarn build" while creating Solana NFTs

I've been having issues running "yarn build" for a few days now. I tried the suggestions I could find online without much luck. This is for an NFT project on Solana so hoping another dev on here may have ran into and has the fix.
Things I've tried:
Downgrading to earlier versions of node js, ts-node, yarn, and solana.
Deleting package-lock.json.
Any other suggestions out there would be much appreciated. Thanks in advance!
Command line output below:
C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js>yarn build
yarn run v1.22.10
$ lerna run build
lerna notice cli v3.22.1
lerna info versioning independent
lerna info Executing command in 5 packages: "yarn run build"
lerna ERR! yarn run build exited 1 in 'candy-machine-mint'
lerna ERR! yarn run build stdout:
$ react-scripts build
Creating an optimized production build...
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR! yarn run build stderr:
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
at Object.createHash (node:crypto:130:10)
at module.exports (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\util\createHash.js:135:53)
at NormalModule._initBuildHash (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\NormalModule.js:417:16)
at handleParseError (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\NormalModule.js:471:10)
at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\NormalModule.js:503:5
at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\NormalModule.js:358:12
at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:373:3
at iterateNormalLoaders (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
at iterateNormalLoaders (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:236:3
at runSyncOrAsync (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:130:11)
at iterateNormalLoaders (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
at Array.<anonymous> (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
at Storage.finished (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:55:16)
at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:91:9
C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\packages\fair-launch\node_modules\react-scripts\scripts\build.js:19
throw err;
^
Error: error:0308010C:digital envelope routines::unsupported
at new Hash (node:internal/crypto/hash:67:19)
at Object.createHash (node:crypto:130:10)
at module.exports (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\util\createHash.js:135:53)
at NormalModule._initBuildHash (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\NormalModule.js:417:16)
at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\NormalModule.js:452:10
at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\webpack\lib\NormalModule.js:323:13
at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:367:11
at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:233:18
at context.callback (C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\loader-runner\lib\LoaderRunner.js:111:13)
at C:\Users\corma\Desktop\Solana_Project1\metaplex-master\js\node_modules\babel-loader\lib\index.js:59:103 {
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
Node.js v17.2.0
error Command failed with exit code 1.
lerna ERR! yarn run build exited 1 in 'candy-machine-mint'
lerna WARN complete Waiting for 2 child processes to exit. CTRL-C to exit immediately.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
It is the node.js version used with old code that is causing the error. Uninstall the current version of node and install the lts version (16.13.1) and the error will be gone.

React Native FAILURE: Build failed with an exception

I made the necessary setups for react native on windows. Then I created my project with the command "npx react-native init projectname". Then I ran my project with "npx react-native run-android" command but I get the following errors.
C:\Users\user\OneDrive\Masaüstü\mobile\project>npx react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 967 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Installing the app...
:ReactNative:Unexpected empty result of running '[node, C:\Users\user\OneDrive\Masaüstü\mobile\project\node_modules\react-native\node_modules\#react-native-community\cli\build\bin.js, config]' command.
:ReactNative:Running '[node, C:\Users\user\OneDrive\Masaüstü\mobile\project\node_modules\react-native\node_modules\#react-native-community\cli\build\bin.js, config]' command failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\user\OneDrive\Masaustu\mobile\project\node_modules\#react-native-community\cli-platform-android\native_modules.gradle' line: 195
* What went wrong:
A problem occurred evaluating script.
> internal/modules/cjs/loader.js:969 throw err; ^Error: Cannot find module 'C:\Users\user\OneDrive\Masaüstü\mobile\project\node_modules\react-native\node_modules\#react-native-community\cli\build\bin.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15) at Function.Module._load (internal/modules/cjs/loader.js:842:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) at internal/main/run_main_module.js:17:47 { code: 'MODULE_NOT_FOUND', requireStack: []}
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
:ReactNative:Unexpected empty result of running '[node, C:\Users\user\OneDrive\Masaüstü\mobile\project\node_modules\react-native\node_modules\#react-native-community\cli\build\bin.js, config]' command.
C:\Users\user\OneDrive\Masaüstü\mobile\project>
First, you have to install the latest version of #react-native-community/cli-platform-android
npm i #react-native-community/cli-platform-android
then go to the android directory and clean gradlew by the following command
cd android && gradlew clean
go back to your main directory and run app
cd.. && react-native run-android

Strapi Graphql Plugin Crashes Strapi Server

I just tried to install the graphql plugin for strapi (i.e., strapi-plugin-graphql). When I tried to install it via the admin interface, I got the following error message:
The restart takes longer than expected
The server should have restarted, please check your logs in the terminal
When I check my terminal, this is what I see:
[2019-12-27T07:47:12.612Z] debug GET /admin/plugins (5 ms) 200
[2019-12-27T07:47:15.882Z] info Installing graphql...
[2019-12-27T07:48:59.105Z] info File changed: C:\code\tutorials\react\Gatsby\strapi\startup-reporter\package.json[2019-12-27T07:48:59.279Z] debug POST /admin/plugins/install (103411 ms) 200
[2019-12-27T07:48:59.281Z] info The server is restarting
[2019-12-27T07:49:14.672Z] debug ⛔️ Server wasn't able to start properly.
[2019-12-27T07:49:14.674Z] error Error: Field "Query.news" can only be defined once.
at assertValidSDL (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\graphql\validation\validate.js:108:11)
at Object.buildASTSchema (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\graphql\utilities\buildASTSchema.js:71:34)
at Object.buildSchemaFromTypeDefinitions (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\graphql-tools\dist\generate\buildSchemaFromTypeDefinitions.js:23:28)
at makeExecutableSchema (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\graphql-tools\dist\makeExecutableSchema.js:26:29)
at Object.generateSchema (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\strapi-plugin-graphql\services\Schema.js:300:22)
at Object.initialize (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\strapi-plugin-graphql\hooks\graphql\index.js:59:50)
at Promise.resolve.then (C:\code\tutorials\react\Gatsby\strapi\startup-reporter\node_modules\strapi\lib\hooks\index.js:37:28)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! startup-reporter#0.1.0 dev: `strapi develop`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the startup-reporter#0.1.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\moshe\AppData\Roaming\npm-cache\_logs\2019-12-27T07_49_14_697Z-debug.log
Any idea why I am getting this error message and how to fix it?
UPDATE:
I should note that I did a fresh install of strapi and then installed the graphql plugin -- and it installed properly. It only didn't work with an installation that already had custom post types. I don't know why that is -- and what I can do to install it with those custom post types. Any ideas?
Here is the issue about this problem
https://github.com/strapi/strapi/issues/1198
Some words are not well managed for the pluralize version.
So the issue is due to that point.
There is currently nothing to do to fix it by your own.

Laravel error when running npm run dev command

When I run npm run dev in the terminal I get the following message:
ERROR in ./resources/js/components/ExampleComponent.vue
Module build failed (from ./node_modules/vue-loader/lib/index.js):
Error: [vue-loader] vue-template-compiler must be installed as a peer dependency, or a compatible compiler implementation must be passed via options.
at loadTemplateCompiler (/portal/node_modules/vue-loader/lib/index.js:21:11)
at Object.module.exports (
(/portal/node_modules/vue-loader/lib/index.js:65:35)
# ./resources/js/app.js 19:35-79
# multi ./resources/js/app.js ./resources/sass/app.scss
Can anyone tell me what this error means and how do I fix it?
I tried to run this command in the terminal, but I am still getting the error.
The command: npm i -D vue-template-compiler
I have also tried to reinstall all of my dependencies, but that didnt work either.

I am trying to make an apk its generated but with this error Execution failed for task ':app:bundleReleaseJsAndAssets'

Task :app:bundleReleaseJsAndAssets
Scanning folders for symlinks in C:\react-native\first_app\node_modules (109ms)
Scanning folders for symlinks in C:\react-native\first_app\node_modules (47ms)
warning: the transform cache was reset.
Loading dependency graph, done.
Unable to resolve module AccessibilityInfo from C:\react-native\first_app\node_modules\react-native\Libraries\react-native\react-native-implementation.js: Module AccessibilityInfo does not exist in the Haste module map
This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
1. Clear watchman watches: watchman watch-del-all.
2. Delete the node_modules folder: rm -rf node_modules && npm install.
3. Reset Metro Bundler cache: rm -rf /tmp/metro-bundler-cache-* or npm start -- --reset-cache. 4. Remove haste cache: rm -rf /tmp/haste-map-react-native-packager-*.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
Process 'command 'cmd'' finished with non-zero exit value 1
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 42s
12 actionable tasks: 1 executed, 11 up-to-date
As mentioned here, It may be because of you did not bundled correctly for android.
You can add following script
"bundle-android": "node node_modules/react-native/local-cli/cli.js bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/"
into scripts of your package.json
and the run npm run bundle-android
after that try running gradlew assembleRelease -x bundleReleaseJsAndAssets in android directory of your project. Hope it will solve your problem.

Resources