Android Studio Error:Connection refused (Connection refused) - connection-refused

When I import a project (https://github.com/PhilJay/MPAndroidChart) AndroidStudio shows this error:
Error:Connection refused (Connection refused)
I've tried many things but I haven't been able to fix this error.
I'm using AndroidStudio 3.0 and Gradle 4.1. How can I fix this?

Set proper proxy setting if you use it, or comment out as following in the 'gradle.properties' file:
#systemProp.http.proxyHost=127.0.0.1
#systemProp.https.proxyHost=127.0.0.1
#systemProp.http.proxyPort=1080
#systemProp.https.proxyPort=1080

Try adding google() under allProjects and resync:
allprojects {
repositories {
jcenter()
mavenCentral()
google()
}
}
This should resolve the issue.

Related

A problem occurred configuring project ':uni_links'

I want to use uni_links package in my Flutter project but when I run it I get the following error.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':uni_links'.
> Could not resolve all files for configuration ':uni_links:classpath'.
> Could not resolve com.android.tools.build:gradle:3.5.3.
Required by:
project :uni_links
> Could not resolve com.android.tools.build:gradle:3.5.3.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.3/gradle-3.5.3.pom'. Received status code 403 from server: Forbidden
> Failed to notify project evaluation listener.
2
> Could not get unknown property 'android' for project ':uni_links' of type org.gradle.api.Project.
Can anyone help me with this?
To fix this issue check do you have google() repo in your project's level build.gradle file.
buildscript {
repositories {
jcenter()
google() //HAVE YOU MISS IT?
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
}
}
allprojects {
repositories {
jcenter()
google() //HAVE YOU MISS IT?
}
}

Could not resolve org.tensorflow:tensorflow-lite:+

I'm having trouble running my flutter app
I try several solutions but still has an error
seems that the problem is with the tflite
Execution failed for task ':app:checkDebugAarMetadata'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not resolve org.tensorflow:tensorflow-lite:+.
Required by:
project :app > project :flutter_tflite
> Failed to list versions for org.tensorflow:tensorflow-lite.
> Unable to load Maven meta-data from https://jcenter.bintray.com/org/tensorflow/tensorflow-lite/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/org/tensorflow/tensorflow-lite/maven-metadata.xml'.
> Read timed out
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}
allprojects {
repositories {
google()
mavenCentral()
}
I already fixed the issue.
what I did is change the
build.gradle
of the tflite plugin from jcenter() because jcenter is already been shutdown details here into mavenCentral().
you can change it directly in
C:\Users\flutter.pub-cache\hosted\pub.dartlang.org
locate the folder of tflite plugin you're using
and I set a default version of tflite so I can work with it offline Or online
some did also address the issue here in stack overflow here

Execution failed for task ':qr_code_scanner:compileDebugKotlin'

I installed everything I needed following the instructions in https://docs.flutter.dev/get-started/install/windows. I believe that there is an error in the code, please tell me how to fix it?
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
Here is the solution: Change the version of qr_code_scanner in pubsec.yaml to 1.0.0!
try update kotlin_version to 1.7.10
and update com.android.tools.build:gradle to last varsion
then
flutter clean && flutter pub get

Flutter Execution failed for task ':stack_appodeal_flutter:compileDebugKotlin'. >

I tried to integrate Appodeal into my Flutter Project using latest stack_appodeal_flutter 1.2.0 Package.
I followed their instruction still got this error. Appreciate any help.
this is my Android build gradle
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://artifactory.appodeal.com/appodeal" }
}
}
If you have added
dependencies {
...
implementation 'com.appodeal.ads:sdk:2.11.0.+'
...
}
this in your build.gradle (module: app), please remove that and run again. Their documentation in pub.dev is little misunderstanding.

Could not create an instance of type org.gradle.invocation.DefaultGradle

I'm unable to build and run my flutter project. Every time I run the project it gives me this error
FAILURE: Build failed with an exception.
What went wrong:
Could not create an instance of type org.gradle.invocation.DefaultGradle.
Could not configure services using GradleScopeCompileServices.configure().
I searched and tried the following solution but nothing has worked so far:
Clean & Build Project
Deleted .gradle & .dart_tools folder
Downgraded Gradle version
I'm using Android studio 4.2.1. Let me know if you need anything else. Thanks in advance!
I tried many solutions but the following worked for me:
Downgraded flutter version from 2.2.3 to 2.2.2
Deleted ~/.android folder and then run the flutter project. Everything worked just fine.
I am use Flutter 2.5, same issue.
set ./android/build.gradle file to newer version:
classpath 'com.android.tools.build:gradle:7.0.0'
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}