I am trying to integrate a third party android SDK in my Flutter project. After many trouble shooting, code probably is going to look like a Frankestein, I do not understand what I am missing or doing wrong. I keep getting the following error:
<code> - https://repo.maven.apache.org/maven2/io/flutter/x86_64_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_64_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
- https://jitpack.io/io/flutter/x86_64_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_64_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
- https://plugins.gradle.org/m2/io/flutter/x86_64_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_64_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
Required by:
project :app
> Could not find io.flutter:x86_debug:1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.
Searched in the following locations:
- https://jcenter.bintray.com/io/flutter/x86_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
- https://dl.google.com/dl/android/maven2/io/flutter/x86_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
- https://repo.maven.apache.org/maven2/io/flutter/x86_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
- https://jitpack.io/io/flutter/x86_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
- https://plugins.gradle.org/m2/io/flutter/x86_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
Required by:
project :app
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 11s
Error: Gradle task assembleDebug failed with exit code 1
</code>
<code> - https://repo.maven.apache.org/maven2/io/flutter/x86_64_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_64_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
- https://jitpack.io/io/flutter/x86_64_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_64_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
- https://plugins.gradle.org/m2/io/flutter/x86_64_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_64_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
Required by:
project :app
> Could not find io.flutter:x86_debug:1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.
Searched in the following locations:
- https://jcenter.bintray.com/io/flutter/x86_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
- https://dl.google.com/dl/android/maven2/io/flutter/x86_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
- https://repo.maven.apache.org/maven2/io/flutter/x86_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
- https://jitpack.io/io/flutter/x86_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
- https://plugins.gradle.org/m2/io/flutter/x86_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
Required by:
project :app
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 11s
Error: Gradle task assembleDebug failed with exit code 1
</code>
- https://repo.maven.apache.org/maven2/io/flutter/x86_64_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_64_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
- https://jitpack.io/io/flutter/x86_64_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_64_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
- https://plugins.gradle.org/m2/io/flutter/x86_64_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_64_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
Required by:
project :app
> Could not find io.flutter:x86_debug:1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.
Searched in the following locations:
- https://jcenter.bintray.com/io/flutter/x86_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
- https://dl.google.com/dl/android/maven2/io/flutter/x86_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
- https://repo.maven.apache.org/maven2/io/flutter/x86_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
- https://jitpack.io/io/flutter/x86_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
- https://plugins.gradle.org/m2/io/flutter/x86_debug/1.0.0-c4cd48e186460b32d44585ce3c103271ab676355/x86_debug-1.0.0-c4cd48e186460b32d44585ce3c103271ab676355.pom
Required by:
project :app
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 11s
Error: Gradle task assembleDebug failed with exit code 1
My android/build.gradle file is
<code>buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
jcenter()
maven {
url 'http://download.flutter.io'
allowInsecureProtocol = true
}
}
dependencies {
classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath fileTree(dir: 'libs', include: '*.jar')
}
}
plugins {
id 'com.android.application' version '7.4.1' apply false
id 'com.android.library' version '7.4.1' apply false
id 'org.jetbrains.kotlin.android' version "1.5.31" apply false
id 'dev.flutter.flutter-gradle-plugin' version '1.0.0'apply false
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
</code>
<code>buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
jcenter()
maven {
url 'http://download.flutter.io'
allowInsecureProtocol = true
}
}
dependencies {
classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath fileTree(dir: 'libs', include: '*.jar')
}
}
plugins {
id 'com.android.application' version '7.4.1' apply false
id 'com.android.library' version '7.4.1' apply false
id 'org.jetbrains.kotlin.android' version "1.5.31" apply false
id 'dev.flutter.flutter-gradle-plugin' version '1.0.0'apply false
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
</code>
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
jcenter()
maven {
url 'http://download.flutter.io'
allowInsecureProtocol = true
}
}
dependencies {
classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath fileTree(dir: 'libs', include: '*.jar')
}
}
plugins {
id 'com.android.application' version '7.4.1' apply false
id 'com.android.library' version '7.4.1' apply false
id 'org.jetbrains.kotlin.android' version "1.5.31" apply false
id 'dev.flutter.flutter-gradle-plugin' version '1.0.0'apply false
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
and my app/build.gradle file is
<code> plugins {
id 'com.android.application'
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
id 'org.jetbrains.kotlin.android'
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
android {
namespace "com.example.ble_prova"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/ build/application-id.html).
applicationId "com.example.ble_prova"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the- gradle-build-configuration.
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation project(path: ':mokosupport')
implementation files('app\libs\gradle-wrapper.jar')
implementation files('app\libs\mokoBleLib.jar')
implementation files('app\libs\mokoSupport.jar')
implementation files('gradle\wrapper\gradle-wrapper.jar')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation files('/Users/username/Developer/flutter/bin/cache/artifacts/engine/ android- arm64-release/flutter.jar')
}
</code>
<code> plugins {
id 'com.android.application'
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
id 'org.jetbrains.kotlin.android'
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
android {
namespace "com.example.ble_prova"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/ build/application-id.html).
applicationId "com.example.ble_prova"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the- gradle-build-configuration.
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation project(path: ':mokosupport')
implementation files('app\libs\gradle-wrapper.jar')
implementation files('app\libs\mokoBleLib.jar')
implementation files('app\libs\mokoSupport.jar')
implementation files('gradle\wrapper\gradle-wrapper.jar')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation files('/Users/username/Developer/flutter/bin/cache/artifacts/engine/ android- arm64-release/flutter.jar')
}
</code>
plugins {
id 'com.android.application'
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
id 'org.jetbrains.kotlin.android'
}
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
android {
namespace "com.example.ble_prova"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/ build/application-id.html).
applicationId "com.example.ble_prova"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the- gradle-build-configuration.
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation project(path: ':mokosupport')
implementation files('app\libs\gradle-wrapper.jar')
implementation files('app\libs\mokoBleLib.jar')
implementation files('app\libs\mokoSupport.jar')
implementation files('gradle\wrapper\gradle-wrapper.jar')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation files('/Users/username/Developer/flutter/bin/cache/artifacts/engine/ android- arm64-release/flutter.jar')
}
My setting.gradle file is
<code> pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}
settings.ext.flutterSdkPath = flutterSdkPath()
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
repositories {
gradlePluginPortal()
google()
mavenCentral()
mavenLocal()
jcenter()
maven {
url 'http://download.flutter.io'
allowInsecureProtocol = true
}
}
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0" apply false
id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
jcenter()
google()
mavenCentral()
maven { url "https://jitpack.io" }
gradlePluginPortal()
}
}
rootProject.name = "ble_prova"
include ':app',':mokosupport'
</code>
<code> pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}
settings.ext.flutterSdkPath = flutterSdkPath()
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
repositories {
gradlePluginPortal()
google()
mavenCentral()
mavenLocal()
jcenter()
maven {
url 'http://download.flutter.io'
allowInsecureProtocol = true
}
}
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0" apply false
id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
jcenter()
google()
mavenCentral()
maven { url "https://jitpack.io" }
gradlePluginPortal()
}
}
rootProject.name = "ble_prova"
include ':app',':mokosupport'
</code>
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}
settings.ext.flutterSdkPath = flutterSdkPath()
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
repositories {
gradlePluginPortal()
google()
mavenCentral()
mavenLocal()
jcenter()
maven {
url 'http://download.flutter.io'
allowInsecureProtocol = true
}
}
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0" apply false
id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
jcenter()
google()
mavenCentral()
maven { url "https://jitpack.io" }
gradlePluginPortal()
}
}
rootProject.name = "ble_prova"
include ':app',':mokosupport'
I have removed the strings
<code>id "com.android.application" version "7.3.0" apply false
id "com.android.tools" version "7.5.1" apply false
</code>
<code>id "com.android.application" version "7.3.0" apply false
id "com.android.tools" version "7.5.1" apply false
</code>
id "com.android.application" version "7.3.0" apply false
id "com.android.tools" version "7.5.1" apply false
because I thought it was a problem of compatibility between Android Tool and Gradle version, but the error is the same.
Please help me see what I am doing wrong here.
Thanks