It happened when I restarted my computer.
I turn on android studio, but I can't start the emulator.
Information:Gradle tasks [:app:assembleDebug]
Error:java.lang.RuntimeException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
Error:Execution failed for task ':app:mergeDebugResources'.
Error: java.lang.RuntimeException: com.google.gson.stream.MalformedJsonException: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
Information:BUILD FAILED in 1m 32s
Information:2 errors
Information:0 warnings
Information:See complete output in console
Related
While building an APK file using gradlew, I got this error:
[RUN_GRADLEW] > Task :react-native-community_datetimepicker:extractReleaseAnnotations FAILED
[RUN_GRADLEW] FAILURE: Build failed with an exception.
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
[RUN_GRADLEW] You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
[RUN_GRADLEW] See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
[RUN_GRADLEW] 45 actionable tasks: 45 executed
[RUN_GRADLEW] Execution failed for task ':react-native-community_datetimepicker:extractReleaseAnnotations'.
[RUN_GRADLEW] > Could not resolve all files for configuration ':react-native-community_datetimepicker:detachedConfiguration2'.
[RUN_GRADLEW] > Could not download intellij-core-30.1.1.jar (com.android.tools.external.com-intellij:intellij-core:30.1.1)
[RUN_GRADLEW] >
[RUN_GRADLEW] Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/intellij-core/30.1.1/intellij-core-30.1.1.jar'.
[RUN_GRADLEW] > Premature end of Content-Length delimited message body (expected: 19,697,471; received: 192,194)
Trying with curl gave the same problem:
curl --no-progress-meter https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/intellij-core/30.1.1/intellij-core-30.1.1.jar -o /dev/null
Output:
curl: (18) transfer closed with 19026883 bytes remaining to read
How to fix this?
I would like to run espresso tests on jenkins. I did configuration like here
https://www.perfectomobile.com/solutions/devtunnel/espresso-in-continuous-integration
I got error like below
C:\Windows\System32\config\systemprofile\.gradle\caches\transforms-1\files-
1.1\design-26.1.0.aar\a1a21cd8aba52bd546711d26a970dfcb\res\drawable-
v21\avd_hide_password.xml: error: file not found.
Error: java.util.concurrent.ExecutionException:
com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
:app:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Error: java.util.concurrent.ExecutionException:
com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs 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
10 actionable tasks: 9 executed, 1 up-to-date
Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Finished: FAILURE
Any sugestions what can be wrong?
This is happening because AAPT2 still has issues with long paths on windows (only supports paths up to 145 characters or so for now, sadly). This file path is around 170, so it's over that limit.
The issue should be fixed soon, in the meantime you can move your cache directory closer to the C: root.
I faced the same issue. The solution proposed here helped.
Simply add enviornmental variable GRADLE_USER_HOME
env GRADLE_USER_HOME= ${WORKSPACE}/gh
Note: Make sure gh is close to the main drive location
Information:
Gradle tasks [:app:assembleDebug]
C:\Users\davis\AndroidStudioProjects\tester\app\src\main\res\values\dimens.xml
Error:Error: Found item Dimension/abc_alert_dialog_button_bar_height
more than one time
Error:Execution failed for task ':app:mergeDebugResources'.
C:\Users\davis\AndroidStudioProjects\tester\app\src\main\res\values\dimens.xml:
Error: Found item Dimension/abc_alert_dialog_button_bar_height more
than one time
Information:BUILD FAILED
Information:Total time: 6.044 secs Information:2 errors Information:0
warnings Information:See complete output in console
Please suggest me any IDE or a solution.
Do what the error says.
The item abc_alert_dialog_button_bar_height is defined twice in dimens.xml. So go to dimens.xml and remove one abc_alert_dialog_button_bar_height
Error coming while trying to build the project
Whenever I am trying to build my android studio project the following error comes:
Information:Gradle tasks [clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources]
Error:java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
Error:Execution failed for task ':app:mergeDebugResources'.
Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
Information:BUILD FAILED
Information:Total time: 37.323 secs
Information:2 errors
Information:0 warnings
Information:See complete output in console
Anyone facing or resloved same kind of issue?
you can solve this by separating into smaller bucket of task
build assembleDebug
test
connectedAndroidTest
i had issues, when i ran assembleDebug and test together in Jenkins as a single task
I have converted Eclipse project into studio (.gradle file),import this project into studio i got below error,please help me to solve this problem.
Error:Error: Duplicate resources: E:\workspace\application\res\values\setting_color.xml:color/default_bg, E:\workspace\application\res\values\colors.xml:color/default_bg
:ApplicationFAILED
Information:BUILD FAILED
Information:Total time: 19.189 secs
Information:2 errors
Information:0 warnings
Information:See complete output in console