• 4
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Error:Failed to resolve: com.squareup.sdk

So I'm trying to set up the Square Reader SDK through android studio, and I run across this error when trying to complete the 3rd step in "Configure the build dependencies"

I'm following through the Square Reader SDK docs at https://docs.connect.squareup.com/payments/readersdk/build-on-android#step-2-configure-your-android-project-for-reader-sdk

My app-level build.gradle file for reference:

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.cedarrobots.cedarrestaurants3"
        minSdkVersion 21
        targetSdkVersion 26
        multiDexEnabled true
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dexOptions {
        // Ensures incremental builds remain fast
        preDexLibraries true
        // Required to build with Reader SDK
        jumboMode true
        // Required to build with Reader SDK
        keepRuntimeAnnotatedClasses false
    }
}

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

    def readerSdkVersion = "1.2.1"
    implementation "com.squareup.sdk.reader:reader-sdk-$SQUARE_READER_SDK_APPLICATION_ID:$readerSdkVersion"
    runtimeOnly "com.squareup.sdk.reader:reader-sdk-internals:$readerSdkVersion"

    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.google.firebase:firebase-database:16.0.1'
    implementation 'com.google.firebase:firebase-auth:16.0.1'
    compile 'com.github.siyamed:android-shape-imageview:0.9.+@aar'
    compile 'com.firebaseui:firebase-ui-database:1.1.1'
    compile 'com.google.firebase:firebase-core:16.0.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    testImplementation 'junit:junit:4.12'
}

apply plugin: 'com.google.gms.google-services'

Any help would be greatly appreciated.

Edit: I'm getting a new error:

    Error:Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not resolve com.squareup.sdk.reader:reader-sdk-{sq0idp-0alGJZsc2rS5fTIOTkPLsA}:1.2.1.
  Required by:
      project :app
   > Could not resolve com.squareup.sdk.reader:reader-sdk-{sq0idp-0alGJZsc2rS5fTIOTkPLsA}:1.2.1.
      > Could not get resource 'https://sdk.squareup.com/android/com/squareup/sdk/reader/reader-sdk-%7Bsq0idp-0alGJZsc2rS5fTIOTkPLsA%7D/1.2.1/reader-sdk-%7Bsq0idp-0alGJZsc2rS5fTIOTkPLsA%7D-1.2.1.pom'.
         > Could not GET 'https://sdk.squareup.com/android/com/squareup/sdk/reader/reader-sdk-%7Bsq0idp-0alGJZsc2rS5fTIOTkPLsA%7D/1.2.1/reader-sdk-%7Bsq0idp-0alGJZsc2rS5fTIOTkPLsA%7D-1.2.1.pom'. Received status code 401 from server: Unauthorized

Repro

It looks like your app-level build.gradle isn't looking in the Square repository for the Reader SDK artifact.

I commented out the Square repository from the Reader SDK Quick Start Sample Android App and got the same error.

ERROR: Failed to resolve: com.squareup.sdk.reader:reader-sdk-...

Fix

Between the android {} and dependencies {} blocks in your app-level build.gradle file, add the Square repository.

android {
 // ...
}

repositories {
  google()
  maven {
    url "https://sdk.squareup.com/android"
    credentials {
      username SQUARE_READER_SDK_APPLICATION_ID
      password SQUARE_READER_SDK_REPOSITORY_PASSWORD
    }
  }
  jcenter()
}

dependencies {
  // ...
}
  • 1
Reply Report
      • 2
    • Remove the { and } from where you set your application ID. Instead of {sq0idp-0alGJZsc2rS5fTIOTkPLsA}, it should be sq0idp-0alGJZsc2rS5fTIOTkPLsA.