Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20. in flutter [closed] - android

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 months ago.
This post was edited and submitted for review 2 months ago and failed to reopen the post:
Original close reason(s) were not resolved
Improve this question
When I run flutter run I get this error:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':assets_audio_player'.
> Could not resolve all artifacts for configuration ':assets_audio_player:classpath'.
> Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20.
gradle-wrapper.properties:
distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip
Update
app/build.gradle:

Could you try to update the Gradle Wrapper to 7.6 and Kotlin to 1.7.10 (or 1.7.20) ?
https://docs.gradle.org/current/userguide/compatibility.html
Also
classpath 'com.android.tools.build:gradle:3.5.4'
is pretty old
try
classpath 'com.android.tools.build:gradle:7.1.2'
You need to ensure that the Gradle Wrapper, Kotlin Version and all those plugins you are using or adding to your classpath, are compatible to each other otherwise you might get weird erros.

Have you tried upgrading your kotlin version?
ext.kotlin_version = '1.7.20'

Related

react-native Could not HEAD 'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml' [duplicate]

This question already has answers here:
JCenter deprecation; impact on Gradle and Android
(10 answers)
Closed 4 months ago.
I created build yesterday and it was working fine . but when I try to create the release build today I got this. some if the question that are already asked here
Question No 1:
Question No 2:
These question are specfic to android and new user of react-native can't understand them easily. so thats why i nam asking another question here specific for react-native users.
The question i mentioned above has answer which help in some specific cases but when it comes to react native in some cases it does nit help, like for some of the dependincies in node_modules.
The Above explination is added beacuse the question was marked as duplicate.
The build will continue, but you are strongly encouraged to update your project to
use a newer Android Gradle Plugin that has been tested with compileSdk = 33
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':react-native-community_masked-view:verifyReleaseResources'.
> Could not resolve all task dependencies for configuration ':react-native-community_masked-view:releaseRuntimeClasspath'.
> Could not resolve com.facebook.react:react-native:+.
Required by:
project :react-native-community_masked-view
> Failed to list versions for com.facebook.react:react-native.
> Unable to load Maven meta-data from https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/com/facebook/react/react-native/maven-metadata.xml'.
> Read timed out
* 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.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 2m 45s
5 actionable tasks: 5 up-to-date
I think the issue is due to jcenter deprecation . any possible solution or alternative of jcenter. this is specific for react-native projects where there are many dependencies and you have to change.
From Hours of research if finally found that. this is an issue due to jcenter is down.
According to official documentation the jcenter depricated and Bintray/JCenter users should start migrating to a new hosting solution.
the solution for this is to remove jcenter from build file and replace it with
mavenCentral() // <- add it
for react-native users jcenter() may be exists in some depedency that you installed recently. to check for jcenter open your project in android-studio to check all build.gradle files easliy.
Another solution for this is that disconnect your system from internet and build your project. after you lanuc your project reconnect your system to internet.
jcenter is down so until it comes online a temporary solution is just to disconnect from the internet and build your project, once the build is complete and the app launches you can connect back.
The problem comes from the shutdown of jcenter. Event if you remove the repository for your app, you'll get errors if some of your declare jcenter().
The best way would be to have PRs merged and version update of those dependencies, but that might take a while.
In the meantime you can add the following in your android/build.gradle :
allprojects {
repositories {
all { ArtifactRepository repo ->
if (repo instanceof MavenArtifactRepository) {
if (repo.url.toString().startsWith('https://jcenter.bintray.com/')) {
remove repo
add(mavenCentral())
}
}
}
...
This fixed all my builds.
The solution from #PhilippeAuriach is fixing it for react-native !
I Added this :
allprojects {
repositories {
all { ArtifactRepository repo ->
if (repo instanceof MavenArtifactRepository) {
if (repo.url.toString().startsWith('https://jcenter.bintray.com/')) {
remove repo
add(mavenCentral())
}
}
}
To my android/build.gradle and worked fine after hours of research !
(Thanks #PhilippeAuriach)

Flutter Android build not generating in Mac

In Mac, I've setup Flutter in Android studio. When I'm running project it gives me error
* What went wrong:
Execution failed for task ':location:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error. See log for more details
I'm using all latest versions of Flutter, Kotlin, Gradle etc.
You need to equalize kotlin version in first row which is ext.kotlin_version = '1.6.10' to according to classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" of underlined $kotlin_version
After this, the problem will solve...
Actually I found a solution for my problem. There are 2 dependency defined in .yaml file 1. geo_location and 2. location.
After removing the location dependency from .yaml file and run command flutter pub get I can successfully build android build from Mac. This solution might not be global but solution of my problem I found this.
Thank you!
Happy coding.

Problem Android Studio - failed to resolve com.android.support appcompat-v7 29 [duplicate]

This question already has answers here:
Android Studio keeps refusing to resolve com.android.support:appcompat-v7:29.0.1
(6 answers)
Closed 3 years ago.
I'm trying to start a course with Android Studio 2.2.1, but when I create a new project I come upon the error message:
failed to resolve com.android.support appcompat-v7 29
Also my Mainactivity.java gives me the error:
Method does not override method from superclass.
I've tried to add the Maven URL, but with no luck.
When I try to rebuild the project I get:
Error:A problem occurred configuring project ':app'. Could not resolve
all dependencies for configuration ':app:_debugApkCopy'. Could not
find any version that matches com.android.support:appcompat-v7:29.+.
Versions that do not match:
26.0.0-alpha1
25.3.1
25.3.0
25.2.0
25.1.1
+ 31 more Required by: DemoAppTwo:app:unspecified
Does anybody know a solution for this, so that I can start learning to code in android please?
Thanks in advance!
Kind regards,
KevinDP
That is not a version of the support library that exists - the last version was 28 (and it has since been replaced).
You should download the latest version of Android Studio (currently 3.5.3) from the Android Developers website and start again with that. It will create the new project for you with the correct dependencies.

Android Studio - "aidl is missing"... no, it's not [duplicate]

This question already has answers here:
Execution failed for task ':app:compileDebugAidl': aidl is missing
(14 answers)
Closed 7 years ago.
I followed this guide to try and fix this error...
"Error:Execution failed for task ':app:compileDebugAidl'.
aidl is missing"
I put "IInAppBillingService.aidl" in "app/src/main/aidl/com.android.vending.billing" and when I rebuild the project, the error is still there. I've restarted Android Studio multiple times... it just won't fix, I've followed the guide to the letter, it's worked for everyone else...
Could anyone help please?
For anybody getting this error, see the suggestion provided in the comments above by CommonsWare. Downgrade your SDK Build Tools to 22.0.1, it's 23.0.0_rc1 by default.
Changing the Build Tools Version from 23.0.0 rc1 to 22.0.1 in the Project Structure, then Clean and Rebuild worked for me.
If you changed the build tools and the problem wasn't fixed, try cleaning and rebuilding, and maybe closing Android Studio and reopening it.
To build your application without aidl is missing error with compileSdkVersion 23 and buildToolsVersion "23.0.1" you should specify latest versions for Android and Google Play Services (only if you are using them) Gradle plugins in main build.gradle file:
buildscript {
repositories {
...
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
classpath 'com.google.gms:google-services:1.3.1'
}
}

Android Studio, Gradle Update error [duplicate]

This question already has answers here:
Android-Studio upgraded from 0.1.9 to 0.2.0 causing gradle build errors now
(7 answers)
Closed 9 years ago.
I recently updated Android Studio to version 0.2, and now when I build my code, I get this error, Please tell me how to overcome this.
Gradle 'NewProject' project refresh failed:
Project is using an old version of the Android Gradle plug-in. The
minimum supported version is 0.5.0. Please update the version of
the dependency 'com.android.tools.build:gradle' in your build.gradle
files. Search in build.gradle files (show balloon)
Its a reported issue in Android Studio Build #AI-130.737825, built on July 11, 2013. Luckily, there is a workaround that you can do to fix this import issue.
Externally edit the project's build.gradle file, changing 'com.android.tools.build:gradle:0.4.2' to 'com.android.tools.build:gradle:0.5.+'
Here is the link to the issue
Go to your
build.gradle
file and replace the string
'com.android.tools.build:gradle: (what you have here)'
with
'com.android.tools.build:gradle:0.5'

Categories

Resources