Execution failed for task 'CordovaLib:compileDebugJavaWithJavac' - android

I'm trying to build an Android app with android target: android-22
I also tried with android-17
but this error message appear.
:CordovaLib:compileDebugJavaWithJavacC:\Users\Luis Araujo\Desktop\myApp2\platfor
ms\android\CordovaLib\src\org\apache\cordova\CordovaInterfaceImpl.java:222:erro
r: cannot find symbol
getActivity().requestPermissions(permissions, requestCode);
^
^
* What went wrong:
Execution failed for task ':CordovaLib:compileDebugJavaWithJavac'.
> 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.
BUIL D FAILED
Total time: 24.973 secs
Error: Error code 1 for command: cmd with args: /s,/c,""C:\Users\Luis Araujo\Des
ktop\myApp2\platforms\android\gradlew" cdvBuildDebug -b "C:\Users\Luis Araujo\De
sktop\myApp2\platforms\android\build.gradle" -Dorg.gradle.daemon=true -Pandroid.
useDeprecatedNdk=true"
Can you help me?

I have solved this problem.
I installed API 23 of the Android SDK, and I let in the AndroidManifest.xml and the property.properties the target android-23
Then, type ionic build android and ionic run android

Related

react-native run-android failed M1

~/RNSTAMPY  react-native run-android  1 ✘ ╱ took 41s ╱ at 10:24:15 PM
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
(node:4459) 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 1119 file(s) to forward-jetify. Using 8 workers...
info JS server already running.
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
Task :app:compileDebugJavaWithJavac 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.3.3/userguide/command_line_interface.html#sec:command_line_warnings
93 actionable tasks: 2 executed, 91 up-to-date
/Users/leeseungsup/RNSTAMPY/android/app/src/main/java/com/rnstampy/MainActivity.java:2: error: class, interface, or enum expected
package com.rnstampy;
^
1 error
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
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
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.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
/Users/leeseungsup/RNSTAMPY/android/app/src/main/java/com/rnstampy/MainActivity.java:2: error: class, interface, or enum expected
package com.rnstampy;
^
1 error
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
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
BUILD FAILED in 3s
at makeError (/Users/leeseungsup/RNSTAMPY/node_modules/#react-native-community/cli-platform-android/node_modules/execa/index.js:174:9)
at /Users/leeseungsup/RNSTAMPY/node_modules/#react-native-community/cli-platform-android/node_modules/execa/index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (/Users/leeseungsup/RNSTAMPY/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
at async Command.handleAction (/Users/leeseungsup/RNSTAMPY/node_modules/#react-native-community/cli/build/index.js:192:9)
info Run CLI with --verbose flag for more details.
run-ios is ok
run-android => android emulator opens but can't install my app.
When I ran android emulator in EXPO cli, it worked well!
but in react-native-cli environment, it doesn't work!!
react-native-cli: 2.0.1
react-native: 0.69.3
please help me~~
I solved my problem.
/Users/leeseungsup/RNSTAMPY/android/app/src/main/java/com/rnstampy/MainActivity.java:2: error: class, interface, or enum expected package com.rnstampy; ^ 1 error
this was my problem.
I moved [package com.rnstampy;] on the TOP. that's all.
It worked.

Error with Pushwoosh cordova plugin on Ionic

I just installed Pushwoosh cordova plugin on my Ionic project and now I can't run the app on my device to test.
Here are the official docs
If I run:
ionic cordova run android --consolelogs --device --livereload
I get:
:compileDebugJavaWithJavac
/media/ivan/SharedPartition/Trabajo/AnimaEdu/animaedu-mobile/platforms/android/src/com/pushwoosh/plugin/pushnotifications/PushNotifications.java:888: error: lambda expressions are not supported in -source 1.6
mainHandler.post(() -> webView.loadUrl("javascript:"+ url));
^
(use -source 8 or higher to enable lambda expressions)
1 error
FAILED
27 actionable tasks: 1 executed, 26 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 9s
(node:18368) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: /media/ivan/SharedPartition/Trabajo/AnimaEdu/animaedu-mobile/platforms/android/gradlew: Command failed with exit code 1 Error output:
/media/ivan/SharedPartition/Trabajo/AnimaEdu/animaedu-mobile/platforms/android/src/com/pushwoosh/plugin/pushnotifications/PushNotifications.java:888: error: lambda expressions are not supported in -source 1.6
mainHandler.post(() -> webView.loadUrl("javascript:"+ url));
^
(use -source 8 or higher to enable lambda expressions)
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.
> 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 9s
I don't understand the output.
Any ideas? Thank's in advance!
The problem is simple:
Error cause --> lambda expressions are not supported in -source 1.6
You are using JDK 1.6 while the code of this plugin need to compile on JDK 1.8 or greater.

Ionic Cordova Android build error

I'm trying to build an Android version of a "blank" project with IONIC, now i'm stuck with this error. Has anyone experienced this before, and what would your answer be?
FAILED
BUILD FAILED
Total time: 2.179 secs
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':CordovaLib:processDebugResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
Try:
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:
Execution failed for task ':CordovaLib:processDebugResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
[ERROR] An error occurred while running cordova build android (exit code 1).
The way i solved this problem is as below:
npm uninstall cordova ionic
npm install -g cordova#7.0.0 ionic#3.19.0
cordova platform rm android
cordova platform add android

Cordova build failed

I have installed Cordova but when I run $ cordova build in the terminal, it shows the following error. Please help me out.
BUILD FAILED
Total time: 8.645 secs
Error: /home/borsha/hello/platforms/android/gradlew: Command failed with exit code 1 Error output:
/home/borsha/hello/android-sdk-linux/build-tools/26.0.1/aapt: 1: /home/borsha/hello/android-sdk-linux/build-tools/26.0.1/aapt: Syntax error: ")" unexpected
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':CordovaLib:processDebugResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
UPDATE
BUILD FAILED
Total time: 2.799 secs
Error: /home/borsha/hello/platforms/android/gradlew: Command failed with exit code 1 Error output:
/home/borsha/hello/android-sdk-linux/build-tools/25.0.0/aapt: 3: /home/borsha/hello/android-sdk-linux/build-tools/25.0.0/aapt: Syntax error: Unterminated quoted string
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':CordovaLib:processDebugResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Try downgrading API level to 23.0.3. You can do that using Android SDK Manager and Android Studio or you can follow the instructions here.
Versions newer than 23.0.3 still have bugs.

FAILURE: Build failed with an exception build ionic

I am trying to build a IONIC project but I am facing this exception and I am not able to debug the solution for this.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> failed to find Build Tools revision 24.0.1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.
Error: Error code 1 for command: cmd with args: /s,/c,"C:\application\Qrioh\plat
forms\android\gradlew cdvBuildDebug -b C:\application\Qrioh\platforms\android\bu
ild.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"
Go to File > Project Structure > Select Module > Properties
Select Build Tools Version same as version selected in Compile Sdk Version.
Hope this will resolve your issue.

Categories

Resources