Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Unresolved class 'ApplicationName'

I wanted to upload my application to git, it gives a warning and when I say show the warning, I get an error like this. I just opened the android folder and synced, but I could not get a result. This issue only occurs when trying to upload my project to git. I tried many ways but failed How can I fix this problem?

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example.apmatik"
    tools:ignore="MissingVersion">
   <application
        android:label="apmatik"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher">
        <activity
            android:name=".MainActivity"
            android:exported="true"
            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">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
                android:name="flutterEmbedding"
                android:value="2"
                android:resource="@style/NormalTheme"
              />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>
like image 801
Abdullah T Avatar asked Sep 03 '26 16:09

Abdullah T


2 Answers

Solution 1:

Setting manifestPlaceholders manually in our app/build.gradle:

android {
⋮
defaultConfig {
   ⋮
    // Add This line
    manifestPlaceholders = [applicationName: "android.app.Application"]
   }
   ⋮
 }

Solution 2 : Add this code in app/build.gradle :

    buildTypes {
    release {
        manifestPlaceholders = [applicationName: "android.app.Application"]
    }

    debug {
        manifestPlaceholders = [applicationName: "android.app.Application"]
    }
    build{
        manifestPlaceholders = [applicationName: "android.app.Application"]
    }
  }
like image 108
u0j Avatar answered Sep 06 '26 05:09

u0j


If your app does compile, then it is not your problem but rather an Android Studio linter issue.

like image 34
mightyandweakcoder Avatar answered Sep 06 '26 05:09

mightyandweakcoder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!