Flutter Error: Could not determine the dependencies of task ':app:compileDebugKotlin' - android

I got this error when I run my first flutter app in android studio. my emulator internet is connected and the airplane mode is off. I saw other similar question but none of them were like this error and they didn't help me. can anyone help me?
Launching lib\main.dart on sdk gphone x86 in debug mode...
Running Gradle task 'assembleDebug'...
Could not resolve compiler classpath. Check if Kotlin Gradle plugin repository is configured in project ':app'.
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugKotlin'.
> Could not resolve all files for configuration ':app:kotlinCompilerClasspath'.
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-common:1.3.50.
Required by:
project :app > org.jetbrains.kotlin:kotlin-compiler-embeddable:1.3.50 > org.jetbrains.kotlin:kotlin-stdlib:1.3.50
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-common:1.3.50.
> Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.50/kotlin-stdlib-common-1.3.50.pom'.
> Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.50/kotlin-stdlib-common-1.3.50.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-common:1.3.50.
> Could not get resource 'https://storage.googleapis.com/download.flutter.io/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.50/kotlin-stdlib-common-1.3.50.pom'.
> Could not GET 'https://storage.googleapis.com/download.flutter.io/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.50/kotlin-stdlib-common-1.3.50.pom'. Received status code 403 from server: Forbidden
...
if more details are required please tell me. thanks.

this is happen to me several times
have you try to build the gradle
cd android
./gradlew build
it will show the error more detail

Related

Could not resolve io.github.lizhangqu:coreprogress:1.0.2 in React Native during react-native-compressor installing

I am using react-native-0.70.6 and during the installation of react-native-compressor-1.6.1
I am getting an error when running npx react-native-run-android the error is
FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ':react-native-compressor:compileDebugAidl'.
Could not resolve all task dependencies for configuration ':react-native-compressor:debugCompileClasspath'.
Could not resolve io.github.lizhangqu:coreprogress:1.0.2.
Required by:
project :react-native-compressor
> Skipped due to earlier error
> Skipped due to earlier error
Please help to fix the error...

React Native suddenly throwing May 09 2022

I am currently working on a React Native project that has been previously worked on by other devs. it was compiling fine as before May 09 2022 then I tried to compile it now and it's now throwing
BUILD FAILED in 41s
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.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not resolve com.facebook.android:facebook-android-sdk:9.0.+.
Required by:
project :app > project :react-native-fbsdk-next
> Failed to list versions for com.facebook.android:facebook-android-sdk.
> Unable to load Maven meta-data from https://jcenter.bintray.com/com/facebook/android/facebook-android-sdk/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/com/facebook/android/facebook-android-sdk/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
No new packages were added, I even tried to revert to old commits just to confirm if it's package related and it still threw this error. Was there any changes or update with Maven recently? I have other devs that are on Mac and theirs seem to be compiling just fine
I am not an expert in react native, I only started using it and I also have the same issue from 9th may 2022. But I am able to fixed it.
You can follow the below steps and may be it will work for you too.
Open this file node_modules/react-native-fbsdk-next/android/build.gradle and change Line no 48 with below line
def FACEBOOK_SDK_VERSION = safeExtGet('facebookSdkVersion', '9.0.0')

Gradle threw an error while downloading artifacts from the network. Retrying to download... in android studio

When I try to build android app I get this error:
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:processTESTDebugResources'.
> Could not resolve all task dependencies for configuration ':app:TESTDebugRuntimeClasspath'.
> Could not resolve io.flutter:arm64_v8a_debug:1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.
Required by:
project :app
> Could not resolve io.flutter:arm64_v8a_debug:1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.
> Could not get resource 'https://google.bintray.com/exoplayer/io/flutter/arm64_v8a_debug/1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8/arm64_v8a_debug-1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.pom'.
> Could not GET 'https://google.bintray.com/exoplayer/io/flutter/arm64_v8a_debug/1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8/arm64_v8a_debug-1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.pom'. Received status code 502 from server: Bad Gateway
> Could not resolve io.flutter:x86_debug:1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.
Required by:
project :app
> Could not resolve io.flutter:x86_debug:1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.
> Could not get resource 'https://google.bintray.com/exoplayer/io/flutter/x86_debug/1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8/x86_debug-1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.pom'.
> Could not GET 'https://google.bintray.com/exoplayer/io/flutter/x86_debug/1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8/x86_debug-1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.pom'. Received status code 502 from server: Bad Gateway
> Could not resolve io.flutter:x86_64_debug:1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.
Required by:
project :app
> Could not resolve io.flutter:x86_64_debug:1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.
> Could not get resource 'https://google.bintray.com/exoplayer/io/flutter/x86_64_debug/1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8/x86_64_debug-1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.pom'.
> Could not GET 'https://google.bintray.com/exoplayer/io/flutter/x86_64_debug/1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8/x86_64_debug-1.0.0-40a99c595137e4b2f5b2efa8ff343ea23c1e16b8.pom'. Received status code 502 from server: Bad Gateway
* 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 7m 30s
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
I'm using Mac OS, flutter and android studio. I can build iOS app without any such error.How can I fix this?
I tried this one,
Go to flutter_app => android => gradle => wrapper directory
Delete gradle-wrapper.jar file
Open and edit gradle-wrapper.properties file
Change distributionUrl=https://services.gradle.org/distributions/gradle-x.x.x-all.zip to gradle-7.2-all.zip or latest
On terminal use flutter run command
But still I get the same error.
this is my android/build.gradle file:
As it says in stack trace, try to download dependencies from url https://google.bintray.com/ but get 502 http error. if you test this link on browser you'll get this error too. Refer to this link this might be temporary error from the repository.
you can also replace all your jcenter() from your repository closure in build.gradle with mavenCentral(). sync Gradle and build again.

Flutter: Execution failed for task ':background_location:verifyReleaseResources'

My app works fine when I run it or build app packages, but when I try to build apk for release or profile, it gives this message:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':background_location:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
> Android resource linking failed
ERROR:C:\Users\Misha\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\background_location-0.6.1\android\src\main\AndroidManifest.xml:10:9-15:37: AAPT: error: attribute android:foregroundServiceType not found.
I've already tried flutter clean and flutter pub cache repair, as well as updated my Gradle version. Also, I have AndroidX enabled.
Could somebody please help?
Update: I found a solution here

Flutter Build Error:Could not determine the dependencies of task ':app:compileDebugJavaWithJavac

Was working fine just before and after rebuilding the process was interrupted with a sudden restart, and after that this is the error showing up, I've tried every possible solution found on the internet.
I run v1.22.6 for the project.
FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
Could not resolve com.google.android.gms:play-services-ads-identifier:[15.0.0, 16.0.99].
Required by:
project :app > com.onesignal:OneSignal:3.15.7
> Failed to list versions for com.google.android.gms:play-services-ads-identifier.
> Unable to load Maven meta-data from https://google.bintray.com/exoplayer/com/google/android/gms/play-services-ads-identifier/maven-metadata.xml.
> Could not get resource 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-ads-identifier/maven-metadata.xml'.
> Could not GET 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-ads-identifier/maven-metadata.xml'. Received status code 403 from server: Forbidden
Could not resolve com.google.android.gms:play-services-basement:[15.0.1,16.0.0).
Required by:
project :app > com.google.android.gms:play-services-location:15.0.1
project :app > com.google.android.gms:play-services-places-placereport:15.0.1
> Failed to list versions for com.google.android.gms:play-services-basement.
> Unable to load Maven meta-data from https://google.bintray.com/exoplayer/com/google/android/gms/play-services-basement/maven-metadata.xml.
> Could not get resource 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-basement/maven-metadata.xml'.
> Could not GET 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-basement/maven-metadata.xml'. Received status code 403 from server: Forbidden
Could not resolve com.google.android.gms:play-services-tasks:[15.0.1,16.0.0).
Required by:
project :app > com.google.android.gms:play-services-location:15.0.1
> Failed to list versions for com.google.android.gms:play-services-tasks.
> Unable to load Maven meta-data from https://google.bintray.com/exoplayer/com/google/android/gms/play-services-tasks/maven-metadata.xml.
> Could not get resource 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-tasks/maven-metadata.xml'.
> Could not GET 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-tasks/maven-metadata.xml'. Received status code 403 from server: Forbidden
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 0s
Exception: Gradle task assembleDebug failed with exit code 1
Run Flutter Doctor, and check if it gives error related to android licenses? If yes than run flutter doctor --android-licenses. Just accept all and it should work.
Try changing the dependency versions in pubspec.yaml file that you recently added.
Then rebuild the project.
***.bintray.com 40X error is related to jFrog stop update the services in original domain.
repositories {
jcenter() // <-- remove this line
mavenCentral() // <-- add this line
}

Categories

Resources