Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure on Android 14 (sdk 34): #66

Open
10MoSi01 opened this issue Sep 5, 2024 · 5 comments
Open

Failure on Android 14 (sdk 34): #66

10MoSi01 opened this issue Sep 5, 2024 · 5 comments

Comments

@10MoSi01
Copy link

10MoSi01 commented Sep 5, 2024

This stack-overflow page seems to be the solutions to the problem:
https://stackoverflow.com/questions/77520968/why-am-i-encountering-the-error-starting-fgs-without-a-type-when-executing-the

@B-O-B-G-I-T
Copy link

You have this error ?
FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ':flutter_nearby_connections'.

Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
Namespace not specified. Specify a namespace in the module's build file. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.

 If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.

@joshuamoreno1
Copy link

I have the same error

@kamaravichow
Copy link

Follow this to solve the issue => https://stackoverflow.com/a/78744535/10530434

@B-O-B-G-I-T
Copy link

I made the fix with the namespace, but new problem here is the gradle:

group 'com.nankai.flutter_nearby_connections'
version '1.0-SNAPSHOT'

buildscript {
    ext.kotlin_version = '1.7.10'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

rootProject.allprojects {
    repositories {
        google()
        jcenter()
    }
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
    namespace 'com.nankai.flutter_nearby_connections'
    compileSdkVersion 34

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }
    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 34
    }
    lintOptions {
        disable 'InvalidPackage'
    }
}

dependencies {
    api 'com.google.android.gms:play-services-nearby:18.5.0'
    implementation 'com.google.code.gson:gson:2.10.1'
    implementation 'com.google.android.gms:play-services-location:17.1.0'
    implementation 'androidx.core:core-ktx:1.9.0'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
repositories {
    mavenCentral()
}

I have this error
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':flutter_nearby_connections:compileReleaseKotlin'.

Inconsistent JVM-target compatibility detected for tasks 'compileReleaseJavaWithJavac' (1.8) and 'compileReleaseKotlin' (17).

Consider using JVM Toolchain: https://kotl.in/gradle/jvm/toolchain
Learn more about JVM-target validation: https://kotl.in/gradle/jvm/target-validation

if anyone knows

@B-O-B-G-I-T
Copy link

Thanks to @kamaravichow and pull requests #62 and #63, I was able to fix the problem. Maybe this will solve yours too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants