2

Does anybody use Kinvey as a Back End Service? I followed these steps to set it up: http://devcenter.kinvey.com/android/guides/getting-started

When I add Kinvey to my dependencies in my gradle file, I get a syntax error that states: Failed to resolve:kinvey-android-*:

Here is my build.gradle(Module:app) file:

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
    applicationId "com.markf.kinveytest"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}}

dependencies {
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'

compile fileTree(dir: 'libs', include: ['*.jar'])
compile(name:'kinvey-android-*', ext:'aar')}

Here is a screenshot:

enter image description here

Does anybody know why? Thank you.

Mark F
  • 1,523
  • 3
  • 23
  • 41

4 Answers4

1

Currently, you can resolve this issue by giving the exact filename of the aar in your build.gradle file. E.g. compile(name:'kinvey-android-2.10.4', ext:'aar')

The "kinvey-android-*" is supposed to resolve to the latest kinvey SDK available in the libs folder, so that you won't need to change the build.gradle file every time you upgrade to latest Kinvey SDK. But, I am not sure why that doesn't work with Android Studio for aar files right now.

Wani
  • 86
  • 1
1

I faced the same issue and just found out how to fix it.

1. Go to yourprojectfolder/app/libs

2. Check the name of the kinvey library. In my case it is kinvey-android-2.10.5

3. Add this to your build.gradle file

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])

    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile(name:'kinvey-android-2.10.5', ext:'jar')
    }
Vivek Mishra
  • 5,669
  • 9
  • 46
  • 84
Long Dao
  • 1,341
  • 4
  • 15
  • 33
0

You are also missing

repositories {
jcenter()
flatDir {
    dirs 'libs'
}

in your gradle file. my grade file would not build until that was added.You can add it right before dependencies.

0

Update - Kinvey v2 is deprecated and will be cut of on November 2017.

I am using kinvey in my app and migrating from v2 to v3 solved all issues which I had.

After dowloading v3 library and putting it into libs folder you have to do this:

compile ':kinvey-android:+@aar'
compile ':relinker:+@aar'
compile ':realm-android-library:+@aar'

That's it, you are on v3 - now you only need to go through code migration changes from v2 to v3 and IT IS ON !

Giedrius Šlikas
  • 1,073
  • 12
  • 12