• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Build gradle problem

Paprenelle

Lurker
Hello,
I'm an beginner android developer and I have a problem when I want to build my application I've an alert and this alert tell me :

Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
> Could not resolve com.squareup:javawriter:2.1.1.
Required by:
Game:app:unspecified > com.android.support.test.espresso:espresso-core:2.2.1
> Could not resolve com.squareup:javawriter:2.1.1.
> Could not get resource 'https://jcenter.bintray.com/com/squareup/javawriter/2.1.1/javawriter-2.1.1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/squareup/javawriter/2.1.1/javawriter-2.1.1.pom'.
> Connect to jcenter.bintray.com:443 [jcenter.bintray.com/159.122.18.156] failed: Connection timed out: connect
> Could not resolve javax.inject:javax.inject:1.
Required by:
Game:app:unspecified > com.android.support.test.espresso:espresso-core:2.2.1
> Could not resolve javax.inject:javax.inject:1.
> Could not get resource 'https://jcenter.bintray.com/javax/inject/javax.inject/1/javax.inject-1.pom'.
> Could not GET 'https://jcenter.bintray.com/javax/inject/javax.inject/1/javax.inject-1.pom'.
> Connect to jcenter.bintray.com:443 [jcenter.bintray.com/159.122.18.156] failed: Connection timed out: connect
> Could not resolve org.hamcrest:hamcrest-library:1.3.
Required by:
Game:app:unspecified > com.android.support.test.espresso:espresso-core:2.2.1
> Could not resolve org.hamcrest:hamcrest-library:1.3.
> Could not get resource 'https://jcenter.bintray.com/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.pom'.
> Could not GET 'https://jcenter.bintray.com/org/hamcrest/hamcrest-library/1.3/hamcrest-library-1.3.pom'.
> Connect to jcenter.bintray.com:443 [jcenter.bintray.com/159.122.18.156] failed: Connection timed out: connect
> Could not resolve org.hamcrest:hamcrest-integration:1.3.
Required by:
Game:app:unspecified > com.android.support.test.espresso:espresso-core:2.2.1
> Could not resolve org.hamcrest:hamcrest-integration:1.3.
> Could not get resource 'https://jcenter.bintray.com/org/hamcrest/hamcrest-integration/1.3/hamcrest-integration-1.3.pom'.
> Could not GET 'https://jcenter.bintray.com/org/hamcrest/hamcrest-integration/1.3/hamcrest-integration-1.3.pom'.
> Connect to jcenter.bintray.com:443 [jcenter.bintray.com/159.122.18.156] failed: Connection timed out: connect
> Could not resolve com.google.code.findbugs:jsr305:2.0.1.
Required by:
Game:app:unspecified > com.android.support.test.espresso:espresso-core:2.2.1
> Could not resolve com.google.code.findbugs:jsr305:2.0.1.
> Could not get resource 'https://jcenter.bintray.com/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.pom'.
> Could not GET 'https://jcenter.bintray.com/com/google/code/findbugs/jsr305/2.0.1/jsr305-2.0.1.pom'.
> Connect to jcenter.bintray.com:443 [jcenter.bintray.com/159.122.18.156] failed: Connection timed out: connect
> Could not resolve javax.annotation:javax.annotation-api:1.2.
Required by:
Game:app:unspecified > com.android.support.test.espresso:espresso-core:2.2.1
> Could not resolve javax.annotation:javax.annotation-api:1.2.
> Could not get resource 'https://jcenter.bintray.com/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.pom'.
> Could not GET 'https://jcenter.bintray.com/javax/annotation/javax.annotation-api/1.2/javax.annotation-api-1.2.pom'.
> Connect to jcenter.bintray.com:443 [jcenter.bintray.com/159.122.18.156] failed: Connection timed out: connect

Can you help me please ?
Cordially Paprenelle.
 
Thanks I'm a new to the forum and I don't know where I do write this question ( Sorry for my english because I'm an French student ;) )
 
Thanks I'm a new to the forum and I don't know where I do write this question ( Sorry for my english because I'm an French student ;) )
You question is now in the right place.

You originally posted it in the Android Questions forum. I moved it to the Application Development forum and left a link in the old forum for 24 hours so you would be able to find it.

And don't worry about your English. We understand that English isn't everyone's first language. :)
 
Is this your application, or an app you downloaded and trying to build?

Please post the contents of your build.gradle file. Use [code][/code] tags
 
This is an application I create, just i helped about a code on a web site.

My code :

Code:
apply plugin: 'com.android.application'


android {
    compileSdkVersion 25
    buildToolsVersion "25.0.0"
    defaultConfig {
        applicationId "example.com.game"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    provided fileTree(includes: ['*.jar'], dir: 'libs')
    compile('com.android.support.test.espresso:espresso-core:2.2.1', {
        exclude(group: 'com.android.support', module: 'support-annotations')
    })
    provided 'com.android.support:appcompat-v7:25.0.1'
}
 
No thanks for the trick but when change the values for espresso and I build the project I have an other error. The error is : Failed to resolve : javax.inject:javax.inject:1
Failed to resolve : javax.annotation:javax.annotation-api:1.2
Error:Failed to resolve: com.google.code.findbugs:jsr305:2.0.1
Error:Failed to resolve: org.hamcrest:hamcrest-library:1.3
Error:Failed to resolve: org.hamcrest:hamcrest-integration:1.3
Error:Failed to resolve: com.squareup:javawriter:2.1.1
No such property: compileArgs for class: org.fradle.api.tasks.compile.CompileOptions
 
Last edited:
Actually, looking back to what I last used for automated UI testing, seems like I switched away from Espresso, to using UI Automator. I cannot recall, but maybe I had the same problems as you.

https://developer.android.com/topic/libraries/testing-support-library/index.html#UIAutomator

Here's what is in my build.grade:

Code:
dependencies {
   ...
    androidTestCompile 'junit:junit:4.12'
    //androidTestCompile 'com.android.support.test:runner:0.3'
    // Set this dependency to use JUnit 4 rules
    //androidTestCompile 'com.android.support.test:rules:0.3'
    // Set this dependency to build and run Espresso tests
    //androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2'
    // Set this dependency to build and run UI Automator tests
    androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
}
 
Oh I try this and I think is the solution but now I've an another error with my proxy :( the error tell me
" Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle."

I think android don't want to launch my application :D
 
Oh I try this and I think is the solution but now I've an another error with my proxy :( the error tell me
" Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle."

I think android don't want to launch my application :D

Well good that your build problems are fixed, but your secondary problem is impossible to answer without seeing your code.
 
Is the problem you described above, caused by your code which is trying to establish a network connection with a remote server? If so, we need to see the part of the code which is trying to connect.
 
Ok I copy and paste different part of my code and I paste this on a notepad ( sorry for the french commentary if you don't understrand I can traduce ;) )

I did not put the gradles files but if you want them I can give you the files.
 

Attachments

Back
Top Bottom