of course there are a lot similar questions and I really read through, but none of them completely answered my question:
I want to update my current app (already prod) on Google Play, but it says I need to change the versionCode -> 1 does already exist.
But I changed or added this in the AndroidManifest.xml, also the versionName.
You must know, I didn't add any versionCode or versionName in my first upload, could this cause the problem?
Do I have to delete the app now and re-upload it?
I surely used the same keystore and credentials
Steps done:
updated the AndroidManifest.xml
android:versionCode="2"
android:versionName="1.0">
created a new signed apk
tried to upload
Another question:
Do I really need to use the same apk-filename?
xml manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ibma.ibmaapp"
android:versionCode="2"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="19"
android:maxSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.ibma.ibmaapp.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>
For the first question - Are you sure you saved the changes to the manifest? Seems silly, but it's a mistake I make all the time.
For the second question - You can change the .apk filename to whatever you'd like; there's no need to keep it the same.
finally it works...
updated Android Studio to 0.8.0
updated my APIs (to API 20: Android L)
changed following project settings: (under "File > Project Structure")
Compile SDK Version: android-L
Build Tools Version: 20.0.0
changed the selected API for the graphical Layout (see link below)
have a look at this blog
(Thank you, Thodoris Bais! ;-) )
Had to change the build.gradle file and add the correct VersionCode
this was the reason why I could not generate apk's with different VersionCodes
it was still set to versionCode=1 though in the manifest it was set to two
I checked the new apk file with the aapt command and the versionCode was set to 2, finally!
Now my last queston would be:
Do I always have to update the AndroidManifest.xml and the build.gradle file on my own - shouldn't they just synchronize?
Best regards,
Christian
Related
I'm building a tiny dummy app using the command line (no gradle) with just a single blank activity, no permissions, no support libraries (or any other libraries, Google Play, etc) and yet Android always prompts for these two permissions during installation:
I understand how and why permissions get merged in when other libraries are included during a build, but my app has nothing included. I've extracted and decoded the compiled AndroidManifest.xml from the resulting APK and there's no <uses-permission> tag anywhere inside it.
According to this question, the READ_PHONE_STATE is added if no minSdkVersion value is entered, but I have one declared in the manifest (which I can also see in the compiled manifest).
Here is the source manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="dummy.testapp"
versionCode="1">
<uses-sdk minSdkVersion="20" targetSdkVersion="22" />
<application
android:label="TestApp No Perms"
android:icon="#drawable/ic_launcher">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
The single activity (MainActivity) just calls setContentView() on a blank layout.
Can anyone shed any light as to why these permissions are always requested or how to prevent them from being prompted for?
The answer came down to the missing android: prefix on the minSdkVersion and targetSdkVersion attributes.
Having no android: prefix doesn't cause any warnings or errors to be emitted from the resource compiler, but because of the missing prefix, the value is ignored when the APK manifest is parsed during installation.
The end result is that Android believes there is no minSdkVersion set and, as reported in Why does my app has the READ_PHONE_STATE permission although it's not declared in manifest?, automagically prompts for the permissions.
Adding in the android: prefix fixed the issue and allows the app to be installed with no permission prompts.
when i try to update my alpha release i receive the error that i need to change my apk version. But how can i do that? my android manifest:
<android xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.1">
<manifest>
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23"/>
<application>
<activity android:configChanges="keyboardHidden"
android:name="org.appcelerator.titanium.TiActivity" android:screenOrientation="portrait"/>
<activity android:configChanges="keyboardHidden" android:name="ti.modules.titanium.ui.TiTabActivity"/>
</application>
</manifest>
</android>
Ah, you talk about APK version, not about Android SDK. The solution is simple. You need to change the version at a couple places.
Change the version tag with at least the 3rd number (patch) increased
<version>1.0</version>
Can become
<version>1.0.1</version> or <version>1.1</version>
Next, you also need to change the part in the android manifest
<manifest android:versionCode="1"
android:versionName="1.0.1" package="com.example.app"
xmlns:android="http://schemas.android.com/apk/res/android">
Increase version code every time, can be same as version, in my example 101 for example. Or just a build number (1, 2, 3, etc)
Versionname should be the same as the version in the version tag. Also don't forget to put your app ID in the same code ;)
In TiApp.xml add version code and version name to manifest
<manifest android:versionCode="1" android:versionName="1.0">
Google is mainly complaining about version code so check that and increase by one. These settings will override the version of the app specified in the tag for android
Each APK you submit to Google Play must have a unique, incremental build version, which on Android is android:versionCode.
Titanium will use the <version> tag in tiapp.xml to set the release version which on Android is android:versionName.
To set the build version you need to add/use a <manifest> element under the <android> element in tiapp.xml like this:
<android>
<manifest android:versionCode="1">
..
</manifest>
</android>
The 4.1.0 Sample included a Gruntfile.js to easily increment the iOS and Android build versions. It can even bump the major, minor or patch release version for you.
Please read the blog post on versioning your apps with Titanium 4.1.0 and later for more information.
you also have to increment
<version>1.1</version>
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 just beginning to use Eclipse for Android applications.
I have installed Eclipse 3.5.2 and Java 5
AVD is Android 2.1 API 7
My initial Hello Android program ran fine but will not run again.
getting the following error:
[2010-07-25 09:47:31 - HelloAndroid] WARNING: Application does not specify an API level requirement!
[2010-07-25 09:47:31 - HelloAndroid] Device API version is 7 (Android 2.1-update1)
searched the forums but could only find a refernece to manifest file to be sure following was set:
<uses-sdk android:minSdkVersion="3" />
my manifest file does not contain that line:
<?xml version="1.0" encoding="utf-8" ?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.helloandriod" android:versionCode="1" android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".HelloAndroid" 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>
I have checked the adv mgr and it is set to 7
In Eclipse i went to properties -> Android and set it to 7
get same warnings
Well, if Eclipse is, for whatever reason, not generating that line for you, by all means you can add it yourself.
Add the line:
<uses-sdk android:minSdkVersion="3" />
to your manifest, right before the ending manifest tag.
You should also include
<uses-sdk android:minSdkVersion="7" />
in your manifest file, if it is not already there. It's not clear from your question, but seems that it isn't.
For future reference about API levels, see this page
It appears that there is a bug in the Android SDK Tools revision 16 that requires the correct ordering of the uses-sdk tags. If you're using both targetSdkVersion and minSdkVersion, order them as follows:
<uses-sdk android:targetSdkVersion="10" /> <!-- before minSdkVersion -->
<uses-sdk android:minSdkVersion="7" /> <!-- after targetSdkVersion -->
Reversing the order will give the warning message and pop up the device selection window. I therefore recommend writing this in a single line:
<uses-sdk android:targetSdkVersion="10" android:minSdkVersion="7" />
The manifest should only contain a single element, it's an error to use more than once.
In ADT 17, we have a new lint warning which detects and reports this problem:
$ lint --version
lint: version 17
$ lint --show MultipleUsesSdk
MultipleUsesSdk
---------------
Summary: Checks that the <uses-sdk> element appears at most once
Priority: 6 / 10
Severity: Error
Category: Correctness
The <uses-sdk> element should appear just once; the tools will *not* merge the
contents of all the elements so if you split up the atttributes across
multiple elements, only one of them will take effect. To fix this, just merge
all the attributes from the various elements into a single <uses-sdk>
element.
More information: http://developer.android.com/guide/topics/manifest/uses-sdk-element.html
you have to specify the API level in your code and it should be in a single line.
uses-sdk android:targetSdkVersion="19" android:minSdkVersion="4".
Target should be latest one. It might help you as it worked for me. Thanks
new to Android. Checked the FAQs on the SDK site but didn't find anything that was helpful.
I'm learning via a few books w/downloadable code. One of the examples I'd like to get running won't even compile because the IDE can't find/import the com.google.android.maps library/package, which I found odd since I have everything possible installed that the SDK offers. The book info on the publisher site was not helpful either. Any ideas?
I'm using Eclipse (build 20090920-1017) with the ADT 0.9.5 plugin. SDK is fully updated (all available packages installed, including android 1.1 api 2 rev. 1 through android 2.0.1 api6 rev 1, and google apis 3 rev 3 through 6 rev 1.)
Any advice is appreciated.. thanks in advance.
Choose "Google API" project Build Target. And be sure Google API is installed in you Android SDK.
And don't forget to add
<uses-library android:name="com.google.android.maps" />
into tag in ApplicationManifest.xml
Switch to "Google API" as project Build Target works for me.
Project->properties->android,
check GOOGLE API
Install all google API's using sdk manager.
In your manifest,under application element add
<uses-library android:name="com.google.android.maps" />
You have to include jar file for maps also.. Right click on your project and go to build path and then add external archives. locate your sdk. android-sdk-windows\add-ons\addon_google_apis_google_inc_<your api version>\libs\maps
Me too got this Error even though I Inserted
<uses-library android:name="com.google.android.maps"/>
I struggled to solve this problem for a long time...
Then Cleaning and Rebuilding Project solves the Issue
Remember always to add uses library in appication branch. Like this:
I had also the same problem but i had added uses library not in application
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.MapsTest"
android:versionCode="1"
android:versionName="1.0.0">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".MapsTest"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<uses-library android:name="com.google.android.maps"/>
</application>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
</manifest>
Parsed in 0.004 seconds, using GeSHi 1.0.8.4
To develop with google maps I recommend you to use Genymotion instead eclipse emulator.