flutter - How can I resolve Java package namespace error? - Stack Overflow

In this error ('package="io'), there has an operator " between ' and '.is

In this error ('package="io'), there has an operator " between ' and '.is it a system error? How do I solve it?

Error:

Namespace 'package="io.flutter.plugin.pathprovider"' is not a valid Java package name as 'package="io' is not a valid Java identifier

There is my relative file.

<manifest xmlns:android=";
  package="io.flutter.plugin.pathprovider">
</manifest>

And this is build.gradle.

group "io.flutter.plugin.pathprovider"
version '2.0.11'

buildscript {
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'
    }
}

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

apply plugin: 'com.android.library'

android {
    compileSdk 35

    defaultConfig {
        minSdkVersion 16
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    lintOptions {
        disable 'InvalidPackage'
        disable 'GradleDependency'
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }


    testOptions {
        unitTests.includeAndroidResources = true
        unitTests.returnDefaultValues = true
        unitTests.all {
            testLogging {
               events "passed", "skipped", "failed", "standardOut", "standardError"
               outputs.upToDateWhen {false}
               showStandardStreams = true
            }
        }
    }
    buildToolsVersion '30.0.3'
}

dependencies {
    implementation 'androidx.annotation:annotation:1.1.0'
    implementation 'com.google.guava:guava:28.1-android'
    testImplementation 'junit:junit:4.13.2'
}

In this error ('package="io'), there has an operator " between ' and '.is it a system error? How do I solve it?

Error:

Namespace 'package="io.flutter.plugin.pathprovider"' is not a valid Java package name as 'package="io' is not a valid Java identifier

There is my relative file.

<manifest xmlns:android="http://schemas.android/apk/res/android"
  package="io.flutter.plugin.pathprovider">
</manifest>

And this is build.gradle.

group "io.flutter.plugin.pathprovider"
version '2.0.11'

buildscript {
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0'
    }
}

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

apply plugin: 'com.android.library'

android {
    compileSdk 35

    defaultConfig {
        minSdkVersion 16
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    lintOptions {
        disable 'InvalidPackage'
        disable 'GradleDependency'
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }


    testOptions {
        unitTests.includeAndroidResources = true
        unitTests.returnDefaultValues = true
        unitTests.all {
            testLogging {
               events "passed", "skipped", "failed", "standardOut", "standardError"
               outputs.upToDateWhen {false}
               showStandardStreams = true
            }
        }
    }
    buildToolsVersion '30.0.3'
}

dependencies {
    implementation 'androidx.annotation:annotation:1.1.0'
    implementation 'com.google.guava:guava:28.1-android'
    testImplementation 'junit:junit:4.13.2'
}
Share Improve this question edited Mar 13 at 16:40 Frank van Puffelen 601k85 gold badges890 silver badges860 bronze badges asked Mar 13 at 15:12 IMULIMUL 11 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

By the looks of it, the first two lines in your file should be:

group = "io.flutter.plugin.pathprovider"
version = '2.0.11'

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744694206a4588391.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信