issues to build APK react native app in Ubuntu [duplicate] - java

This question already has answers here:
Error:resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found
(4 answers)
Closed 4 years ago.
Configure project :react-native-vector-icons
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html
error: resource
android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found.
error: resource
android:style/TextAppearance.Material.Widget.Button.Colored not found.
/home/aras/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/37bde114cf44a5a3196253573d3981be/res/values-v26/values-v26.xml:9:5-12:13: AAPT: error: resource android:attr/colorError not found.
/home/aras/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/37bde114cf44a5a3196253573d3981be/res/values-v26/values-v26.xml:13:5-16:13: AAPT: error: resource android:attr/colorError not found.
/home/aras/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/37bde114cf44a5a3196253573d3981be/res/values-v26/values-v26.xml:17:5-93: AAPT: error: style attribute 'android:attr/keyboardNavigationCluster' not found.
/home/aras/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/37bde114cf44a5a3196253573d3981be/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/fontStyle not found.
/home/aras/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/37bde114cf44a5a3196253573d3981be/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/font not found.
/home/aras/.gradle/caches/transforms-1/files-1.1/appcompat-v7-27.1.1.aar/37bde114cf44a5a3196253573d3981be/res/values/values.xml:251:5-69: AAPT: error: resource android:attr/fontWeight not found.
error: failed linking references.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-user-agent:verifyReleaseResources'.
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. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
75 actionable tasks: 2 executed, 73 up-to-date

Check for gradle dependency for support library version mismatch in your all npm build.gradle.

Related

Error React Native run Android - Task :app:compileDebugJavaWithJavac FAILED

I have an app running perfectly on iOS but when I try to run on Android, I get the Task :app:compileDebugJavaWithJavac FAILED error, tried some internet solutions but nothing solved the problem. When I run npx react-native run-android I get the error below:
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
368 actionable tasks: 2 executed, 366 up-to-date
/Users/danieldobereiner/Documents/GitHub/Empatho-App-React-Native/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:120: error: cannot find symbol
new AppCenterReactNativeAnalyticsPackage(getApplication(), getResources().getString(com.empathoapp.R.string.appCenterAnalytics_whenToEnableAnalytics)),
^
symbol: variable appCenterAnalytics_whenToEnableAnalytics
location: class string
/Users/danieldobereiner/Documents/GitHub/Empatho-App-React-Native/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:121: error: cannot find symbol
new AppCenterReactNativeCrashesPackage(getApplication(), getResources().getString(com.empathoapp.R.string.appCenterCrashes_whenToSendCrashes)),
^
symbol: variable appCenterCrashes_whenToSendCrashes
location: class string
Note: /Users/danieldobereiner/Documents/GitHub/Empatho-App-React-Native/android/app/src/debug/java/com/empathoapp/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
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 1m 39s
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/danieldobereiner/Documents/GitHub/Empatho-App-React-Native/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:120: error: cannot find symbol
new AppCenterReactNativeAnalyticsPackage(getApplication(), getResources().getString(com.empathoapp.R.string.appCenterAnalytics_whenToEnableAnalytics)),
^
symbol: variable appCenterAnalytics_whenToEnableAnalytics
location: class string
/Users/danieldobereiner/Documents/GitHub/Empatho-App-React-Native/android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:121: error: cannot find symbol
new AppCenterReactNativeCrashesPackage(getApplication(), getResources().getString(com.empathoapp.R.string.appCenterCrashes_whenToSendCrashes)),
^
symbol: variable appCenterCrashes_whenToSendCrashes
location: class string
Note: /Users/danieldobereiner/Documents/GitHub/Empatho-App-React-Native/android/app/src/debug/java/com/empathoapp/ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.```
Tried to change JAVA PATH, I have no idea what could I do to fix that

error: The system cannot find the file specified. Jenkins

FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeProdDebugResources'.
Multiple task action failures occurred:
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
AAPT: C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins.jenkins\workspace\Test\app\build\intermediates\res\merged\prod\debug: error: The system cannot find the file specified. (2).
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
AAPT: C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins.jenkins\workspace\Test\app\build\intermediates\res\merged\prod\debug: error: The system cannot find the file specified. (2).
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
AAPT: C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins.jenkins\workspace\Test\app\build\intermediates\res\merged\prod\debug: error: The system cannot find the file specified. (2).
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
AAPT: C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins.jenkins\workspace\Test\app\build\intermediates\res\merged\prod\debug: error: The system cannot find the file specified. (2).
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
AAPT: C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins.jenkins\workspace\Test\app\build\intermediates\res\merged\prod\debug: error: The system cannot find the file specified. (2).
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
AAPT: C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins.jenkins\workspace\Test\app\build\intermediates\res\merged\prod\debug: error: The system cannot find the file specified. (2).
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
AAPT: C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins.jenkins\workspace\Test\app\build\intermediates\res\merged\prod\debug: error: The system cannot find the file specified. (2).
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource compilation failed
AAPT: C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins.jenkins\workspace\Test\app\build\intermediates\res\merged\prod\debug: error: The system cannot find the file specified. (2).
i used in jenkins next command: assembleDebug -g C:\gradle_home
How i can solve this problem?
because the input project file path is too long, aapt can't work corretly with it.
changing the project workspace dir of jenkins can fix this error.

Error after starting the empty activity in android

Please refer the error message given below.Every time I am starting an empty activity, I am getting the following error. This is my 6th time trying every possible solution out there.
Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar]
C:\Users\cheik\.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0.aar\396858f1c27f92ab2ca967b96e3a0da9\res\values-v28\values-v28.xml
Error:(9, 5) error: resource android:attr/dialogCornerRadius not found.
C:\Users\cheik\.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0.aar\396858f1c27f92ab2ca967b96e3a0da9\res\values\values.xml
Error:(1304, 5) error: resource android:attr/fontVariationSettings not found.
Error:(1304, 5) error: resource android:attr/ttcIndex not found.
C:\Users\cheik\OneDrive\Desktop\MYAPP\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml
Error:(11) error: resource android:attr/dialogCornerRadius not found.
Error:(7) resource android:attr/dialogCornerRadius not found.
Error:(11) resource android:attr/dialogCornerRadius not found.
C:\Users\cheik\OneDrive\Desktop\MYAPP\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml
Error:(514) resource android:attr/fontVariationSettings not found.
Error:(514) resource android:attr/ttcIndex not found.
Error:failed linking references.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt
Information:BUILD FAILED in 1s
Information:13 errors
Information:0 warnings
Information:See complete output in console
Experienced this issue a while ago with Android studio 3.5, have you tried to set:
compileSdkVersion 28 or compileSdkVersion 29 in my case, got to: app > build.gradle, this solved it for me.
you can also try to file > invalidate caches / restart
i noticed you're still on AppCompat 28 library, i suggest you migrate to AndroidX, Refactor > migrate to AndroidX

Execution failed for task ':compileGroovy'. org.springframework.security.authentication.encoding.PasswordEncoder

I have an issue with starting my project after the upgrade of IDEA.
Current error is the following:
CONFIGURE SUCCESSFUL in 2s
|Running application...
> Task :compileJava NO-SOURCE
startup failed:
General error during semantic analysis: java.lang.NoClassDefFoundError: org.springframework.security.authentication.encoding.PasswordEncoder
java.lang.RuntimeException: java.lang.NoClassDefFoundError: org.springframework.security.authentication.encoding.PasswordEncoder
at org.codehaus.groovy.control.CompilationUnit.convertUncaughtExceptionToCompilationError(CompilationUnit.java:1118)
at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1098)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:645)
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileGroovy'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':compileGroovy'.
> Task :compileGroovy FAILED
Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:207)
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
If I try to clean and run-app I get the following:
| Running application...
<-------------> 0% WAITING
IDLE
startup failed:
General error during semantic analysis: java.lang.NoClassDefFoundError: org.springframework.security.authentication.encoding.PasswordEncoder
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':compileGroovy'.
Compilation failed; see the compiler error output for details.
Tried everything I know, project settings, clean cache, invalidate cache and restart... nothing is helping.
I have found a solution:
grails.plugin.springsecurity.authentication.encoding.BCryptPasswordEncoder - using deprecated classes
class CryptoEncoderWrapper implements org.springframework.security.authentication.encoding.PasswordEncoder
you need to change build.gradle to:
compile 'org.grails.plugins:spring-security-core:4.0.0'
BCrypt now has this import
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
Now, this issue is resolved but leads to other issues.

SSL peer shut down incorrectly: Getting error in Android Studiio, while building build.gradle of libGDX

I am novice to libGDX, and while setting it for android studio, I encountered following issue:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'FirstGame'.
Could not resolve all dependencies for configuration ':classpath'.
Could not download robovm-dist-compiler.jar (org.robovm:robovm-dist-compiler:1.12.0)
Could not get resource 'https://repo1.maven.org/maven2/org/robovm/robovm-dist-compiler/1.12.0/robovm-dist-compiler-1.12.0.jar'.
SSL peer shut down incorrectly
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 3.93 secs
I followed the following steps:
https://github.com/libgdx/libgdx/wiki/Project-Setup-Gradle
But, getting the error:
Information:Gradle tasks [clean]
Download https://repo1.maven.org/maven2/org/robovm/robovm-dist-compiler/1.12.0/robovm-dist-compiler-1.12.0.jar
Error:A problem occurred configuring root project 'FirstGame'.
Could not resolve all dependencies for configuration ':classpath'.
Could not download robovm-dist-compiler.jar (org.robovm:robovm-dist-compiler:1.12.0)
Could not get resource 'https://repo1.maven.org/maven2/org/robovm/robovm-dist-compiler/1.12.0/robovm-dist-compiler-1.12.0.jar'.
SSL peer shut down incorrectly
Information:BUILD FAILED
Information:Total time: 3.93 secs
Information:1 error
Information:0 warnings
Information:See complete output in console

Categories

Resources