I am trying to import this project from GitHub: Connect SDK Android to my Android Studio project from this link https://github.com/ConnectSDK/Connect-SDK-Android following the instructions.
My project grade version is 8.0.0 and the Connect SDK library is using gradle version 4.0.1
When I try to compile the project I get this error:
A problem occurred evaluating project ':Connect-SDK-Android'. Build was configured to prefer settings repositories over project repositories but repository 'Google' was added by build file 'Connect-SDK-Android/build.gradle'
plugins {
id 'com.android.application'
}
android {
namespace 'urbanapps.testconnect'
compileSdk 33
defaultConfig {
applicationId "urbanapps.testconnect"
minSdk 24
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.5.0'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation project(':Connect-SDK-Android')
}
The buid.graddle file from Connect SDk is this:
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
}
apply plugin: 'com.android.library'
apply plugin: 'jacoco'
apply plugin: 'com.github.dcendents.android-maven'
group='com.github.ConnectSDK'
jacoco {
toolVersion = "0.7.1.201405082137"
}
task jacocoTestReport(type:JacocoReport, dependsOn: "check") {
group = "Reporting"
description = "Generate Jacoco coverage reports"
getClassDirectories().setFrom(
dir: 'build/intermediates/classes/debug',
excludes: ['**/R.class',
'**/R$*.class',
'**/*$ViewInjector*.*',
'**/BuildConfig.*',
'**/Manifest*.*']
)
additionalSourceDirs.from = android.sourceSets.main.java.srcDirs
sourceDirectories.from = android.sourceSets.main.java.srcDirs
executionData.from = 'build/jacoco/testDebug.exec'
reports {
xml.enabled = true
html.enabled = true
}
}
build.dependsOn jacocoTestReport
android {
compileSdkVersion 32
buildToolsVersion '30.0.3'
defaultConfig {
minSdkVersion 24
targetSdkVersion 32
}
packagingOptions {
exclude 'LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = [
'src',
'core/src',
'modules/google_cast/src',
'modules/firetv/src',
]
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['core/res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['core/jniLibs']
}
test {
java.srcDirs = [
'core/test/src',
'modules/google_cast/test/src',
'modules/firetv/test/src',
]
}
}
buildTypes {
debug {
testCoverageEnabled = true
}
release {
minifyEnabled false
}
}
android {
lintOptions {
abortOnError false
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
useLibrary 'org.apache.http.legacy'
ndkVersion "22.1.7171670"
}
android.testOptions.unitTests.all {
include '**/*Test.class'
}
dependencies {
implementation 'org.java-websocket:Java-WebSocket:1.5.0'
implementation 'javax.jmdns:jmdns:3.4.1'
implementation fileTree(dir: 'modules/firetv/libs', include: '*.jar')
implementation 'androidx.mediarouter:mediarouter:1.2.0'
implementation 'androidx.annotation:annotation:1.0.0'
implementation 'androidx.preference:preference:1.1.1'
implementation 'androidx.appcompat:appcompat:1.3.1' // 1.4.1 version doesn't support compile sdk 30
implementation 'com.googlecode.plist:dd-plist:1.23'
implementation 'com.nimbusds:srp6a:2.1.0'
implementation 'net.i2p.crypto:eddsa:0.3.0'
implementation 'com.google.android.gms:play-services-cast-framework:9.4.0'
implementation files('core/libs/lgcast-android-lib.jar')
testImplementation 'org.apache.maven:maven-ant-tasks:2.1.3'
testImplementation 'junit:junit:4.12'
testImplementation 'org.robolectric:robolectric:2.4'
testImplementation 'org.mockito:mockito-all:1.10.19'
testImplementation 'org.powermock:powermock-api-mockito:1.6.2'
testImplementation 'xmlunit:xmlunit:1.4'
}
apply from: 'maven-push.gradle'