So I have been following a tutorial titled 31 days of Android. I am having an issue with one of the tutorials. It calls for me to modify the androidmanifest.xml file but when I do but it doesn't work. Everytime I run the application it crushes after I press button 2. Here is the code they wanted me to add
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:name="MyApplication">
and here is the code looks after I have added that code to my file.
<application android:icon="#drawable/icon" android:label="#string/app_name" android:name="MyApplication">
I did not add the android:icon="#drawable/ic_launcher" because it gave me an error which read "no resoucre found that matches the given name". Any help would be appreciated.
The error is because there is no icon in your project,
Look in Project/res/drawable/ ...
The ic_launcher is the default icon, so just replace
android:icon="#drawable/icon"
By :
android:icon="#drawable/ic_launcher"
Related
I have a problem when using RC1 of MAUI that caused me to remove this part from the Android manifest:
<application
...
android:icon="#mipmap/appicon"
android:roundIcon="#mipmap/appicon_round"
...>
</application>
Now that it has GA'd, I'm trying to add it back in because in Android my application icon is not displayed - instead it's just the generic Android icon. When I add this back into my Android manifest like so:
<application android:allowBackup="true"
android:supportsRtl="true"
android:icon="#mipmap/appicon"
android:roundIcon="#mipmap/appicon_round">
</application>
I get compile errors that I have no idea how to resolve. NOTE: I DO have a file called "appicon.png", and it DOES work correctly as the application icon on iOS. The errors look like this:
APT2260 resource xml/microsoft_maui_essentials_fileprovider_file_paths (aka com.watchlikes.watchlikesapp:xml/microsoft_maui_essentials_fileprovider_file_paths) not found.
APT2260 resource style/Maui.SplashTheme (aka com.watchlikes.watchlikesapp:style/Maui.SplashTheme) not found.
APT2067 failed processing manifest.
If I take the android:icon and android:roundIcon attributes out of the manifest file it compiles correctly again. Any idea on what this problem is, and/or how to troubleshoot it?
Had the same issue and followed https://learn.microsoft.com/en-us/dotnet/maui/user-interface/images/app-icons?tabs=android under "Platform-specific configuration":
If your icons name is "testicon.svg" just change the manifest file like this:
<application android:allowBackup="true"
android:supportsRtl="true"
android:icon="#mipmap/testicon"
android:roundIcon="#mipmap/testicon_round">
</application>
first I'm just a beginner, I'm using android studio and I try to import an Eclipse project, I get this:
"Error:The number of method references in a .dex file cannot exceed
64K"
I try to solve it but I get a duplicate attribute name, is there a way to fix it?
<application
android:name="android.support.multidex.MultiDexApplication"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:name=".App" android:largeHeap="true"
tools:replace="android:icon,android:label,android:theme">
Error:L'attribut "name" lié à l'espace de noms "http://schemas.android.com/apk/res/android" a déjà été spécifié pour l'élément "application".
You must have only one android:name entry, which error message clearly tells you about. Not sure what you wanted to achieve by adding this:
android:name="android.support.multidex.MultiDexApplication"
but if that's your way of doing inheritance, then it's wrong and must be removed. You need to have one android:name pointing to your application class subclass. If you do not provide custom application class then remove all android:name from your <application>
Try remove this from manifest file:
android:name=".App"
So your code be like this:
<application
android:name="android.support.multidex.MultiDexApplication"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:largeHeap="true"
tools:replace="android:icon,android:label,android:theme">
i have 2 versions of AndroidManifest.xml files in my project, one is the main and another for debug.
in both of them i have android:label and in the debug version i have tools:replace="label"
after adding a library through gradle i suddenly see:
Error:Execution failed for task ':app:processMobileDebugManifest'.
Manifest merger failed : Attribute application#label value=(XXXX Debug) from AndroidManifest.xml:36:13-45
is also present at [library_name] AndroidManifest.xml:13:9-41 value=(#string/app_name).
Suggestion: add 'tools:replace="android:label"' to element at AndroidManifest.xml:7:5-20:19 to override.
it already exists there! what am i doing wrong?
Edit1:
main xml:
<application
android:name="[package_name]"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme">
debug xml:
<application
tools:replace="name, label"
android:name="[package_name]"
android:label="[debug_name]">
third party library xml:
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
I found out that the label should have the same value like all others.
Meaning that tools:replace works only if all labels looks like this:
android:label="#string/app_name"
In my case it didn't work because in the debug manifest it looked like this:
android:label="debug name"
But once i changed it to android:label="#string/app_name" and added string in the debug/values dir it started working correctly.
Seems like a bug in Android Studio.
I was instructed to add the following to some file but not sure which one, please help me.
Mark application entry – Manifest
Add Analytics as application name on Manifest entry as below :
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:name=".Analytics">
but my current project manifest already have the following:
<application
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
What should it become now?
This means you have Analytics application class in your app
android:name=".Analytics"
will consider as your application base class.
for more info please refer this link http://developer.android.com/reference/android/app/Application.html
Assuming you are using SDK v4, use the link
The documentation is very straight forward so you shouldn't have any issues integrating it.
I deleted the standard android robot icon ic_launcher and added mine ( in various densities)
and I have already in may manifest.xml
<application>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
....
but after clean/build when running I still have the tiny android robot in my ActionBar and my app launch icon is still the android default app robot icon ..
I guess I miss some additional parameter ??
my manifest file is surely wrong...
indicated by the colors.... drawable icon should be blue...
Try uninstalling the app from the device and re-installing it to see the icon changes.
Yeah, the Application tag in your manifest file should set the icon like this:
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
it was an error in my xml file....
<application
android:name="SwimmerApp"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
Had the same issue, solved it after copying the ic_launcher.png to the drawable-mdpi folder under the res.