tango4567 / solutions

Here I am adding lots of different stuff. This is the collection of problems with their solutions. Most important please share good vibes and correct me if you found anything wrong here. Thanks in advance.
Apache License 2.0
5 stars 0 forks source link

FAILURE: Build failed with an exception. Flutter #61

Closed tango4567 closed 1 year ago

tango4567 commented 1 year ago
tango@jega:~/Coding/FlutterProjects/humanity_calls$ flutter run
Downloading android-arm-profile/linux-x64 tools...               2,185ms
Downloading android-arm-release/linux-x64 tools...               1,027ms
Downloading android-arm64-profile/linux-x64 tools...             2,209ms
Downloading android-arm64-release/linux-x64 tools...             1,928ms
Downloading android-x64-profile/linux-x64 tools...               1,868ms
Downloading android-x64-release/linux-x64 tools...               1,213ms
Resolving dependencies... (3.1s)
> collection 1.17.2 (was 1.17.1) (1.18.0 available)
> matcher 0.12.16 (was 0.12.15)
> material_color_utilities 0.5.0 (was 0.2.0) (0.8.0 available)
> source_span 1.10.0 (was 1.9.1)
  stack_trace 1.11.0 (1.11.1 available)
  stream_channel 2.1.1 (2.1.2 available)
> test_api 0.6.0 (was 0.5.1) (0.6.1 available)
+ web 0.1.4-beta
These packages are no longer being depended on:
- js 0.6.7
Changed 7 dependencies!
Launching lib/main.dart on SM A707F in debug mode...

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 /home/jega/.gradle/caches/modules-2/metadata-2.99/descriptors/com.android.tools/sdk-common/30.3.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

BUILD FAILED in 15s
Running Gradle task 'assembleDebug'...                             16.0s
Exception: Gradle task assembleDebug failed with exit code 1

tango@jega:~/Coding/FlutterProjects/humanity_calls$ flutter doctor -v
[✓] Flutter (Channel stable, 3.13.0, on Ubuntu 22.04.3 LTS 5.15.0-78-generic, locale en_US.UTF-8)
    • Flutter version 3.13.0 on channel stable at /home/jega/snap/flutter/common/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision efbf63d9c6 (2 days ago), 2023-08-15 21:05:06 -0500
    • Engine revision 1ac611c64e
    • Dart version 3.1.0
    • DevTools version 2.25.0
tango4567 commented 1 year ago

For more details follow this solution 👉 StackoverFlow

  1. I changed the distribution URL present inside gradle-wrapper.properties file: in my case > distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip change to >distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
  2. Then removed the following plugin present inside the build.gradle (app module) apply plugin: 'com.google.gms.google-services'
  3. Finally added this line to the main/AndroidManifest.xml to the activity section: android:exported="true"