Build failed after ejecting from expo - react-native

FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
Could not find com.google.android:cameraview:1.0.0.
Required by:
project :app > project :expo-camera
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 10s
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 app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
Could not find com.google.android:cameraview:1.0.0.
Required by:
project :app > project :expo-camera
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 10s

Go to android/build.gradle and in repositories add
maven {
// expo-camera bundles a custom com.google.android:cameraview
url "$rootDir/../node_modules/expo-camera/android/maven"
}
then in terminal cd android and gradlew clean
then go back to your project folder and try again npx react-native run-android

Have you setup all the environment requirements?
If not you need to set up the following before building a standalone app without expo.
React Native environment set up
Follow the steps in above link

Related

Error while executing npx react-native run-android ==> Execution failed for task ':react-native-reanimated:configureCMakeDebug[arm64-v8a]'

info JS server already running.
info Installing the app...
Configure project :react-native-reanimated
Native libs debug enabled: false
Android gradle plugin: 7.2.1
Gradle: 7.5.1
building Reanimated2
WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the gradle.properties file or use the new publishing DSL.
Task :react-native-reanimated:downloadHermes UP-TO-DATE
Download https:github.com/facebook/hermes/tarball/hermes-2022-09-14-RNv0.70.1-2a6b111ab289b55d7b78b5fdf105f466ba270fd7
Task :react-native-reanimated:downloadBoost UP-TO-DATE
Download https:boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.gz
Task :react-native-reanimated:downloadDoubleConversion UP-TO-DATE
Download https:github.com/google/double-conversion/archive/v1.1.6.tar.gz
Task :react-native-reanimated:downloadFolly UP-TO-DATE
Download https:github.com/facebook/folly/archive/v2021.07.22.00.tar.gz
Task :react-native-reanimated:downloadGlog UP-TO-DATE
Download https:github.com/google/glog/archive/v0.3.5.tar.gz
Task :react-native-reanimated:configureCMakeDebug[arm64-v8a] FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https:docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
163 actionable tasks: 6 executed, 157 up-to-date
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
What went wrong:
Execution failed for task ':react-native-reanimated:configureCMakeDebug[arm64-v8a]'.
[CXX1405] error when building with cmake using D:\c2c_mobile\node_modules\react-native-reanimated\android\CMakeLists.txt: Build command failed.
Error while executing process C:\Users\User\AppData\Local\Android\Sdk\cmake\3.18.1\bin\cmake.exe with arguments {-HD:\c2c_mobile\node_modules\react-native-reanimated\android -DCMAKE_SYSTEM_NAME=Android -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_SYSTEM_VERSION=23 -DANDROID_PLATFORM=android-23 -DANDROID_ABI=arm64-v8a -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a -DANDROID_NDK=C:\Users\User\AppData\Local\Android\Sdk\ndk\21.4.7075529 -DCMAKE_ANDROID_NDK=C:\Users\User\AppData\Local\Android\Sdk\ndk\21.4.7075529 -DCMAKE_TOOLCHAIN_FILE=C:\Users\User\AppData\Local\Android\Sdk\ndk\21.4.7075529\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\User\AppData\Local\Android\Sdk\cmake\3.18.1\bin\ninja.exe -DCMAKE_CXX_FLAGS=-fstack-protector-all -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=D:\c2c_mobile\node_modules\react-native-reanimated\android\build\intermediates\cxx\Debug\2w3pu2p1\obj\arm64-v8a -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=D:\c2c_mobile\node_modules\react-native-reanimated\android\build\intermediates\cxx\Debug\2w3pu2p1\obj\arm64-v8a -DCMAKE_BUILD_TYPE=Debug -BD:\c2c_mobile\node_modules\react-native-reanimated\android.cxx\Debug\2w3pu2p1\arm64-v8a -GNinja -DANDROID_STL=c++_shared -DNATIVE_DEBUG=false -DREACT_NATIVE_TARGET_VERSION=70 -DANDROID_TOOLCHAIN=clang -DBOOST_VERSION=1_76_0 -DNODE_MODULES_DIR=D:\c2c_mobile\node_modules -DJS_RUNTIME=hermes -DJS_RUNTIME_DIR=D:\c2c_mobile\node_modules\react-native\sdks\hermes -DCLIENT_SIDE_BUILD=true -DIS_NEW_ARCHITECTURE_ENABLED=false -DPLAYGROUND_APP_NAME=D:\c2c_mobile\android\app -DRNVERSION=70}
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.
==============================================================================
2: Task failed with an exception.
What went wrong:
java.lang.StackOverflowError (no error message)
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 23s
error Failed to install the app. Make sure you have the Android development environment set up: https:reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
What went wrong:
Execution failed for task ':react-native-reanimated:configureCMakeDebug[arm64-v8a]'.
[CXX1405] error when building with cmake using D:\c2c_mobile\node_modules\react-native-reanimated\android\CMakeLists.txt: Build command failed.
Error while executing process C:\Users\User\AppData\Local\Android\Sdk\cmake\3.18.1\bin\cmake.exe with arguments {-HD:\c2c_mobile\node_modules\react-native-reanimated\android -DCMAKE_SYSTEM_NAME=Android -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_SYSTEM_VERSION=23 -DANDROID_PLATFORM=android-23 -DANDROID_ABI=arm64-v8a -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a -DANDROID_NDK=C:\Users\User\AppData\Local\Android\Sdk\ndk\21.4.7075529 -DCMAKE_ANDROID_NDK=C:\Users\User\AppData\Local\Android\Sdk\ndk\21.4.7075529 -DCMAKE_TOOLCHAIN_FILE=C:\Users\User\AppData\Local\Android\Sdk\ndk\21.4.7075529\build\cmake\android.toolchain.cmake -DCMAKE_MAKE_PROGRAM=C:\Users\User\AppData\Local\Android\Sdk\cmake\3.18.1\bin\ninja.exe -DCMAKE_CXX_FLAGS=-fstack-protector-all -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=D:\c2c_mobile\node_modules\react-native-reanimated\android\build\intermediates\cxx\Debug\2w3pu2p1\obj\arm64-v8a -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=D:\c2c_mobile\node_modules\react-native-reanimated\android\build\intermediates\cxx\Debug\2w3pu2p1\obj\arm64-v8a -DCMAKE_BUILD_TYPE=Debug -BD:\c2c_mobile\node_modules\react-native-reanimated\android.cxx\Debug\2w3pu2p1\arm64-v8a -GNinja -DANDROID_STL=c++_shared -DNATIVE_DEBUG=false -DREACT_NATIVE_TARGET_VERSION=70 -DANDROID_TOOLCHAIN=clang -DBOOST_VERSION=1_76_0 -DNODE_MODULES_DIR=D:\c2c_mobile\node_modules -DJS_RUNTIME=hermes -DJS_RUNTIME_DIR=D:\c2c_mobile\node_modules\react-native\sdks\hermes -DCLIENT_SIDE_BUILD=true -DIS_NEW_ARCHITECTURE_ENABLED=false -DPLAYGROUND_APP_NAME=D:\c2c_mobile\android\app -DRNVERSION=70}
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.
==============================================================================
2: Task failed with an exception.
What went wrong:
java.lang.StackOverflowError (no error message)
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 23s
at makeError (D:\c2c_mobile\node_modules\execa\index.js:174:9)
at D:\c2c_mobile\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async runOnAllDevices (D:\c2c_mobile\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (D:\c2c_mobile\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:142:9)
info Run CLI with --verbose flag for more details.
I fixed the above issue. please try reinstall reanimated version.
1.npm uninstall react-native-reanimated
2.npm install react-native-reanimated#2.9.1
it's 100% working for me.
I can find out the solution.
you can below line in your babel.config.js file
plugins: ['react-native-reanimated/plugin'],
and Please refer this site https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation/

react-native-appearance make a gradle error

Hey i have a error with gradle on my react native app (when i run yarn android)
yarn run v1.22.17
$ react-native run-android
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 980 file(s) to forward-jetify. Using 32 workers...
info JS server already running.
info Installing the app...
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file 'C:\Users\user\Documents\project react native\appfirst\node_modules\react-native-appearance\android\build.gradle' line: 23
* What went wrong:
A problem occurred evaluating project ':react-native-appearance'.
> Plugin with id 'maven' not found.
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':react-native-appearance'.
> com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
* 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 6s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Build file 'C:\Users\user\Documents\project react native\appfirst\node_modules\react-native-appearance\android\build.gradle' line: 23
* What went wrong:
A problem occurred evaluating project ':react-native-appearance'.
> Plugin with id 'maven' not found.
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':react-native-appearance'.
> com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
* 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 6s
at makeError (C:\Users\roro3\Documents\project react native\appfirst\node_modules\execa\index.js:174:9)
at C:\Users\roro3\Documents\project react native\appfirst\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (C:\Users\roro3\Documents\project react native\appfirst\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (C:\Users\roro3\Documents\project react native\appfirst\node_modules\#react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I see a error with react-native-appearance but i don't understand why.
I got this error after instalation of some package (react-native-gesture-handler react-native-reanimated react-native-screens react-native-safe-area-context #react-native-community/masked-view)
I also got into some problems with the react-native-appearence package. If you use expo you shouldn't have this problem or just update the package to version 0.3.4.
If you use use the react-native-cli the only option for you is to downgrade your react-native to a version which is using Gradle 6. You can find more information here about this issue.

i just installed react native using choco and i keep getting this error everytime i run "npx react-native run-android" on cmd

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings
FAILURE: Build failed with an exception.
What went wrong:
Task 'installDebug' not found in project ':app'.
Try:
Run gradlew tasks to get a list of available tasks. 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 10s
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
FAILURE: Build failed with an exception.
What went wrong:
Task 'installDebug' not found in project ':app'.
Try: Run gradlew tasks to get a list of available tasks. 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 10s
at makeError (C:\Users\gusta\Desktop\lyftclone\lyft\node_modules\execa\index.js:174:9)
at C:\Users\gusta\Desktop\lyftclone\lyft\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async runOnAllDevices (C:\Users\gusta\Desktop\lyftclone\lyft\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (C:\Users\gusta\Desktop\lyftclone\lyft\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:186:9)

npx react-native run-android does not work. "java.io.IOException: The filename, directory name, or volume label syntax is incorrect"

Just recently ejected expo and I'm trying to run my app on an android device. I followed the instructions (hopefuly right) but I keep getting this error when I try to run my app:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
java.io.IOException: The filename, directory name, or volume label syntax is incorrect
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
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
java.io.IOException: The filename, directory name, or volume label syntax is incorrect
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
at makeError (C:\Users\User\Documents\jad for eject\jad\jad\node_modules\execa\index.js:174:9)
at C:\Users\User\Documents\jad for eject\jad\jad\node_modules\execa\index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async runOnAllDevices (C:\Users\User\Documents\jad for eject\jad\jad\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (C:\Users\User\Documents\jad for eject\jad\jad\node_modules\#react-native-community\cli\build\index.js:186:9)
i am just using windows 7 32 bit i am also faced the same problem i solved like
you have local.properties file in your android folder or create one
in that file you have give sdk dir path like
give like this
sdk.dir=C:\\Users\\yourusername\\AppData\\Local\\Android\\Sdk
dont give like
sdk.dir=C:\Users\yourusername\AppData\Local\Android\Sdk
windows does not allow

Execution failed for task ':app:preDebugBuild'

I'm working on a route map app with Flutter using google_maps_webservice,location,map_view package after run
Launching lib\main.dart on SAMSUNG SM G530AZ in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:preDebugBuild'.
Android dependency 'com.google.android.gms:play-services-base' has different version for the compile (15.0.1) and runtime (16.0.1) classpath. You should manually set the same version via DependencyResolution
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 11s
Finished with error: Gradle task assembleDebug failed with exit code 1
Finaly after sevral day i've found, the package map_view have many dependencies conflict between the migration androidX and android.support: so instead of continue using mapview I'm using cirrus_map_view the correction version of map_view and it work!