2

Trying to integrate Snapchats login SDK. I've followed the instructions here:

https://docs.snapchat.com/docs/login-kit-android

So I've added the maven repository:

repositories {
   maven {
       url "https://storage.googleapis.com/snap-kit-build/maven"
   }
}

Added these dependencies:

dependencies {
   ...
   implementation([
           'com.snapchat.kit.sdk:login:1.6.5',
           'com.snapchat.kit.sdk:core:1.6.5'
   ])
}

And added this to filter out the transient x86 libraries:

defaultConfig {
  ndk {
    abiFilters 'armeabi-v7a', 'arm64-v8a'
  }
}

Gradle syncs fine, and I can access the SDK components in my code. But, when I try to build the app I get the following error message:

Could not find com.snapchat.kit.sdk:core:1.6.5.
Searched in the following locations:
  - https://dl.google.com/dl/android/maven2/com/snapchat/kit/sdk/core/1.6.5/core-1.6.5.pom
  - https://jcenter.bintray.com/com/snapchat/kit/sdk/core/1.6.5/core-1.6.5.pom
  - https://repo.maven.apache.org/maven2/com/snapchat/kit/sdk/core/1.6.5/core-1.6.5.pom
  - https://jitpack.io/com/snapchat/kit/sdk/core/1.6.5/core-1.6.5.pom
  - https://repo.adobe.com/nexus/content/repositories/releases/com/snapchat/kit/sdk/core/1.6.5/core-1.6.5.pom
  - https://maven.localytics.com/public/com/snapchat/kit/sdk/core/1.6.5/core-1.6.5.pom
Required by:
    project :<my project details>

Now, according to the official docs, it says:

Note: If you have trouble accessing Google (used in the link above), you can use our GitHub Maven repository with the following code block:

repositories {
   maven {
       url "https://raw.githubusercontent.com/Snap-Kit/release-maven/repo"
   }
}

I.e. use a different repo. So I've tried this but the error persists.

One other bit of confusing documentation which is stated at the top is:

To connect your app to Snapchat, your app must also have the following targets:

    Android support library version 22+
    Snapchat 10.34.0.0+

We do "target" the support library(s) of version 22+, but no idea what it means by "target Snapchat 10.34.0.0+" as I cannot find any library/dependency/SDK for Snapchat.

Can anyone help?

Thomas Cook
  • 4,371
  • 2
  • 25
  • 42

3 Answers3

2

@jjnunog's comment pointed this in the right direction. I had the same problem and fixed it by adding the repository entry to:

allprojects {
    repositories {
        ...
        maven {
            url "https://storage.googleapis.com/snap-kit-build/maven"
        }
    }
}

instead of creating a new top-level entry.

scwu
  • 21
  • 3
  • It's a true answer but didn't help me. In my case, it was in settings.gradle under the "dependencyResolutionManagement" section. – Valentin Yuryev Aug 26 '21 at 12:13
1

It seems you have a typo when you wrote the repositories on the first block. It's written url twice.

jjnunog
  • 171
  • 2
  • 7
  • Yes, that was a copy pasta problem (when I was formatting the question). I will edit the question, but it's not the cause of the issue. – Thomas Cook Dec 02 '20 at 11:15
  • My guess is that you're applying the `repositories` to a different scope. Otherwise you should have ```https://storage.googleapis.com/snap-kit-build/maven/com/snapchat/kit/sdk/core/1.6.5/core-1.6.5.pom``` as search location. – jjnunog Dec 09 '20 at 13:42
-1

I had to switch to previous version, then it worked.

 implementation 'com.snapchat.kit.sdk:creative:1.1.3'
Mandeep Singh
  • 857
  • 8
  • 13