react-native-masked-view / masked-view

React Native Masked View Library
MIT License
956 stars 116 forks source link

A problem occurred evaluating project ':@react-native-community_masked-view' #46

Open lambou opened 4 years ago

lambou commented 4 years ago

Bug

A problem occurred evaluating project ':@react-native-community_masked-view'.

Environment info

npm@6.13.6 node@v10.15.1 react-native@0.61.5

React native info output:

 npm info it worked if it ends with ok
npm verb cli [ 'C:\\Program Files\\nodejs\\node.exe',
npm verb cli   'C:\\Users\\Arnold LAMBOU\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli   'run',
npm verb cli   'android',
npm verb cli   '--verbose' ]
npm info using npm@6.13.6
npm info using node@v10.15.1
npm verb run-script [ 'preandroid', 'android', 'postandroid' ]
npm info lifecycle WNews@0.0.1~preandroid: WNews@0.0.1
npm info lifecycle WNews@0.0.1~android: WNews@0.0.1

> WNews@0.0.1 android E:\Programme\react-native-apps\WNews
> react-native run-android

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 990 file(s) to forward-jetify. Using 2 workers...
info JS server already running.
'c:\Users\Arnold' n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
info Launching emulator...
error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...

FAILURE: Build failed with an exception.

* Where:
Build file 'E:\Programme\react-native-apps\WNews\node_modules\@react-native-community\masked-view\android\build.gradle' line: 14

* What went wrong:
A problem occurred evaluating project ':@react-native-community_masked-view'.
> build_cqgb0zdxtkdo1v4oxqsieu7q1$_run_closure1$_closure3

* 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 20s

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.

* Where:
Build file 'E:\Programme\react-native-apps\WNews\node_modules\@react-native-community\masked-view\android\build.gradle' line: 14

* What went wrong:
A problem occurred evaluating project ':@react-native-community_masked-view'.
> build_cqgb0zdxtkdo1v4oxqsieu7q1$_run_closure1$_closure3

* 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 20s

    at checkExecSyncError (child_process.js:616:11)
    at execFileSync (child_process.js:634:13)
    at runOnAllDevices (E:\Programme\react-native-apps\WNews\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
    at process._tickCallback (internal/process/next_tick.js:68:7)
npm verb lifecycle WNews@0.0.1~android: unsafe-perm in lifecycle true
npm verb lifecycle WNews@0.0.1~android: PATH: C:\Users\Arnold LAMBOU\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\Programme\react-native-apps\WNews\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\php;C:\composer;C:\Users\Arnold LAMBOU\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files (x86)\Yarn\bin\;C:\Program Files\PuTTY\;C:\Users\Arnold LAMBOU\AppData\Local\Android\Sdk\platform-tools;;C:\Program Files\Microsoft VS Code\bin;C:\Users\Arnold LAMBOU\AppData\Local\Programs\Python\Python37\Scripts\;C:\Users\Arnold LAMBOU\AppData\Local\Programs\Python\Python37\;C:\Users\Arnold LAMBOU\AppData\Local\Microsoft\WindowsApps;C:\Users\Arnold LAMBOU\AppData\Roaming\Composer\vendor\bin;C:\Users\Arnold LAMBOU\AppData\Roaming\npm;C:\Users\Arnold LAMBOU\AppData\Local\Yarn\bin;C:\ngrok;C:\Program Files\MongoDB\Server\4.2\bin;C:\Program Files\heroku\bin;C:\Users\Arnold LAMBOU\AppData\Roaming\Python\Python37\Scripts
npm verb lifecycle WNews@0.0.1~android: CWD: E:\Programme\react-native-apps\WNews
npm info lifecycle WNews@0.0.1~android: Failed to exec android script
npm verb stack Error: WNews@0.0.1 android: `react-native run-android`
npm verb stack Exit status 1
npm verb stack     at EventEmitter.<anonymous> (C:\Users\Arnold LAMBOU\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
npm verb stack     at EventEmitter.emit (events.js:189:13)
npm verb stack     at ChildProcess.<anonymous> (C:\Users\Arnold LAMBOU\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
npm verb stack     at ChildProcess.emit (events.js:189:13)
npm verb stack     at maybeClose (internal/child_process.js:970:16)
npm verb stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
npm verb pkgid WNews@0.0.1
npm verb cwd E:\Programme\react-native-apps\WNews
npm verb Windows_NT 10.0.17134
npm verb argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Arnold LAMBOU\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "android" "--verbose"
npm verb node v10.15.1
npm verb npm  v6.13.6
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! WNews@0.0.1 android: `react-native run-android`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the WNews@0.0.1 android script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm verb exit [ 1, true ]
npm timing npm Completed in 68382ms

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Arnold~1\AppData\Roaming\npm-cache\_logs\2020-02-22T19_44_46_925Z-debug.log

Library version: 0.1.6

Steps To Reproduce

react-native run-android

Reproducible sample code

react-native run-android

lambou commented 4 years ago

Found a way to solve it but not sure it is the best way;

I took the version (3.4.2) from android\build.gradle:

dependencies {
        classpath("com.android.tools.build:gradle:3.4.2")

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

and replaced the node_modules\@react-native-community\masked-view\android\build.gradle file version which was 3.3.1

Thelin90 commented 4 years ago

I am currently facing the same issue now when I am playing around with it, but I can't get it to work with your suggestion :/

xprimate commented 3 years ago

node_modules@react-native-community\masked-view\android\build.gradle

Please can you explain what you mean by

and replaced the node_modules@react-native-community\masked-view\android\build.gradle file version which was 3.3.1

Do you mean I should replace classpath("com.android.tools.build:gradle:3.4.2") with classpath("com.android.tools.build:gradle:3.3.1")

Kindly expatiate as I am facing the same issue.

Thanks.