Кажется, что onedrive-sdk-android библиотека больше не поддерживается, потому что последняя фиксация произошла 2 года назад.
Проблема: Ваш код для импорта зависимостей неверен, поэтому Gradle выдает ошибку.
Решение: Выполните следующие шаги.
Шаг 1: Удалите следующую строку из файла Gradle
repository {
jcenter()
}
dependency {
// Include the sdk as a dependency
compile ('com.onedrive.sdk:onedrive-sdk-android:1.3+') {
transitive = false
}
// Include the gson dependency
compile ('com.google.code.gson:gson:2.3.1')
// Include supported authentication methods for your application
compile ('com.microsoft.services.msa:msa-auth:0.8.+')
compile ('com.microsoft.aad:adal:1.1.+')
}
Шаг 2: Переместить строку всех зависимостей в блок dependencies
.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
// Include the sdk as a dependency
implementation ('com.onedrive.sdk:onedrive-sdk-android:1.3+') {
transitive = false
}
// Include the gson dependency
implementation ('com.google.code.gson:gson:2.3.1')
// Include supported authentication methods for your application
implementation ('com.microsoft.services.msa:msa-auth:0.8.+')
implementation ('com.microsoft.aad:adal:1.1.+')
}
Соберите все вместе, ваш файл Gradle будет выглядеть как
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.onedrivesdkapp"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
// Include the sdk as a dependency
implementation ('com.onedrive.sdk:onedrive-sdk-android:1.3+') {
transitive = false
}
// Include the gson dependency
implementation ('com.google.code.gson:gson:2.3.1')
// Include supported authentication methods for your application
implementation ('com.microsoft.services.msa:msa-auth:0.8.+')
implementation ('com.microsoft.aad:adal:1.1.+')
}