Build error in Android Studio for cloudsdk

Hi,
I am building a simple android mobile app using Android Studio. I am trying to include particle cloudsdk for android as per the documentation and adding the following in my module’s build.gradle:

dependencies {
compile fileTree(dir: ‘libs’, include: [’*.jar’])
compile 'com.android.support:appcompat-v7:22.1.1’
compile ‘io.particle:cloudsdk:0.1.3’
}

allprojects {
repositories {
jcenter()
}

But when I build it, I get the following error:

FAILURE: Build failed with an exception.

What went wrong:
A problem occurred configuring project ‘:app’.

Could not resolve all dependencies for configuration ‘:app:_debugCompile’.
Could not resolve io.particle:cloudsdk:0.1.3.
Required by:
MyTestApp1:app:unspecified
Could not resolve io.particle:cloudsdk:0.1.3.
Could not get resource ‘https://jcenter.bintray.com/io/particle/cloudsdk/0.1.3/cloudsdk-0.1.3.pom’.
Could not GET ‘https://jcenter.bintray.com/io/particle/cloudsdk/0.1.3/cloudsdk-0.1.3.pom’.
Connection to https://jcenter.bintray.com refused
Could not resolve io.particle:cloudsdk:0.1.3.
Could not get resource ‘https://jcenter.bintray.com/io/particle/cloudsdk/0.1.3/cloudsdk-0.1.3.pom’.
Could not GET ‘https://jcenter.bintray.com/io/particle/cloudsdk/0.1.3/cloudsdk-0.1.3.pom’.
Connection to https://jcenter.bintray.com refused

But if access that url (https://jcenter.bintray.com/io/particle/cloudsdk/0.1.3/cloudsdk-0.1.3.pom), I can connect from my browser without any issue.
Note that I have not yet calling any particle cloudsdk APIs as yet, just trying to include the sdk and build and once successful, I would start calling the particle cloud APIs.

Any idea, anyone, what might be going wrong here? Would really appreciate any help.

Thanks.

Realized that it’s the http proxy issue with Android Studio since I am behind a firewall.
I tried setting the auto proxy detection URL (used by my system/browsers, as provided by my company), but this didn’t help either. After applying the settings, check connection fails with time out.
I am using Android Studio 1.3.

So I believe this is rather Android IDE issue than a particle cloud sdk issue.

Anyway, if anyone has faced this issue and resolved already, please share the details.

Looks like I got most of my issues resolved, but getting the following which I think particle folks can comment better (the jar can’t be accessed from the browser as well, plus I tried with cloudsdk version ‘0.2.0’ as per latest doc):

Executing tasks: [clean, :app:compileDebugSources, :app:compileDebugAndroidTestSources]

Configuration on demand is an incubating feature.
Download https://jcenter.bintray.com/io/particle/cloudsdk/0.2.0/cloudsdk-0.2.0.pom
Download https://jcenter.bintray.com/com/squareup/okio/okio/1.6.0/okio-1.6.0.pom
Download https://jcenter.bintray.com/com/squareup/okio/okio-parent/1.6.0/okio-parent-1.6.0.pom
Download https://jcenter.bintray.com/com/squareup/okhttp/okhttp/2.5.0/okhttp-2.5.0.pom
Download https://jcenter.bintray.com/com/squareup/okhttp/parent/2.5.0/parent-2.5.0.pom
Download https://jcenter.bintray.com/com/squareup/okio/okio/1.6.0/okio-1.6.0.jar

FAILURE: Build failed with an exception.

*What went wrong:
A problem occurred configuring project ‘:app’.
Could not download guava.jar (com.google.guava:guava:18.0)
Could not get resource ‘https://jcenter.bintray.com/com/google/guava/guava/18.0/guava-18.0.jar’.
Could not GET ‘https://jcenter.bintray.com/com/google/guava/guava/18.0/guava-18.0.jar’.
d29vzk4ow07wi7.cloudfront.net

Is this build also broken in the main repo?
Any help/workaround would be very much appreciated.

Looks like this must be another proxy or other network problem of some kind? Running the clean & compileDebugSources tasks works fine for me, and trying to grab https://jcenter.bintray.com/com/google/guava/guava/18.0/guava-18.0.jar via a web browser works as expected, too.

As a workaround, you could try providing guava by downloading the jar via some other means, and then tossing it in /app/libs (which you’ll need to create, IIRC).

Hope that helps!

Thanks @jensck !
Surprisingly it just started working now and I can build my app successfully (and also downlaod the jar via browser which was not working earlier)!
I didn’t have to do anything at all … just tried after 1 day, that’s all.
So, I think that link was coincidentally down for a certain period when I was trying to access via browser and android studio. Funny though …:slight_smile:

Anyway, I can now move on to writing actual code using the cloudsdk.
Thanks again.

Great, glad to hear it! :slight_smile: