unable to change version in androidmanifest.xml - android

I am creating any android application and the want to upload in play store.My problem is the that when i try to change the version i am AndroidMainfest.xml and try to build the apk then version of application change to previous one.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.menubar"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/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>

in Android Studio just change Version value in Build.gradle this will override values with manifest.xml
defaultConfig {
applicationId "YourID"
.......
versionCode 001
versionName '0.0.1'
}
If you are using Eclipse then just change version in manifest.xml and clean and built new apk. I am damn sure this'll change your app version.
android:versionCode="1.1"
android:versionName="1.0.1"

If you are using Android Studio, you must change the App Version in gradle.
When you build your application, Gradle replace values from manifest.
If you are using eclipse, check if you do not change AndroidManifest.xml placed on build folder.
If this does not work, try to project > clean, make changes and rebuild.

Related

Android Studio 3.1.3 android:roundIcon

I have a Compile Error telling me to remove android:roundIcon from AndroidManifest.xml, similar to this other post:
No resource identifier found for attribute 'roundIcon' in package 'android'
I have targeted API 15 and only have that version installed, but Android Studio keeps re-adding that line and breaking compilation. How do I stop/fix this?
My build.gradle has:
minSdkVersion 15
targetSdkVersion 15
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.testapplication"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="15" />
<application
android:allowBackup="true"
android:debuggable="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme" >
<activity android:name="com.example.testapplication.MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
It just keeps re-adding android:roundIcon="#mipmap/ic_launcher_round" if I delete it. How do I stop that behaviour?
Thanks.
Just remove all the "#mipmap/ic_launcher" for round icons. You'll be done. Also, if it doesn't solve, try adding your own icon for the same using an image asset and setting it as "ic_launcher" icon.

uses-sdk is missing in manifest

i am following the Training section of developer.android.com where i can read :
One of the most important elements your manifest should include is the
element.
But, the automaticaly generated manifest i have is :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.david.myapplication" >
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.david.myapplication.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>
Where i can't see any .
Must i consider it as normal behaviour ? Must i add this by myself ?
May be usefull : i am using AndroidStudio instead of Eclipse/ADT
Android Studio uses the newer Gradle-based build system. Its manifest merger creates the actual manifest for you, based on the information in the AndroidManifest.xml files and build.gradle files.
In particular, the uses-sdk information is usually derived from build.gradle.
For android studio, the compile sdk version is in the build.gradle. like this:
defaultConfig {
applicationId "com.eyespage.sdk.accounts"
minSdkVersion 11
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
so you don't have to include it in manifest

android.support.v8 cannot be resolved

I am trying to use renderscript in my Android project. I installed sdk tools 22.6.2 and sdk build tool 19.0.3 and then updated my adt to the latest version. But now I get error that
"The import android.support.v8 cannot be resolved" on the line where I wrote import android.support.v8.renderscript.*. I have also made the following changes in projects.properties
renderscript.target=18
renderscript.support.mode=true
sdk.buildtools=19.0.3
manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.amazing.imazing"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.amazing.imazing.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>
I am new to Android programming.
I removed all the entries from the project.properties except the one 'target=android-18' and copied the renderscript-v8.jar to the libs folder of my project. I found this jar file in sdk/build-tools/18.1.0/renderscript/lib. I stopped getting that error.
I repeated this process in another project and it works.
Try this
renderscript.target=18
renderscript.support.mode=true
sdk.buildtools=18.1.0
Which IDE are you using? Pay attention to the fact that Android Studio/Gradle-based builds are not yet supported by the RenderScript support library.
In addition, IntelliJ IDEA ignores the project.properties file, even if you are using the default build system ("make").

Android Studio - Gradle Manifest Merging Failed

I am building a demo app using actionbar sherlock in android studio and i was facing problem , mentioned in following link :-
Previous Problem
now after following the replies posted on above link i did some changes and now i am facing this
Gradle: Execution failed for task ':SherlockTest:processDebugManifest'.
> Manifest merging failed. See console for more info.
my application manifest file is :-
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sherlocktest"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="16" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.sherlocktest.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>
and actionbar sherlock manifest file is :-
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="440"
android:versionName="4.4.0"
package="com.actionbarsherlock">
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="16"/>
<application/>
</manifest>
i am not able to figure out what is the problem here, please help
Make sure that in all your build.gradle scripts the minSdkVersion and targetSdkVersion correspond to those you have in your manifests:
android {
defaultConfig {
minSdkVersion 10
targetSdkVersion 16
}
}
This worked for me, I hope it does the trick for you, cheers.
For what I can see, if you have a multi-module project with Android Studio and gradle, the IDE try to merge manifest files from every module into a Main manifest.
If you have a module A and a module B, and in the A manifest you declare some activity from B module, gradle will enconter a issue when merging.
Try removing cross-module reference in manifest files.
That worked for me when adding the Google Play Services
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 10
targetSdkVersion 16
}
}
That works for me.
My library project AndroidManifest.xml miss a application element
add one will fix it.
<application
android:allowBackup="true"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
</application>
I use gradle clean projectName --info get the error information, and solve it.

Uninstalling Android Application

When I create an Android project in Eclipse and send it to my device for debugging, the app works fine but when I try to uninstall it, I get a strange message. Below are the steps to recreate my problem:
Eclipse Version: 4.2.0 Build id: I20120608-1400
ADT Version: 2.0.3 v201208082019-427395
Run Eclipse
Click File->New->Project...
Select Android/Android Application Project
Click Next.
Enter Application Name: Test
Build SDK: Android 4.1
Minimum Required SDK: API 8 Android 2.2
Enable: Create custom launcher icon / Create project in workspace
Click Next thrice.
Click Finish.
Connect 4.1 Android device to computer via USB.
Click Run->Run from menu.
Select "Android application" on popup the "Run As" popup.
Click Ok.
MainActivity application runs on device.
Click the Back button on the Android device.
Open applications on device and find "MainActivity" app.
Long press the MainActivity icon and drag to trash.
Here's the puzzling part:
Instead of getting a standard
Do you want to uninstall this app?
I get a dialog with this text:
MainActivity is part of the following app: Test
Do you want to uninstall this app?
Why do I get this message instead of the standard one?
Why is MainActivity the name of the app when I specifically stated the name of the app is "Test"?
Additional Information:
If I go to Settings->Apps, the Application shows up as Test but is listed in my Launcher as MainActivity.
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
The solution is to remove android:label="#string/title_activity_main" in the activity element.
The AndroidManifest.xml below solves the problem on Android 4.1.1 .
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Make sure your app name app_name is not styled.
Since I was using the app name somewhere else in the app I had made it bold, like this - In my strings.xml
<string name="app_name"><b>We are sons<b></string>
When I removed
<b></b>
tags, it worked.
Just keep it :
<string name="app_name">We are sons</string>
I do not know how to solve the first issue but the second can be solved in the following way. The problem is connected with Android new project wizzard. To solve this problem you can correct your manifest file in the following way and redeploy your project:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter android:label="#string/app_name" >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Do not forget to check what is the value of app_name. Some more details you can find in this post

Categories

Resources