Android Studio Errorr - android-studio

I try to run flutter code on the android emulator but what I get is an error as below.
FAILURE: Build failed with an exception.
* What went wrong:
Could not write cache value to 'C:\Users\jaga\.gradle\daemon\5.6.2\registry.bin'.
* 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
Exception: Gradle task assembleDebug failed with exit code -1

Start
Type "cmd" + enter
cd to C:\Users\jaga.gradle\daemon\
Ctrl + A
Delete All
Restart Android Studio
Go To User -> Select user -> Gradle -> Daemon -> select version then select all and delete all
Then restart android studio.

Related

IONIC 5 capacitor build android error : Execution failed for task ':capacitor-android:compileDebugJavaWithJavac'

I get the below error when I want to run my ionic app on android studio by using cmd -> ionic capacitor build android
Can teach me how to solve the below errors so that I can run my application on android studio?
Thank You.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':capacitor-android:compileDebugJavaWithJavac'.
> Failed to query the value of task ':capacitor-android:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
> Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, C:..\node_modules\#capacitor\android\capacitor\build\generated\ap_generated_sources\debug\out)) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer#2cce4302) before task ':capacitor-android:compileDebugJavaWithJavac' has completed is not supported
* 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
Issue solved by updating the Gradle in Android Studio.
You must set version of Compile Sdk Version and Builds tools Version in File -> Project Structure -> app . set the values and it build self.

Can't run 'Pub get' and can't build flutter project

On Android Studio, I clone this flutter project. When prompted if I want to create a project for the sources downloaded, I click no. Then I click "open existing project", and select the project just downloaded.
Android Studio tells me that "Pub get has not been run". So I click "Get dependencies":
C:\src\flutter\flutter\bin\flutter.bat --no-color pub get
Running "flutter pub get" in dicee-flutter2... 3,0s
Process finished with exit code 0
After this, the highlighting in the code is corrected, so I guess the project recognizes flutter now. But the "Pub get has not been run" prompt never disappears.
Then I run my project, in order to see it in the virtual device, but I get the following error:
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'...
--output directory is required for assemble.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\src\flutter\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 896
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\src\flutter\flutter\bin\flutter.bat'' 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
BUILD FAILED in 2s
Exception: Gradle task assembleDebug failed with exit code 1
The output of flutter doctor is:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel master, 1.20.0-3.0.pre.78, on Microsoft Windows [versão 10.0.18362.356], locale pt-BR)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
[√] Android Studio (version 4.0)
[√] Connected device (1 available)
• No issues found!
How to fix that, so I can see the project on the virtual device and stop getting the "Pub get has not been run" prompt?
There is a setting in AS to set the output directory. From memory it's in the file | project settings menu.
This is possibly a separate issue to the pub get problem.
You can just run flutter pub get from the cli in the projects root directory.

Update gradle version from command line using Android command line tools

I have installed command-line tools (commandlinetools-linux-6200805_latest.zip) of Android Studio, and I want to update the gradle version to 6.2.
Any idea how I can do that?
In the UI I could just go to File -> Project structure.
Do I need the UI to do this?
tried to run: ./gradlew wrapper --gradle-version=6.2 --distribution-type=all
bash-4.2$ ./gradlew wrapper --gradle-version=6.2 --distribution-type=all
FAILURE: Build failed with an exception.
* Where:
Build file '/var/lib/jenkins/workspace/myapp/android/app/build.gradle' line: 3
* What went wrong:
An exception occurred applying plugin request [id: 'com.github.triplet.play', version: '2.7.5']
> Failed to apply plugin [class 'com.github.triplet.gradle.common.validation.RuntimeValidationPlugin']
> Gradle Play Publisher's minimum Gradle version is at least Gradle 6.2 and yours
is Gradle 5.6.4. Find the latest version at
https://github.com/gradle/gradle/releases/latest, then run
$ ./gradlew wrapper --gradle-version=$LATEST --distribution-type=ALL
* 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
If you are using the Gradle wrapper, you can simply run:
./gradlew wrapper --gradle-version=6.2
If you want to use a different distribution type than bin (default), you can add the distribution-type argument:
./gradlew wrapper --gradle-version=6.2 --distribution-type=all

Error on build and run flutter project after reinstall windows

when i install new windows on my computer and install and configure android studio unfortunately my project that i have build on previous windows got error on below and i don't know what is about?
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:signingConfigWriterDebug'.
> java.nio.file.AccessDeniedException:
E:\Project\Mobile_App\store\build\app\intermediates\signing_config\debug\out\signing-config.json
* 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 6s
Finished with error: Gradle task assembleDebug failed with exit code 1

:app:recordFilesBeforeBundleCommandDebug FAILED

Hello I am trying to run an application react-native on a remote desktop
when I run ./gradlew clean it is build successfully.
However I have an error when running ./gradlew assembleDebug
Error: ENOENT: no such file or directory, open 'C:\Users\user\AppData\Local\Temp;C:\Users\user\AppData\Local\Android\Sdk\platform-tools\adb.exe\CodePushResourcesMap-aab77707.json'
:app:recordFilesBeforeBundleCommandDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:recordFilesBeforeBundleCommandDebug'.
> Process 'command 'node'' 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.
BUILD FAILED
Total time: 10 mins 1.501 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
Redirect to android folder and then use gradlew clean.
1.cd android
2.gradlew clean
I resolved this issues by using this comment

Resources