Android Studio could not find, download, attach code sources - android

I wanted to see CoroutineWorker (androidx.work:work-runtime-ktx:2.2.0) class code sources, but android studio (tried on versions: 4.1.3 and smaller) show decompiled version of that:
When I click download sources Gradle shows such error:
FAILURE: Build failed with an exception.
* Where:
Initialization script '/tmp/ijmiscinit4.gradle' line: 20
* What went wrong:
Execution failed for task ':app:DownloadSources'.
> Could not resolve all files for configuration ':app:downloadSources_2108a026-03c6-4d30-a902-3a53b9d5d155'.
> Could not find androidx.work:work-runtime-ktx:2.2.0#aar.
Required by:
project :app
* 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 1s
Could you please help what I am doing wrong here?
Second issue: even if sources are downloaded, AndroidStudio still won't attach them, here I've described that issue in detail.

Related

Android gradle Issue - Flutter Could not load compiled classes for script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' from cache

I have a problem with my Gradle Sync.
I use IntelliJ and Android Studio to build a Flutter / Dart App.
I create a project and simply run then it show error something like that.
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\Muhammad Asad Hameed\StudioProjects\videojson\android\app\build.gradle' line: 26
What went wrong:
A problem occurred evaluating project ':app'.
Could not load compiled classes for script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' from cache.
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 22s

Ionic Capacitor FCM , android build failing

I am stuck at the below issue for quite some time and its not getting resolved, had searched across stack overflow, google, but nothing is working for me. There's a workaround suggested on ionic portal, that too is not working. Please help me to resolve the issue.
I have tried to add google-services.json in android/app directory, then the 2nd issue comes, then why I tried to add the same file android/capacitor-cordova-android-plugins directory, then another issue comes stating:
Execution failed for task ':capacitor-cordova-android-plugins:processDebugGoogleServices'. No matching client found for package name 'capacitor.android.plugins'
Below is the original issue, when google-services.json, is not placed anywhere.
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
> File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
/Users/xxxx/development/projects/appName/android/app/google-services.json
/Users/xxxx/development/projects/appName/android/app/src/nullnull/google-services.json
/Users/xxxx/development/projects/appName/android/app/src/debug/google-services.json
/Users/xxxx/development/projects/appName/android/app/src/nullnullDebug/google-services.json
/Users/xxxx/development/projects/appName/android/app/src/nullnull/debug/google-services.json
/Users/xxxx/development/projects/appName/android/app/src/debug/nullnull/google-services.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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':capacitor-cordova-android-plugins:processDebugGoogleServices'.
> File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
/Users/xxxx/development/projects/appName/android/capacitor-cordova-android-plugins/google-services.json
/Users/xxxx/development/projects/appName/android/capacitor-cordova-android-plugins/src/nullnull/google-services.json
/Users/xxxx/development/projects/appName/android/capacitor-cordova-android-plugins/src/debug/google-services.json
/Users/xxxx/development/projects/appName/android/capacitor-cordova-android-plugins/src/nullnullDebug/google-services.json
/Users/xxxx/development/projects/appName/android/capacitor-cordova-android-plugins/src/nullnull/debug/google-services.json
/Users/xxxx/development/projects/appName/android/capacitor-cordova-android-plugins/src/debug/nullnull/google-services.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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 3s
118 actionable tasks: 22 executed, 96 up-to-date

why I have this error when I try to build apk of the project in flutter 'wrong Could not resolve all dependencies for configuration ':classpath'.'?

I followed a tutorial to install flutter with vs code now when I try to build the project apk je encounters this error below:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not load module metadata from C:\Users\Adeol\.gradle\caches\modules-2\metadata-2.96\descriptors\com.android.tools.ddms\ddmlib\27.1.0\11cd36a7dcab7d14d0c14c5e6c7582e3\descriptor.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
when I created a new project in flutter I wanted to test to see if it works with the default code in main.dart but I have this error above. Of course I searched on google and YouTube I tried to modify the version of the Gradle but without hope. Can you help me please?

How to resolve Gradle task assembleDebug failed with exit code 1 in my first flutter app?

I recently come from java and try to make my first app in flutter in android studio in windows 10.
I tried first sample code in my real android device and got this error.
I cant find proper after struggling 5 hours
In console get this error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:stripDebugDebugSymbols'.
> NDK at C:\Users\10\AppData\Local\Android\sdk\ndk-bundle did not have a source.properties file
* 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 1s
Exception: Gradle task assembleDebug failed with exit code 1
Looks like you are missing NDK installation. Please confirm if highlighted item is installed

Getting Error Build file '/Users/xxxxxxxx/Documents/Depoto/android/build.gradle' line: 42 in react-native-android

I am developing one sample application , iOS working fine, coming to android the app was not working.
FAILURE: Build failed with an exception.
* Where:
Build file '/Users/XXXXXXX/Documents/Depoto/android/build.gradle' line: 42
* What went wrong:
A problem occurred configuring project ':react-native-maps'.
> Android tasks have already been created.
This happens when calling android.applicationVariants,
android.libraryVariants or android.testVariants.
Once these methods are called, it is not possible to
continue configuring the model.
* 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
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/getting-started.html
Please give me suggest anyone!

Categories

Resources