etsy/AndroidStaggeredGrid

Gradle Build in Android Studio

gitloko opened this issue · 8 comments

Hello, when i copy and paste these lines in android studio's gradle.build it tells me that it can't resolve it

repositories {
mavenCentral()
}

dependencies {
compile 'com.etsy.android.grid:library:22.0.0' // read below comment
}

@lokmansahraoui There is no version 22.0.0 for this library
If you look at the Change Log the latest is version 1.0.5

thank you, i just figured all out by implementing the /library folder as a module on android studio, well when i call an object like : private StaggerdGridView mSGridView and then call it in my java from the layout with mSGridView = (StaggeredGridView) rootView.findViewById(R.id.grid_view);

Knowing that in my XML layout i added
<com.etsy.android.grid.StaggeredGridView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/grid_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:item_margin="8dp"
app:column_count="@integer/column_count" />

it tells me uknown app:item_margin and app:column_count in my package

Make sure you copy over the attr.xml attributes file.

You should really consider just including the library dependency instead of copying over files to your project in a module. That way you can be up-to-date with any improvements to this library.

Just add this to your dependency instead compile 'com.etsy.android.grid:library:1.0.5'. It will save you a ton of hassle

So i delete the imported module (/library) and add
compile 'com.etsy.android.grid:library:1.0.5'
in my app's Build.Gradle dependencies and that's it ?

yes it's that simple :)

:( same result as when i put 22.0.0 yesterday, i'm using the app:Build.gradle
C:\Users\Lokman\AndroidStudioProjects\TryOuts\app\build.gradle
Error:(26, 13) Failed to resolve: com.etsy.android.grid:library:1.0.5
Show in File
Show in Project Structure dialog

at LAst ! :D ! the problem was in my android studio beacause of the update the offline mode was activated, it was like i hadn't internet connection :)

just went to File/Settings/Gradle...; and then unchecked offline mode

I am facing the same problem. None of the solutions are working for me.
Error:Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.etsy.android.grid:library:1.0.5.