I have a string resource for an application label:
<string name="app_name">My application</string>
My AndroidManifest.xml is classical:
<manifest.. >
<application
android:name="my.package"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:replace="android:icon">
<activity ...
I have GoPro SDK as a dependency. And on some devices (HTC U Play) my application is signed not as "My application", but as "GoPro SDK".
I have figured out that GoPro SDK valuses are realy containing resource:
<string name="app_name">GoPro SDK</string>
GoPro SDK is an .arr archive.
How to fix it without renaming of the variable app_name?
Try to add to application tag the following attribute:
<application
tools:replace="label, icon"/>
also I found that some of activities may contain label without tools:replace="label"
<activity android:label="#string/app_name" />
Just remove label from activities or add tools:replace="label" attribute
Related
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.
I'm trying to develop an app using google maps, but don't know why it still gives me the error, I recheck my manifest file all seems to be ok. here is the manifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.interstars"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<uses-library android:name="com.google.android.maps"/>
<activity
android:name="com.example.interstars.InterMainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Error
2 08:47:06 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for C:\Users\uchman\Documents\Work place\InterStars\AndroidManifest.xml: Attribute name "uses-library" associated with an element type "application" must be followed by the ' = ' character.
What sort of thing I missing? I'm still a beginner in android programming.
try put
<uses-library android:name="com.google.android.maps"/>
this line after all activity tags and before the end of application Tag
thanks for all your help..
After stressing myself too much, i decieded to use GoogleMaps API V2. And thanks to the tutorials in https://developers.google.com/maps/documentation/android/ i was able to fix google maps to my app.
P.S GoogleMaps API V2 is much easier for both the user and programmer And no need for the uses-library. All that is required is the Google Play lib..
Try this:
<uses-library android:required="true" android:name="com.google.android.maps"></uses-library>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
The Target of your code must be set on Google API and not Android API.
Your project folder --> properties --> android --> In the project build target select the Google API for your API level.
Please try this :
Right click your projects and click "Android Tools"
Click "Add support Library" and directly add the library
Afterward run this.
I am not Sure but i have faced Same error Once i have started mapview.
the Way i got work around is as below:
if you have copy and paste below line
<uses-library android:name=”com.google.android.maps” />
then the quote("") got turned into a different ASCII VALUE quote character.
You Should Retype the quote characters.
Similar question