4

In order to fetch the cwac-camera commonsware jar, I have this in build.grade:

dependencies {
    compile 'com.commonsware.cwac:camera:0.6.+'
}

when I try and compile, it gives me this:

Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
   > Could not find com.commonsware.cwac:camera:0.6.12.
     Searched in the following locations:
         https://jcenter.bintray.com/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.pom
         https://jcenter.bintray.com/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.jar
         file:/home/alex/android/android-sdk-linux/extras/android/m2repository/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.pom
         file:/home/alex/android/android-sdk-linux/extras/android/m2repository/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.jar
         file:/home/alex/android/android-sdk-linux/extras/google/m2repository/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.pom
         file:/home/alex/android/android-sdk-linux/extras/google/m2repository/com/commonsware/cwac/camera/0.6.12/camera-0.6.12.jar
     Required by:
         Cwac4:app:unspecified

so its looking in jcenter, and in a bunch of my home directory files and failing to find anything. I think it should look on github as I know there are releases here: https://github.com/commonsguy/cwac-camera/releases, so how can I tell it that?

additionally, when I manually include the jar in one of my home directories for instance, it compiles with no errors, but using import com.commonsware.camera..(anything basically) results in "could not resolve symbol commonsware" errors. I take this to mean that I can't just manually put it somewhere and that perhaps android studio needs to see it in an official repository for it to allow importing it. Is this correct?

NOTE: I know that this library is slated to be rewritten. I would like to use it anyways if possible.

BigBoy1337
  • 4,735
  • 16
  • 70
  • 138

2 Answers2

7

so how can I tell it that?

Quoting the current version of the documentation:

To integrate the core AAR, the Gradle recipe is:

repositories {
    maven {
        url "https://repo.commonsware.com.s3.amazonaws.com"
    }
}

dependencies {
    compile 'com.commonsware.cwac:camera:0.6.+'
}

You appear to have added the dependencies but did not update your repositories.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • oh I thought it was gradle or maven as in you choose between those 2. ok thanks! Ill try it later today – BigBoy1337 May 27 '15 at 18:22
  • @BigBoy1337: Here, `maven` is referring to a Maven-style artifact repository (as opposed to Apache Ivy or other repo structures). – CommonsWare May 27 '15 at 18:23
  • I have integrate this demo:https://github.com/jaydeepw/poly-picker and this show me error like fail to resolve com.commonsware.cwac:camera:0.6.+ – Rajat Oct 17 '16 at 12:13
  • @Rajat: CWAC-Camera has been discontinued. I do not recommend using any code that depends upon it. – CommonsWare Oct 17 '16 at 12:16
0

Use this

 repositories {
        maven { url 'https://repo.commonsware.com.s3.amazonaws.com' }
        maven { url 'https://jitpack.io' }    
        maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
    }
duggu
  • 37,851
  • 12
  • 116
  • 113
Krishna Patel
  • 157
  • 2
  • 6