React native Deprecated Gradle features when Builing apk - android

I'm trying to build my apk using ./gradlew bundleRelease but I always get this error:
error EISDIR: illegal operation on a directory, open 'P:\React'. Run CLI with --verbose flag for more details.
Error: EISDIR: illegal operation on a directory, open 'P:\React'
> Task :app:bundleReleaseJsAndAssets FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'npx.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
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
I also tried ./gradlew app:assembleRelease but I get the same error. I also created my project using npx.

I tried everything, I even updated the project gradle verion but I would still get the same error. But the solution was just this:
cd android
clean your gradle:
./gradlew clean
then:
./gradlew assembleRelease -x bundleReleaseJsAndAssets

Related

Problems when building in ionic cordova

Hello, I use Ionic for my app. I can serve it but cant built. Here this problem:
Please, help me if you can
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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
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.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 30s
47 actionable tasks: 8 executed, 39 up-to-date
Command failed with exit code 1: C:\Users\Darkhan\Downloads\GrandTovarPlus\pvl\platforms\android\gradlew :app:bundleRelease -b C:\Users\Darkhan\Downloads\GrandTovarPlus\pvl\platforms\android\build.gradle
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android --release exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.

Javadoc generation failed when I try to run React Native on Android Emulator

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':rn-indy-sdk:androidJavadoc'.
> Javadoc generation failed. Generated Javadoc options file (useful for troubleshooting): '/Users/.../MyProject/node_modules/rn-indy-sdk/android/build/tmp/androidJavadoc/javadoc.options'
* 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
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.7/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 3m 58s
2306 actionable tasks: 2107 executed, 199 up-to-date
error Failed to build the app.
Error: Command failed: ./gradlew build -x lint
at makeError (/Users/.../MyProject/node_modules/execa/index.js:174:9)
at Function.module.exports.sync (/Users/.../MyProject/node_modules/execa/index.js:338:15)
at buildApk (/Users/.../MyProject/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/index.js:181:22)
at runOnSpecificDevice (/Users/.../MyProject/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/index.js:162:7)
at buildAndRun (/Users/.../MyProject/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/index.js:147:12)
at /Users/.../MyProject/ItdotMobile/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/index.js:132:12
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Command.handleAction (/Users/.../MyProject/node_modules/#react-native-community/cli/build/index.js:186: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.
When I run yarn run android on a terminal, the build is failed for task ...androidJavadoc.
rn-indy-sdk is a library that I use in my project, so it seems that rn-indy-sdk library cannot be built because of something related to Javadoc.
Where should I start to look at for solving this problem? Thanks.
I also ran into this problem while using a different react native library. The solution is to open the build.gradle file located at node_modules/rn-indy-sdk/android/build.gradle and add this code:
tasks.withType(Javadoc) {
failOnError false
options.addStringOption('Xdoclint:none', '-quiet')
options.addStringOption('encoding', 'UTF-8')
options.addStringOption('charSet', 'UTF-8')
}

I got problem because of android enviroment

When I tried to
react-native run-android
I get this error. I don't understand why?? Everything was working fine. I installed all android environment variables
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
(node:7516) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
Jetifier found 1367 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Installing the 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.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\furkan\FirstProject\FirstProject\node_modules\react-native-navigation\lib\android\app\build.gradle' line: 4
* What went wrong:
A problem occurred evaluating project ':react-native-navigation'.
> Plugin with id 'kotlin-android' 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-navigation'.
> compileSdkVersion is not specified.
* 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 7s
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 error: Execution failed for task ':react-native-reanimated:checkDebugManifest'

I started to work on a react native project. But I have a problem now. I built a simple project and execute react-native run-android. But error occurred.
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 954 file(s) to forward-jetify. Using 6 workers...
info Starting JS server...
info Installing the app...
> Task :app:createDebugCompatibleScreenManifests 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
40 actionable tasks: 12 executed, 28 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:createDebugCompatibleScreenManifests'.
> Failed to create directory 'E:\web_project\fcManager\app\svn_prj\02_source\fcmanager\android\app\build\intermediates\compatible_screen_manifest\debug\createDebugCompatibleScreenManifests\out'
* 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 7s
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 ':app:createDebugCompatibleScreenManifests'.
> Failed to create directory 'E:\web_project\fcManager\app\svn_prj\02_source\fcmanager\android\app\build\intermediates\compatible_screen_manifest\debug\createDebugCompatibleScreenManifests\out'
* 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
And then I cleared the cache by yarn start --reset-cache, and execute again react-native run-android. Error again. But the latter errors are different from the former errors.
What could be a problem?
Wow. I solve the problem.
>cd android
android>./gradlew clean
And then apk is successfully installed on the emulator.

Cordova build command fails from command Prompt. Task 'cdvBuildDebug' not found in root project 'android'

I am trying to build and generate APK using command prompt. When I used command "cordova build android" for building the project, I am stuck at following issue:
ANDROID_HOME=C:\Phonegap\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_151
Starting a new Gradle Daemon for this build (subsequent builds will be faster).
Incremental java compilation is an incubating feature.
FAILURE: Build failed with an exception.
What went wrong:
Task 'cdvBuildDebug' not found in root project 'android'.
BUILD FAILED
Total time: 36.254 secs
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.
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
What went wrong:
Task 'cdvBuildDebug' not found in root project 'android'.
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.
Can anyone tell me where is this property "cdvBuildDebug" resides and how can i fix this issue?
Try to make build using the phonegap build website .
https://build.phonegap.com/people/sign_in

Categories

Resources