What is the fix for could not resolve com.android.tools.build:gradle:4.0.1. in flutter vscode? - flutter

FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':audioplayers'.
Could not resolve all artifacts for configuration ':audioplayers:classpath'.
Could not resolve com.android.tools.build:gradle:4.0.1.
Required by:
project :audioplayers
> Could not resolve com.android.tools.build:gradle:4.0.1.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.0.1/gradle-4.0.1.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.0.1/gradle-4.0.1.pom'.
> The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.2/userguide/build_environment.html#gradle_system_properties
> Remote host terminated the handshake
Failed to notify project evaluation listener.
Could not get unknown property 'android' for project ':audioplayers' of type org.gradle.api.Project.
Could not find method implementation() for arguments [project ':path_provider'] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

Need to enable other protocol versions for fetching from Maven repo, add the following
allowInsecureProtocol = true
in your project build.gradle file
repositories {
google()
mavenCentral(){
allowInsecureProtocol = true
}
}

This error when happening the android studio can not update the Gradle file from their servers see this link to solve here

You may need to specify protocols other than TLSv1.1, TLSv1.2 in gradle.properties.
e.g.
TLSv1.0 SSLv1.0 ...
Example:
systemProp.https.protocols=TLSv1.0,SSLv1.0,SSLv2.0,SSLv3.0

Related

How do I tell this minecraft fabric mod to use modmenu-2.0.14?

I want to update this mod (https://github.com/LambdAurora/MCPatcherPatcher) to minecraft version 1.17.1, and I have learned much already. If you had asked me a week ago what gradle was or how github works, I would have given you a blank stare. I have come to a point where I'm stuck in updating this mod:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':fabric'.
> Could not resolve all dependencies for configuration ':fabric:modImplementation'.
> Could not find com.terraformersmc:modmenu:2.0.14.
Searched in the following locations:
- file:/C:/Users/thijm/.m2/repository/com/terraformersmc/modmenu/2.0.14/modmenu-2.0.14.pom
- https://repo.maven.apache.org/maven2/com/terraformersmc/modmenu/2.0.14/modmenu-2.0.14.pom
- https://aperlambda.github.io/maven/com/terraformersmc/modmenu/2.0.14/modmenu-2.0.14.pom
- file:/C:/Users/thijm/Desktop/test 1171/nieuw3/MCPatcherPatcher-main/.gradle/loom-cache/remapped_mods/com/terraformersmc/modmenu/2.0.14/modmenu-2.0.14.pom
- https://maven.fabricmc.net/com/terraformersmc/modmenu/2.0.14/modmenu-2.0.14.pom
- https://libraries.minecraft.net/com/terraformersmc/modmenu/2.0.14/modmenu-2.0.14.pom
- file:/C:/Users/thijm/.gradle/caches/fabric-loom/2.0.14/modmenu.jar
- file:/C:/Users/thijm/Desktop/test 1171/nieuw3/MCPatcherPatcher-main/.gradle/loom-cache/2.0.14/modmenu.jar
- https://server.bbkr.space/artifactory/libs-snapshot/com/terraformersmc/modmenu/2.0.14/modmenu-2.0.14.pom
Required by:
project :fabric
I think the mod needs this pom file [https://maven.terraformersmc.com/releases/com/terraformersmc/modmenu/2.0.14], but I don't know how to tell it where to find this file. I would really appriciate all help, thanks :)
You'll need to add the maven repository to the repositories section of your build.gradle file:
repositories {
maven {
url "https://maven.terraformersmc.com/releases"
}
}

Swift Package Manager failed extracting

I'm getting this Package Manager error, when switching to a different branch or cloning the project. Build fails and "Clean Build Folder" doesn't help.
Error:
failed extracting
'https://releases.amplify.aws/aws-sdk-ios/AWSConnect-2.26.6.zip'
which is required by binary target 'AWSConnect':
.../Library/Developer/Xcode/DerivedData/MyApp-cbgtlihuudupsqdzyjdbyvcwkilh/SourcePackages/artifacts/extract/AWSConnect
is not a directory
The following steps resolve the issue forcing all packages to download.
Product > Clean Build Folder
Delete DerivedData content (Preferences > Locations > Derived Data little arrow)
File > Packages > Reset Package Cache
Build
The Reset Package Cache step is the most important here. It forces all packages to download as if they where just added.
Another issue that can happen is if you have added a build configuration, make sure that you have replicated this build configuration name throughout all your in house libraries, frameworks and sub projects. If the project that uses your Library has no build configuration for the scheme you are building then it will not link and you will receive errors like:
failed extracting 'https://github.com/*.xcframework.zip' which is required by binary target 'BlahBlah': fchmod (file attributes) error: Operation not permitted

A problem occurred configuring project ':onesignal_flutter

FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':onesignal_flutter'.
Could not open proj remapped class cache for 2l1gu8tih6yuhcv6muthhswe2 (C:\Users\Asus.gradle\caches\5.6.2\scripts-remapped\build_16tcpowyxq2c9gqe2ghul7zlm\2l1gu8tih6yuhcv6muthhswe2\proj3e1f7b90744deb65198fe3e2308f45d5).
Could not open proj generic class cache for build file 'C:\src\flutter.pub-cache\hosted\pub.dartlang.org\onesignal_flutter-2.6.1\android\build.gradle' (C:\Users\Asus.gradle\caches\5.6.2\scripts\2l1gu8tih6yuhcv6muthhswe2\proj\proj3e1f7b90744deb65198fe3e2308f45d5).
> Unexpected lock protocol found in lock file. Expected 3, found 0.
Could not get unknown property 'android' for project ':onesignal_flutter' of type org.gradle.api.Project.
How can i fix this error

How to remedy error caused by guava: Program type already present: com.google.common.util.concurrent.internal.InternalFutures

An AAR library already uses com.google.guava.
If an app includes the following in its build.gradle:
api 'com.google.guava:guava:27.0-android'
Building the app generates the following error:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: ...
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: com.google.common.util.concurrent.internal.InternalFutures
If I do not include "api 'com.google.guava:guava:27.0-android'", the app can be built, but it has runtime error of java.lang.NoClassDefFoundError when it reaches the point of using the Guava method: Iterables.find
I had to update to version 27.0.1, at the time of writing they still haven't updated the README with this new version.
implementation 'com.google.guava:guava:27.0.1-android'
Since Guava 27.0, ListenableFuture is located in separate artifact, see the announcement. You can try two things (one at a time):
Exclude "listenablefuture" module (group "com.google.guava") and build your project again.
I don't know the AAR specifics, but it could be that 27.0-android doesn't work with AAR, so you should try 26.0-android instead.

Google service version conflict

When I use these two plugins in ionic 1
cordova-plugin-fcm
cordova-plugin-googleplus
then this type of error occurs:
BUILD FAILED in 1s
11 actionable tasks: 1 executed, 10 up-to-date
Error: /home/idiosys/ionic/seeCheckFolder/SeeCheck/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':processDebugGoogleServices'.
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.
What can be the reason for these errors?
remove fcm, google plus
then install firebase plugin (https://ionicframework.com/docs/native/firebase/)
then install google plus.
remove and re-add android platform. it is work with me (ionic2).
Note: firebase contains notification functions , also with badge number : )
1 - Remove the entry from build.gradle:
// PLUGIN GRADLE EXTENSIONS START
apply from: "cordova-plugin-fcm/poc-FCMPlugin.gradle"
// PLUGIN GRADLE EXTENSIONS END
2 - specify proper versions for all other dependencies in project.properties file like:
cordova.system.library.1=com.google.firebase:firebase-core:10.2.0
cordova.system.library.2=com.google.firebase:firebase-messaging:10.2.0
cordova.system.library.3=com.google.android.gms:play-services-auth:10.2.0
cordova.system.library.4=com.google.android.gms:play-services-identity:10.2.0
3 - And bottom of build.gradle file add this line:
apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
4 - Comment out all content of poc-fcmplugin.gradle file and instead of apply plugin: com.google.gms.googleservices.GoogleServicesPlugin use:
apply plugin: 'com.google.gms.google-services'
5 - Add classpath for google services in build.gradle classpath section like:
classpath 'com.google.gms:google-services:3.0.0'
Please refer to below mentioned app and make sure android dependencies are correct .
https://market.ionicframework.com/starters/ionic-google-plus-fcm-and-ad-banner
implementation "com.google.android.gms:play-services-auth:10.+"
implementation "com.google.android.gms:play-services-identity:10.+"
implementation "com.android.support:support-annotations:27.+"
implementation "com.google.firebase:firebase-core:10.+"
implementation "com.google.firebase:firebase-messaging:10.+"
implementation "com.google.android.gms:play-services-base:10.+"
implementation "com.google.android.gms:play-services-ads:10.+"