I would like to change the application name and label in the installer window (see the attached image). Name and label is, by default, the package name. Even though I added custom name and label in AndroidManifest.xml, it is not reflected in this installer window.
AndroidManifest.xml is given below.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.style"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" />
<application android:icon="#drawable/icon"
android:label="#string/app_name">
<activity android:name=".StylePageActivity"
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>
And the custom name in strings.xml (or /res/values/base-strings.xml) is
<string name="app_name">Demo Application</string>
You can change the name (or package) of your application in AndroidManifest.xml in the <manifest package="..." part and you can change the name of the app by changing the android:label attribute in the <application> tag in the same file.
Please note that changing the package of your application essentially registers as a totally different application from the previous one (as far as Android is concerned).
Can you post your Manifest file here. Below works well for me:
<application android:icon="#drawable/launcher_icon"
android:label="#string/app_name" android:theme="#android:style/ Theme.NoTitleBar">
in your activity
this.setTitle("your text");
this works for me
go to strings.xml in res/values folder and changed the value of "app_name"
<resources>
<string name="app_name">DESIRED_NAME</string>
</resources>
also, rename the name of the .apk file after building the apk.
I think this will solve your problem.
Within a Kotlin based android app you may search for the file: \app\build.gradle.kts and change: app_name string
After changing "app_name" to your needs, you must "Sync" the project (Click in Android Studio on top,right)
Related
Ok so I was going through a tutorial online, then when i tried to change my build.gradle file to compileSdkVersion 21 instead of 23 everything lost the plot and now all my previous projects etc are all showing errors.
In the AndroidManifest.xml the 2 http lines and all the android: are all red and the the activity opening tag has a red squiggly line under it also. I have zero idea what i have done wrong! Almost like internet has gone? Just a noob so i have no idea please help!
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/tools"
package="com.site.project" >
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
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>
This answer extends #adelphus'.
A new app\build\intermediates\manifests\full\debug\AndroidManifest.xml would have listed these errors. Close and reopen the AndroidManifest.xml file from the project pane under app > manifests.
Hope this works for you.
You have duplicate schema definitions for the xmlns:android namespace in your manifest file - only one schema per namespace is allowed and I suspect the compiler is getting confused by the duplicate entry.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/tools"
package="com.site.project" >
should be:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.site.project" >
The namespace schema definitions are important - they are used to define attribute prefixes. Because your duplicate entry is invalidating the android namespace, all attributes prefixed with android: will be wrong - this is why all the android: attributes have an error (red line) displayed.
Alternatively, just remove the tools namespace completely if you're not using any attributes with the tools: prefix in your manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.site.project" >
you need download jdk here "https://www.oracle.com/technetwork/java/javase/downloads/index.html"
then go to File > Project Structure > here you config path jdk default C:\Program Files\Java\jdk-11.0.2 . Hope this works for you
I think you have two AndroidManifest.xml files to change it. Just rename the debug AndroidManifest.xml and that solution works for me.
Search for the AndroidManifest.xml file(s). on the project ParentPath. if there are multiple, keep one and delete the others.(usually find many other)
I am getting the error "Tag attribute package has invalid character ' '." in the Android Manifest, while there is no obviously invalid character. Here is the code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.exampl e.harounsmida.test2"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="22" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<application
android:name="com.example.harounsmida.test2.app.AppController"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.harounsmida.test2.LoginActivity"
android:label="#string/app_name"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustPan" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.harounsmida.test2.RegisterActivity"
android:label="#string/app_name"
android:launchMode="singleTop"
android:windowSoftInputMode="adjustPan" />
<activity
android:name="com.example.harounsmida.test2.MainActivity"
android:label="#string/app_name"
android:launchMode="singleTop" />
<activity
android:name="com.example.harounsmida.test2.UploadToServerActivity"
android:label="#string/app_name"
android:launchMode="singleTop" />
</application>
</manifest>
I don't understand where is the problem, Android Studio says that "File under the build folder are generated and should not be edited." although I didn't edit it.
Remove space from package name :
package="com.exampl e.harounsmida.test2"
After removing space :
package="com.example.harounsmida.test2"
For those who still can't solve this problem :
1 - Close Android Studio.
2 - Browse to your project directory.
3 - Rename the project directory name to something else.
4 - Open Android Studio and open your project (browse to the renamed directory) .
5 - Select Build --> Edit Flavors --> Type something like yourname.myapplication in application id textbox (avoid using non English characters or space)
Image
6 - Select Build --> Rebuild Project and you are good to go.
Please consider gradle file and see what you have given as applicationId, any name that you have given in applicationId will be copied from gradle file and pasted to manifest
Also see for space and extra character in package's value
Try this code
package="com.example.harounsmida.test2"
remove the space in your package definition because space is not allowed
After throwing the error as mentioned above, Android Studio opens the file "debug\AndroidManifest.xml". Note that the Manifest file for the project is "main\AndroidManifest.xml". I didn't notice initially and was removing the space from the former file (which Android Studio opens up).
Hope it helps!
I'm a beginner when it comes to both Java and android SDK, and I had some issues that I dealt with to finally be able to run my app, and than I get this error and I just can't figure it out.
So this is the Console:
[2013-09-17 19:59:23 - AndroidFlow] Installation error:INSTALL_PARSE_FAILED_MANIFEST_MALFORMED
[2013-09-17 19:59:23 - AndroidFlow] Please check logcat output for more details.
[2013-09-17 19:59:23 - AndroidFlow] Launch canceled!
(Sorry for text fragmentation, it doesn't fit in the same line)
And heres the logcat snap:
Also, heres the Manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.domiq.androidapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<service android:enabled="true"
android:exported="false"
android:isolatedProcess="false"
android:label="flow service"
android:name="com.domiq.androidapp.appservice"
android:permission="string"
android:process="string" >
</service>
<activity
android:name="com.domiq.androidappp"
android:label="androidapp" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Any suggestions? I've tried a lot of stuff (as you can see nothing is in capital letters etc...)
In the future, copy the text out of LogCat (select the lines, press <Ctrl>-<C> to copy) rather than use screenshots.
That being said, here are some obvious problems:
Your android:name in the <activity> is invalid, as it does not have the name of your Activity class.
The one that is causing your error is the android:process attribute in the <service> element, which is malformed and unnecessary.
I am skeptical that the android:name in your <service> points to a Service implementation class.
I strongly encourage you to get rid of android:isolatedProcess and android:permission, as what you have will probably not work the way you expect.
Are you sure your Activity's name is com.domiq.androidappp. This looks to be the package name.
So change below line to the Activity class Name. Use the Eclipse Manifest editor rather than adding manually
<activity
android:name="com.domiq.androidappp"
You need to remove the android:permission="string" and android:permission="string". It looks like you just copied pasted that incorrectly. You are supposed to replace "string" with the proper values.
Also your android:name under your Activity should be the Activity name, e.g. android:name="com.domiq.androidapp.MyActivity".
This is driving me nuts. I'm trying to upload a draft apk to the app store, I'm a windows developer, and this is my first android app, so I don't really have a frame of reference to work from. I export the signed apk, and from the developer console I browse to the apk, select it, and attempt to upload. I receive the message:
The file is invalid: ERROR getting 'android:name' attribute: attribute is not a string value.
I have uploaded this apk to the web, and can successfully download, install, and run the app outside of the market. I've self-signed the apk, and have verified that is done correctly.
Any suggestions would be appreciated.
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.My.PackageName"
android:versionCode="1" android:versionName="1.0.0">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".Home" android:configChanges="orientation"
android:label="#string/app_name" android:launchMode="standard" android:icon="#drawable/icon">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Preferences" android:label="#string/set_preferences"> </activity>
<activity android:name="com.admob.android.ads.AdMobActivity"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|keyboard|keyboardHidden"
/>
<meta-data android:value="myValue" android:name="ADMOB_PUBLISHER_ID" />
<meta-data android:value="true" android:name="ADMOB_ALLOW_LOCATION_FOR_ADS" />
</application>
<uses-sdk android:minSdkVersion="4" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>`
A missing label attribute on an Activity declaration will not be the reason for aapt debug badging to fail! You can leave them out of your Activity declaration without issues.
A common cause for these failures is a string resource that is declared in one of the translated resources while missing in the non translated, main resource folder.
res
values
strings.xml <-- missing declaration here
values-it
strings.xml <-- of a string declared here and used in manifest as a label
run the aapt command from the /path/to/sdk/build-tools folder to find more information about this error:
aapt debug badging /path/to/apk
Looks like you forgot to set the name attribute or gave an invalid one in the AndroidManifest.xml
I just had the same issue. Found the problem - I'd missed the label from one of my activity declarations. In your case, looks like the 3rd activity.
The website http://www.slideme.org is not accepting to upload my android project. It says that the manifest file must have a label. I m posting my manifest file it does have a label.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="android.com.machineInfo" android:versionCode="1" android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".machineInfo" 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>
<uses-sdk android:minSdkVersion="8" />
</manifest>
Moreover when I change android:label="#string/app_name" to android:label="Machine Information" it accepts the label and shows error that your app must have an icon. plzz help. My app is working fine on emulator
After mailing to the site helpdesk I came to know they don't support Android 2.2. So, finally I compiled my application again on Android 2.1 platform and it got uploaded. You can see my apps here: https://slideme.org/user/vaibhavpandey
Check your #drawable/icon path. Every app should have app_name stored into strings resource and their own icon which should be stored into drawable folder. Check if it exist. Probably you are using standard icon which can be not required and you should to add your own icon to project.
Anyway I recommend to read about manifest file