Problema updating and uploading my apk - android

Hi guys this is the first update I make to my app... I was reading and noticed that I need to change the versionCode and versionNameof my app in the manifest.xml, I did this and click on Build-> Generate Signed APK then in the developer console select my app and in the left menu click on APK then upload new APK and select my new generated APK but I keep getting the same error:
Upload error You must use another version code for your APK because
you already have a file with the version code 1.
BUT I don't know why I'm getting this error this is my manifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ve.net.gorydev.bachaqueofamilia"
android:versionCode="2"
android:versionName="1.1">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
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>
</manifest>
what should I change?? remember this is my first update

The versionCode and versionName are also defined in your app/build.gradle; define them there and you should have no problems.
android {
defaultConfig{
versionCode 2
versionName "1.1"
}
}

Related

How to increase the compatibility of the apk

I am making an app and the apk file that I am installing on my phone(API 23) using USB is not supporting on other devices(I have shared the apk and try to install it on a device of API 25).But another apk can be installed on that device using USB which is again not supporting on my phone.So,the apk of my app is not compatible.
And one more thing,the layouts are becoming different in different devices and sometimes 2 images are overlapping in one while in another device it is completely fine.
So I want to increase the compatibility of my app. Please help me out.
My manifest.xml file:
?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ankush.anthroplace.anthroplace">
<application
android:allowBackup="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=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main"
android:theme="#style/AppTheme.NoActionBar" />
<activity android:name=".AboutUsActivity" />
<activity android:name=".TestimonialActivity" />
<activity android:name=".LoginActivity" />
<activity android:name=".RegisterActivity" />
<activity
android:name=".ServicesActivity"
android:label="#string/title_activity_services"
android:theme="#style/AppTheme.NoActionBar" />
<activity android:name=".FormActivity"></activity>
</application>
</manifest>
Check the API level you are targeting on your project.
If you're working with Android Studio, look on the file "build.gradle (Module: app)" and change the "minSdkVersion" attribute.
The lower the number you set on that attribute, the more compatible will be your app, but you should loose some features as well.
try to put minimum sdk API level 19.
by targeting minimum apk level 19 your app will run on approximately more than 90% of android devices.
and compile your app with the latest build tool
you can change minimum sdk version from build.gradle file
android {
compileSdkVersion 26
defaultConfig {
applicationId "profile.com.demotest"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
Check Android Dashboard you will get better idea about choosing minimum api level

My app is not installing in signed apk mode

I have developed a android application . which is about maintaining the house . i have work with firebase in that application. now the problem is when i install that app in my android phone via usb cable from android studio it's run perfectly. but if i want share the app with someone via share it it's not working. (app not installed) a error come, why . ?? even if i am generate signed apk from android studio then it's also showing the same error . why ? any solution please.
and here the manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sonalirod.alwayswhite">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<application
android:allowBackup="true"
android:icon="#mipmap/lastfinalw"
android:label="#string/app_name"
android:roundIcon="#mipmap/lastfinalw"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".Firstscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Login" />
<activity android:name=".Interface" />
<activity android:name=".MainActivity" />
<activity android:name=".Bazar_Data_Input" />
<activity android:name=".MealEntry" />
<activity android:name=".Suggestion" />
<activity android:name=".admininterface" />
<activity android:name=".ALogin" />
<activity android:name=".AdminloginEnter" />
<activity android:name=".Showalldeposit"></activity>
</application>
</manifest>
gradle settings
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.sonalirod.alwayswhite"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
and i am trying to install in android 4.4.2 (api 19-20)
CommonsWare explained it all.
https://commonsware.com/blog/2017/10/31/android-studio-3p0-flag-test-only.html
Distributing APKs outside of GooglePlay to users need then to accept installing from Unknow Sources.
This options is under Settings > Security.. "Unknow sources"
Based in the link form other answer:
"
Android Studio 3.0 sets android:testOnly="true" on APKs that are run from the IDE
For many developers, this is of little consequence. However, if you have ever taken an APK lying around your build/ directory and sent it to somebody, that will only work if you did something other than run the app in Android Studio in order to create that APK, such as:
Built the app using the “Build APK(s)” menu option
Built the app using the assembleDebug or assembleRelease Gradle tasks
Built the app using something else that might use those tasks, such as a CI server
"
Are you building the application as release right?

How to solve Android Error type 3?

Below manifest formation I am using into my project but whenever I am trying to run my emulator, I am getting below mentioned error. please give me a exact solution for solving the error.
Tools informations
Android studio
Nexus S API 22 (android 5.1.1)
My Manifest file formate
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.info.androidapp" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="app"
android:supportsRtl="true"
android:theme="#style/AppTheme" >
<!-- Splash activity -->
<activity
android:name=".SplashActivity"
android:label="app"
android:theme="#android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Login activity -->
<activity
android:name=".LoginActivity"
android:label="app"
android:theme="#android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
</activity>
<!-- List activity -->
<activity
android:name=".listActivity"
android:label="app"
android:theme="#android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
</activity>
</application>
</manifest>
My Error :
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.info.androidapp/.SplashActivity }
Error type 3
Error: Activity class {com.example.info.androidapp/com.example.info.androidapp.SplashActivity} does not exist.
NOTE : Sometimes I am facing Unfortunately, the process com.android.phone has stopped alert into emulator!
After searching it for so long what helped me was.
1) File -> Sync Project with Gradle Files.
Or
This helped me too.
2) Uninstalling the previous installed application from emulator/mobile and re-run it and install it again.
Uninstall your app via 'adb' in the terminal: adb uninstall com.example.yourapp
I had to uninstall the app for all users.
If you have multiple users (e.g. a kids mode) on your device, uninstalling the app from homescreen only removes the app form the current user.
Go to Settings -> Apps -> (Your App) -> Open Popup Menu (by clicking on the three dots in top right corner) -> Uninstall for all Users
In build.gradle, the line:
apply plugin: 'android-library'
needs changed to:
apply plugin: 'android'
Edit:
Solution is deprecated. Please use this:
apply plugin: 'com.android.application'
try this
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.info.androidapp" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="app"
android:supportsRtl="true"
android:theme="#style/AppTheme" >
<activity
android:name=".SplashActivity"
android:label="app"
android:theme="#android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Login activity -->
<activity
android:name=".LoginActivity"
android:label="app"
android:theme="#android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
</activity>
<activity
android:name=".listActivity"
android:label="app"
android:theme="#android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
</activity>
</application>
</manifest>
your Main Launcher activity always should be only ONE Activity.
Include the applicationId configuration in build.gradle if it doesn't already exist.
android {
compileSdkVersion 18
buildToolsVersion '19.0.0'
defaultConfig {
applicationId 'com.myapp.app'
minSdkVersion 11
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
}
The solution to my problem was to uninstall an app from the app (Settings) folder in android because the app was just disabled.
I thing other solutoions will work fine for few user in my case i am using android 9 and i have multi user option enabled for system, it automatically install application for guest user, so goto
Settings>Apps>Concern App
And you will see uninstall for all user option at the top Option Menu. Uninstall and everything will work fine.
in my case this error sparsely appears in one project only and I can resolve it only uninstalling the app. the simplest way is to use Gradle:
ProjName->Tasks->install->uninstallAll
The Uninstall your app via 'adb' in the terminal: adb uninstall com.example.yourapp
worked fine for me

unable to change version in androidmanifest.xml

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.

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

Categories

Resources