AndroidManifest.xml can not resolve symbol TODO style and drawable - android

I wrote a simple app in flutter and then after some research I changed the name and icon. After changing these two I got errors which I never had before on AndroidManifest.xml. I tried few things after research on thew Net. (like invalidate cache and restart) but still I get those errors. I would appreciate every help.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.sarisayfav1"
android:versionCode="TODO"
android:versionName="TODO">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="Akçakale_Sarı_Sayfa"
android:icon="#android:mipmap/sym_def_app_icon"
tools:ignore="NewApi">
<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"
tools:targetApi="honeycomb">
<!-- 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="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<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>
<!-- 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>

android:versionCode="TODO"
android:versionName="TODO"
remove these 2 lines.
TODO is not a recognized android version Name. flutter will set them automatically

Related

Android icon gets picked up instead of notification icon

I am using FCM notification and I have set the following in my AndroidManifest.xml:
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="#drawable/splash" />
<!-- Set color used with incoming notification messages. This is used when no color is set for the incoming notification message. -->
<meta-data
android:name="com.google.firebase.messaging.default_notification_color"
android:resource="#color/splash_color" />
where splash is a transparent png image.
I also have the android app icon which I am setting like this in the same manifest file:
<application
android:name="io.flutter.app.FlutterApplication"
android:label="myapp"
android:icon="#drawable/ic_launcher">
What happens is that when a notification pops up, it picks up the ic_launcher instead of splash. If I replace ic_launcher and keep splash as my android icon, then I see the notification icon.
However, if I do it this way, then my app icon (which is now a transparent image) get's a black color as background which I don't want. I want the ic_launcher to be my background color. I fail to understand as to why the image defined at android:icon gets picked up for notification ?
For anyone struggling with this, please put the meta-tags right after the application tag. Do not put them under the activity tag. So something like this:
<application
android:name="io.flutter.app.FlutterApplication"
android:label="When Coin"
android:icon="#mipmap/ic_launcher">
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="#mipmap/ic_notification" />
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in #style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>

Issue displaying flutter app icon on certain versions of android

I have a flutter app in which I have generated app icons for under the android folder of the project with the image asset tool that comes with android studio. On certain versions of android however neither this icon or flutter's default icon displays which seems to tell me this isn't just an issue with the icons I've provided, I instead get the default green android as such:
The screenshots above have come from an android 5 emulator (albeit quite old now its still technically supported by flutter so I wanted to test this) and I get the same problems on a physical device running android 7, but the icon seems to appear fine on any versions above. Something else I have noticed is that no app name appears in the multitasking menu but I'm not sure if that is a completely unrelated issue.
If anyone could help me that would be great, as I can't figure out what other icons I need to place in the project as I thought I'd covered all options. Thanks.
Edit- This is the android manifest for my app:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="me.letalis.testapp">
<application
android:label="Test 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">
<!-- 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="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<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>
<!-- 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>
Res folder:
Follow these Steps to Change/Customize Launcher Logo in Android Studio,
*Expand the project root folder in the Project View
*Right Click on the app folder
*In the Context Menu go to New->Image Asset
*In the pop up that appears select the the new logo you would like to have(image/clip art/text).
*If you were selecting the image radio button (as is the default choice), if you clicked on the 3-buttons to show the path tree to locate your .png image file, most probably you might not be seeing it, so drag it from the Windows Explorer (if Windows) and drop it in the tree, and it will appear and ready for being selected.
**Don't forget to set new icon's location in manifest: replace drawable to minimap in android:icon –
..........Mipmap Solution:
As you can see this Snapshot, I set Mipmap for every version, you can follow this also,
You have to create an XML file for anydpi-v26
`<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="#color/ic_launcher_background"/>
<foreground android:drawable="#mipmap/ic_launcher_foreground"/>
</adaptive-icon>`

Flutter androidManifest.xml Parsing Eror

I am developing Flutter on Vs Code,
This is my AndroidManifest.xml files and I get this error :Please ensure that the android manifest is a valid XML document and try again
I think I have a double quotes or other problem,
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.object_detection">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="Object Detector"
android:icon="#mipmap/launcher_icon">
<meta-data android:name="com.google.android.gms.ads.APPLICATIN_ID" android:value
<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">
<!-- 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="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<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>
<!-- 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>
You are have a android:value that is not in parameter. This is corrected Manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.object_detection">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="Object Detector"
android:icon="#mipmap/launcher_icon">
<meta-data android:name="com.google.android.gms.ads.APPLICATIN_ID"
<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">
<!-- 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="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<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>
<!-- 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>

AndroidManifest gives 14 errors after adding admob

I got suddenly 14 errors when I clicked to AndroidManifest.xml in the src/main. I was trying to add admob by following instructions but I messed up. I don't know what to do. I integrated firebase and it was fine until adding admob. The instructions are not clear on the web site. Please someone show me what is wrong step by step.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.Akcakale_Sari_Sayfa">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="Akcakale_Sari_Sayfa"
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">
<!-- 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="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<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>
<!-- 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>
<manifest>
<application>
<!-- Sample AdMob app ID: ca-app-pub-************************ -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-**************************"/>
</application>
</manifest>
You added an extra < application> and < manifest> tag.
Paste the admob meta tags inside the above < application> tag.
Delete extra tags.
Like this;
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.Akcakale_Sari_Sayfa">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="Akcakale_Sari_Sayfa"
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">
<!-- 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="io.flutter.embedding.android.NormalTheme"
android:resource="#style/NormalTheme"
/>
<!-- Displays an Android View that continues showing the launch screen
Drawable until Flutter paints its first frame, then this splash
screen fades out. A splash screen is useful to avoid any visual
gap between the end of Android's launch screen and the painting of
Flutter's first frame. -->
<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>
<!-- 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" />
<!-- Sample AdMob app ID: ca-app-pub-************************ -->
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="ca-app-pub-**************************"/>
</application></manifest>

Android: Creating a splashscreen on app start WITHOUT timer?

Currently I have a very low-res splashscreen I made by setting the applications theme to a drawable image. This would work PERFECTLY if it wasn't for this. Now I'm looking for an alternative.
The one thing I will not do is create a timed splashscreen, which there are plenty of guidelines on how to make one, the one thing I want to know is how do I create a splashscreen that will load first thing, then finish once MainActivity has finished loading?
The one thing I love about my current splashscreen is that it loads instantly when the app starts, but it will cause major delays when clicking buttons if it's high-res (more than 300x300pixels).
Here's my current code for the flawed, laggy splashscreen that loads and stops based on MainActivity's loaded state:
in styles.xml:
<style name="splashscreenTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:windowBackground">#drawable/splashscreen</item>
</style>
in manifest:
in AndroidManifest.xml:
<application
android:allowBackup="true"
android:icon="#drawable/logo"
android:label="#string/app_name"
android:fullBackupContent="false"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:label="#string/app_name"
android:theme="#style/splashscreenTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
Check for possible issues with overdraw. It seems that the background (the splash image) is still there. see http://www.curious-creature.org/2012/12/01/android-performance-case-study/ if it applies to your case.
Removing the window background: the background defined in your theme is used by the system to create preview windows when launching your application. Never set it to null unless your application is transparent. Instead, set it to the color/image you want or get rid of from onCreate() by calling getWindow().setBackgroundDrawable(null).

Categories

Resources