Closed jacsdev closed 3 months ago
There’s something wrong with your app.
I suggest you first practice setting up the plug-in in a simple hello-world app.
I really appreciate the fact that you interact with the queries we make. I'll give it a try and then let you know
I really appreciate the fact that you interact with the queries we make. I'll give it a try and then let you know
can you show us the android/app/build.gradle
I really appreciate the fact that you interact with the queries we make. I'll give it a try and then let you know
can you show us the android/app/build.gradle
Of course...
app/build.gradle (Now it's working fine!!!)
plugins { id "com.android.application" id "kotlin-android" id "dev.flutter.flutter-gradle-plugin" id 'com.google.gms.google-services' }
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' }
def keystoreProperties = new Properties() def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) { keystorePropertiesFile.withReader('UTF-8') { reader -> keystoreProperties.load(reader) } }
// flutter_background_geolocation Project background_geolocation = project(':flutter_background_geolocation') apply from: "${background_geolocation.projectDir}/background_geolocation.gradle"
android {
compileSdkVersion 34
namespace "here.goes.your.application.id"
ndkVersion "25.1.8937393"
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 "here.goes.your.application.id"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
signingConfig signingConfigs.release
minifyEnabled true
shrinkResources false
proguardFiles "${background_geolocation.projectDir}/proguard-rules.pro"
}
}
}
flutter { source '../..' }
dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" }
oh okey if it's working then 👍🏽
Your Environment
flutter doctor
): Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.16.0, on macOS 14.1.1 23B81 darwin-arm64 (Rosetta), locale en-VE) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.4) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.3) [✓] IntelliJ IDEA Community Edition (version 2024.1.1) [✓] VS Code (version 1.91.1) [✓] Connected device (3 available)[✓] Network resources
• No issues found!
Expected Behavior
It should compile without problems, but I see it happens when I add the line apply from: "${background_geolocation.projectDir}/background_geolocation.gradle " in the app/build.gradle
Actual Behavior
I am trying to compile my application in android, I have already done the setup, I have everything ready, the license and everything configured, only when I put the line apply from: "${background_geolocation.projectDir}/background_geolocation.gradle", then I get that problem when compiling. I am using flutter 3.16
Steps to Reproduce
1. 2. 3. 4.
Context
Debug logs
Logs
``` Building with Flutter multidex support enabled. FAILURE: Build failed with an exception. * Where: Script '/Users/jacsdev/.pub-cache/hosted/pub.dev/flutter_background_geolocation-4.14.1/android/background_geolocation.gradle' line: 2 * What went wrong: A problem occurred evaluating script. > Could not find method android() for arguments [background_geolocation_t6cjxr7v1mimd1be2zpdnvis$_run_closure1@75dd5b7e] on project ':app' of type org.gradle.api.Project. * 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 518ms Running Gradle task 'bundleRelease'... 1,088ms Gradle task bundleRelease failed with exit code 1 ```