0

I want to build my flutter android app but when i run 'flutter build apk' i get this error I have seen many solutions but no one helped me I have specified the ApplicationId in the build.gradle file


* What went wrong:
Execution failed for task ':generateReleaseBuildConfig'.
> Cannot read packageName from C:\Users\hp\Desktop\wooble\android\src\main\AndroidManifest.xml

* 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 7s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done                       8,6s
Gradle task assembleRelease failed with exit code 1')

Here is the manifest code :

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.wooble.news">

         
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.INTERNET"/>

    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="social_media_app"
        android:icon="@mipmap/ic_launcher">
        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <meta-data
              android:name="io.flutter.embedding.android.SplashScreenDrawable"
              android:resource="@drawable/launch_background"
              />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <activity
            android:name="com.yalantis.ucrop.UCropActivity"
            android:screenOrientation="portrait"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>

Does anyone can help me because the package is specified in the manifest file

1 Answers1

0

Change the applicationId in the android/app/scr/build.gradle

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.sometertiary.master"
        minSdkVersion 16
        targetSdkVersion 30
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

Also check this post https://stackoverflow.com/a/51550358/9398610

Norbert
  • 6,874
  • 14
  • 40
  • 65