3

In my company behind our proxy i can't start a flutter project. I don't get gradle running.

I set this config into gradle.properties:

systemProp.http.proxyHost=http://my.company.com
systemProp.http.proxyPort=8080
systemProp.http.nonProxyHosts=127.0.0.1|localhost
systemProp.https.proxyHost=http://my.company.com
systemProp.https.proxyPort=8080
systemProp.https.nonProxyHosts=127.0.0.1|localhost

SSL encrypted traffic will be decrypted. We have self signed certificates on our proxy server. I don't find any way to tell gradle the path to my certs.pem file.

The stacktrace

Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
* Error running Gradle:
Exit code 1 from: C:\Users\i01002704\Documents\Projects\Android\time_tracker\android\gradlew.bat app:properties:

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all files for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:3.1.4.
     Required by:
         project :
      > Could not resolve com.android.tools.build:gradle:3.1.4.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.4/gradle-3.1.4.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.4/gradle-3.1.4.pom'.
               > http://my.company.com
      > Could not resolve com.android.tools.build:gradle:3.1.4.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.4/gradle-3.1.4.pom'.
            > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.4/gradle-3.1.4.pom'.
               > http://my.company.com
   > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.61.
     Required by:
         project :
      > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.61.
         > Could not get resource 'https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.61/kotlin-gradle-plugin-1.2.61.pom'.
            > Could not GET 'https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.61/kotlin-gradle-plugin-1.2.61.pom'.
               > http://my.company.com
      > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.61.
         > Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.61/kotlin-gradle-plugin-1.2.61.pom'.
            > Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.61/kotlin-gradle-plugin-1.2.61.pom'.
               > http://my.company.com

* 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 1s

Finished with error: Please review your Gradle project setup in the android/ folder.

1 Answer 1

1

edit gradle/wrapper/gradle-wrapper.properties and update to Gradle 4.4or 4.5:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.5-all.zip

also make sure the buildscript has repository google() added.

the documentation does not provide an option to set the certificate.

Sign up to request clarification or add additional context in comments.

3 Comments

I had to downgrade from 5.6.2 to 5.4.1 but anyway, your tip helped me much. I was looking for solution a few days. Thank you very much )
@ArtemSolovev The currently required version is rather Gradle 6.5 ...this depends on the version of Android Studio and the Gradle plugin; downgrading barely is the solution, but rather a workaround.
why do you escape colon in https\:// ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.