gpt4 book ai didi

android - 错误 :Failed to resolve: com. squareup.sdk

转载 作者:行者123 更新时间:2023-11-29 00:55:13 27 4
gpt4 key购买 nike

所以我正在尝试通过 android studio 设置 Square Reader SDK,并且在尝试完成“配置构建依赖项”中的第 3 步时遇到此错误

我正在关注 https://docs.connect.squareup.com/payments/readersdk/build-on-android#step-2-configure-your-android-project-for-reader-sdk 上的 Square Reader SDK 文档

我的应用级build.gradle文件供引用:

    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'

如有任何帮助,我们将不胜感激。

编辑:我收到一个新错误:

    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

最佳答案

复制

看起来您的应用级 build.gradle 并未在 Square 存储库中查找 Reader SDK Artifact 。

我注释掉了the Square repository来自 Reader SDK Quick Start Sample Android App并得到了同样的错误。

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

修复

在您的应用级 build.gradle 文件中的 android{}dependencies{} block 之间,添加 Square 存储库。

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 {
// ...
}

关于android - 错误 :Failed to resolve: com. squareup.sdk,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55309543/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com