I am running the command ionic cordova run android with the usb cable connected as expected. The app builds, and then when it starts to build the apk to deploy on to my phone I'm hit with this error in the terminal.
> cordova run android Android Studio project detected ANDROID_HOME=/Users/user/Library/Android/sdk JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home studio Subproject Path: CordovaLib Subproject Path: app publishNonDefault is deprecated and has no effect anymore. All variants are now published. The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_3e7pv4o3p5wholih0470cvjae.run(/Users/user/Documents/BoutiqueSolicitors/BoutiqueSolicitors/platforms/android/app/build.gradle:148) Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead. :CordovaLib:preBuild UP-TO-DATE :CordovaLib:preDebugBuild UP-TO-DATE :CordovaLib:compileDebugAidl FAILED
FAILURE: Build failed with an exception.
* What went wrong: null value in entry: incrementalFolder=null
* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 4s 1 actionable task: 1 executed /Users/user/Documents/BoutiqueSolicitors/BoutiqueSolicitors/platforms/android/gradlew: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.
* What went wrong: null value in entry: incrementalFolder=null
* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 4s [ERROR] An error occurred while running subprocess cordova.
cordova run android exited with exit code 1.
I looked up the error: incrementalFolder=null, and I found that people were saying to fix this error you need to delete .gradle folder inside the root directory of an existing android studio project. I have tried this with no change.
Does anyone know a fix for this? I am clueless, any help would be greatly appreciated.
Subproject Path: CordovaLib Subproject Path: app publishNonDefault is deprecated and has no effect anymore. All variants are now published.-----------> No impact.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.----------->No impact.
at build_3e7pv4o3p5wholih0470cvjae.run (/Users/user/Documents/BoutiqueSolicitors/BoutiqueSolicitors/platforms/android/app/build.gradle:148) Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead. ---------->Modify dependencies in app/build.gradle to use 'implemntation' instead of 'compile'.
:CordovaLib:preBuild UP-TO-DATE :CordovaLib:preDebugBuild UP-TO-DATE :CordovaLib:compileDebugAidl FAILED.------------>look into your aidl related changes; like definition and location of aidl interface.
run command 'gradlew assembleDebug --debug' from android studio terminal and see if it gives more details on build failure.
Related
I am new to Ionic and I want to emulate Ionic in an Android platform rather than to run it in a browser. But I am stuck with this error during "ionic cordova build android" using VS CODE.
Please find the following details:
> cordova.cmd requirements android
Requirements check results for android:
Java JDK: installed 18.0.1
Android SDK: installed true
Android target: installed android-33,android-30
Gradle: installed C:\Gradle\gradle-7.4.2\bin\gradle.BAT
Actual Error:
> Task :app:processDebugMainManifest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module #5cb1c671
* 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.4.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 7s
17 actionable tasks: 17 executed
Command failed with exit code 1: E:\Ionic\Projects\NirogalayaFoundation\platforms\android\gradlew cdvBuildDebug -b E:\Ionic\Projects\NirogalayaFoundation\platforms\android\build.gradle
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
Please help me out.
I'm new to using React and have been following along in a tutorial for a project to learn. Occasionally, I encounter an error that stops my progress, then I search the error, and I generally find some solution. But in this case, I am having a hell of a time. Part of the issue is that I am so new to developing software that I sometimes am unsure of how to implement someone's solution. And, in particular, this issue seems like it is not simply contained to a single project, which means that new projects I create with React are now also experiencing similar issues.
Here's the issue. When I use npm run android, I get the following output:
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1940 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Launching emulator...
error Failed to launch emulator. Reason: Could not start emulator within 30 seconds..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
> Configure project :react-native-reanimated
> No AAR for react-native-reanimated found. Attempting to build from source.
> Native libs debug enabled: false
> Android gradle plugin: 4.2.2
> Gradle: 7.2
> building Reanimated2
> Task :app:generatePackageList 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.2/userguide/command_line_interface.html#sec:command_line_warnings
10 actionable tasks: 3 executed, 7 up-to-date
FAILURE: Build failed with an exception.
* Where:
Script 'C:\\Users\\Astuertz\\Dev\\Values2\\node_modules#react-native-community\\cli-platform-android\\native_modules.gradle' line: 122
* What went wrong:
Execution failed for task ':app:generatePackageList'.
> argument type mismatch
* 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 8s
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:
Script 'C:\\Users\\Astuertz\\Dev\\Values2\\node_modules#react-native-community\\cli-platform-android\\native_modules.gradle' line: 122
* What went wrong:
Execution failed for task ':app:generatePackageList'.
> argument type mismatch
* 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 8s
at checkExecSyncError (node:child_process:828:11)
at execFileSync (node:child_process:866:15)
at runOnAllDevices (C:\Users\Astuertz\Dev\Values2\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at async Command.handleAction (C:\Users\Astuertz\Dev\Values2\node_modules\react-native\node_modules\#react-native-community\cli\build\index.js:182:9)
Someone had said that Gradle version 7 is incompatible with the current version of React and that it needs to be downgrade to version 7. I tried changing the version in the wrapper file for the Android folder, as well as taking someone's suggestion to change it in the Android Studio "Project Structure." In either case, the error either persisted or merely gave me a different error. What is going on here?
I've been trying to get my apps to run and compile but am in over my head.
AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{}],"original":"ERROR:: AAPT: D:\android-basics-kotlin-cupcake-app-starter\app\build\intermediates\processed_res\debug\out\resources-debug.ap_: error: The system cannot find the file specified. (2).\nerror: failed to create archive.\n\n ","tool":"AAPT"}
Task :app:mergeDebugNativeLibs
Task :app:mergeExtDexDebug
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.
A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
Android resource linking failed
ERROR:: AAPT: D:\android-basics-kotlin-cupcake-app-starter\app\build\intermediates\processed_res\debug\out\resources-debug.ap_: error: The system cannot find the file specified. (2).
error: failed to create archive.
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.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 7s
27 actionable tasks: 26 executed, 1 up-to-date
Can anyone help me to solve this problem...? please...
This is what happens when aapt fails to create an archive.
First make sure you are using the latest IDE and SDK. aapt for packaging is obsolete, and the earlier aapt2 has many bugs.
If they are up to date, try to check if the following processes on your computer have read/write access to the project directory.
[your android sdk path]\build-tools[your sdk version]\aapt.exe
[your android sdk path]\build-tools[your sdk version]\aapt2.exe
[your android studio path]\bin\studio64.exe
[your android studio path]\bin\fsnotifier64.exe
[your android studio path]\jre\bin\java.exe
[your android studio path]\jre\bin\javaw.exe
If you haven't set permissions manually, they are usually blocked by security software.
I recently ran into this problem and spent a lot of time finally found out that the security software on my workstation was not adding aapt2 and aapt to the allowed list for the project repository.
I'm currently using React Native to code my final year project. I have an issue when build and install it to virtual/physical devices althought a month ago it worked fine. Can someone explain to me wwhat wrongs with my code or files? Does it get corrupted? Because I tried to created a blank new file I still get the same errors.
My error:
> Task :app:processDebugResources FAILED
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
183 actionable tasks: 2 executed, 181 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
C:\Users\minht\SmartRoom\node_modules\react-native-image-crop-picker\android\build\intermediates\library_manifest\debug\AndroidManifest.xml:10:5-14:15: AAPT: error: unexpected element <queries> found in <manifest>.
* 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
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
Seems like you need upgrade Gradle from Android studio and then try if you can run your project from Android Studio.
I have tried changing the gradle settings and build.gradle files. Also tried changing Java Compiler settings in Android stuido and updating the JDK and Android Studio.
Here's a reproducible 5.5MB github repo: https://github.com/AnimusPetitor/plusrepr
./gradlew build
output:
> Configure project :TMessagesProj
The setTestClassesDir(File) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the setTestClassesDirs(FileCollection) method instead.
The getTestClassesDir() method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the getTestClassesDirs() method instead.
The ConfigurableReport.setDestination(Object) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the method ConfigurableReport.setDestination(File) instead.
> Task :TMessagesProj:processArmv7DebugGoogleServices
Parsing json file: /home/elanimus/Desktop/plus-messenger-master-1d96151861d0db96ffe384807621a0a3a2d371c8/TMessagesProj/google-services.json
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':TMessagesProj:compileArmv7DebugJavaWithJavac'.
> java.lang.reflect.UndeclaredThrowableException
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 48s
36 actionable tasks: 36 executed
I've found the problem. The files inside the project had incorrect permissions. I chowned the project with: 'chown -R elanimus:elanums .'. elanimus is Linux's username