Android - Cordova version code issue - android

This is quite a weird one.
Basically, I decided to switch from using trigger.io to using cordova to build and compile my app (using ionic framework).
Everything is fine if I build an unsigned and unaligned app, but for production I have to sign and align the apk in order to upload it on the play store.
I have signed and aligned the apk properly, but when I tried to upload the apk, I got this error:
Your APK version code needs to be greater than 1457108319
Now, I read a couple of answers here on stack overflow saying that I just need to add this line in my project config.xml file:
<widget id="com.***********" android-versionCode="1457108319" version="5.0.0"
but the problem is that if I had this line of code, then gradle fails and I get this error:
Error: Error code 1 for command: cmd with args:
/s,/c,"c:\src\app-v5\platforms\android\gradlew cdvBuildRelease -b
c:\src\app-v5\platforms\android\build.gradle -Dorg.gradle.daemon=true
-Pandroid.useDeprecatedNdk=true"
Hovewer, if I change the versionCode to a 6 digit code instead of 10, I get no error, but again, I can't upload it to the store because the versionCode number is less than the app already released.
How can I solve this? I really have no idea what to do.
Thanks a lot

I actually resolved this. I had to add to my config.xml file the following (in <widget>, right after version):
android-versionCode="{this needs to be replaced, in my case, by the
current timestamp "
The downside is that I have to remember to put the new timestamp everytime for now.
I will, at some point, write some kind of script to do this for me.
Hope this helps someone

I had the same problem since updating to latest Cordova CLI (6.3.1) and latest android platform for cordova (5.2.2).
My old build had the following:
versionCode: 69000
from the config.xml file:
My new buid:
versionCode: 7000
from the config.xml file:
so when I upload the signed APK to the PlayStore I get the same error you had:
the problem is that 7000 is < to 69000
The issue comes from the gradle script (in platforms/android/build.gradle) which from what I understand generates the versionCode from what he finds in your config.xml.
Looks like it is missing some multiplication by 100 somewhere:
so far here is what can be done:
1: instead of using 0.70 as version number use 0.700
2: specify the versionCode in the config.xml file :
it worked for me in both cases.
Hope it helps.

Related

Kivy App working on pc but not in android

I have made an apk by converting .py kivy with the help of buidozer in google colab. The earlier versions were working but now latest version is not working.
May be there is a problem in my .spec file so I am attaching it ...
At first I think my assest(images) are causing this problem but after removing them too it's not working.
I have done some research and got this buildozer -v android debug deploy run logcat but I don't know how to execute and use this command....
.spec file link : https://github.com/AyushRaj0305/APP/blob/main/.spec
All I want is that my apk should work in android
Thanks for Help
I have same issue in past and I solve by adding requirements in .spec
This requirements work for me:
requirements = hostpython3==3.7.8,python3==3.7.8,kivy==1.11.1, certifi,chardet, lxml, docutils, future, idna, Kivy-Garden, Pygments, requests, six, soupsieve, urllib3, deep-translator, arabic-reshaper, python-bidi, openssl, pyopenssl, numpy, pytz, python-dateutil, pandas, setuptools, zope.interface, datetime
you have to write all modules and parent module in requirements which your app is using.
To know module which you app is using has two method:
run command pip freeze in current app folder in powershell
install all the module as below photo which help to install your application module
I have debugged your code and found missing PIL

React Native Flipper Debugging Issue : "NO APPLICATION SELECTED"

I have managed to connect a device ( I see logs and see the tree of React Native elements), but now I have an issue with connecting the app - "NO APPLICATION SELECTED" is what I see. Any ideas to fix it?
Ran into the same problem on both iOS and Android with Flipper 0.135.0. Managed to make both work by following the steps below.
iOS
This answer solved the issue for me.
tl;dr
brew update && brew upgrade idb-companion
Also make sure you are installing the correct Cocoapod of Flipper by specifying the exact version in your Podfile with (for version 0.135.0)
use_flipper!({ 'Flipper'=> '0.135.0' })
Android
Ensure that ReactNativeFlipper.java is in the correct folder, as in this example project.
With for example the applicationId com.domain.appName, the correct path is
android/app/src/debug/java/com/domain/appName/ReactNativeFlipper.java
In my project this Java file was in the incorrect folder, which resulted in the Logcat error
java.lang.ClassNotFoundException: com.domain.appName.ReactNativeFlipper
Ensure that you are running the latest version of Flipper (0.120.0 as of this message) and then:
For Android:
Bump the FLIPPER_VERSION variable in android/gradle.properties, for example: FLIPPER_VERSION=0.120.0.
Run ./gradlew clean in the android directory.
For iOS:
Call use_flipper with a specific version in ios/Podfile, for example: use_flipper!({ 'Flipper' => '0.120.0' }).
Run pod install in the ios directory.
Reference: https://fbflipper.com/docs/getting-started/react-native/#using-the-latest-flipper-sdk
Go to settings and check if the path for your Sdk is correct
In my case issue was with the Emulator OS and API.
I used following combination and it worked:
Device: Pixel 4a
OS: Android 12
API: (Release Name: S, API level: 31, ABI: arm64-v8a, Target: Android 12
I also faced this issue, I was not seeing android simulator and the app to select, but it was working fine for iOS without any config.
The problem with my setup was that in the Flipper settings, the android SDK's path was not correct, after updating the path and restarting Flipper, it automatically detected the simulator and the app.
Hope this helps.
I was able to solve that on Android, open ReactNativeFlipper.java file
In the first line package com.yourappname; change it to exactly your package name inside AndroidManifest.xml
In the MainApplication.java there is a line like
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
inside onCreate() function. In my project this line was commented. I removed the comment and run react-native run-android and flipper get connected to the app

Flutter with FirebaseAppDistribution ignore "--target"

Updated (07 Nov 2019)
I've tried the following command and it works as expected
Assume that flavor=Staging and build=Release, Build_Variant=StagingRelease.
And based on Flutter entry point file (--target)=lib/main_stg.dart
./gradlew appDistributionUploadStagingRelease --project-prop target=lib/main_stg.dart
It seems like appDistributionUploadStagingRelease re-build apk even though assembleStagingRelease is not added in the command.
Issue
I've a project which contain the following flavors and targets
Flavors
- Dev
- Staging
- Production
Targets (<project_root/lib>)
- main_dev.dart (development)
- main_stg.dart (staging)
- main.dart (production)
I've been using this command
flutter build --release --target staging --t lib/main_stg.dart for building Staging.
However, when executing FirebaseAppDistribution using ./gradlew appDistributionStagingRelease, the uploaded APK ignore lib/main_stg.dart and use lib/main.dart.
Further check on the log indicate that it does not rebuild
> Task :app:appDistributionUploadStagingRelease
Found APK at <project_root>/build/app/outputs/apk/staging/release/app-staging-release.apk.
Uploading APK to Firebase App Distribution...
Getting appId from output of google services plugin
This APK has not been uploaded before.
Uploading the APK.
Uploaded APK successfully 202
No release notes passed in. Skipping this step.
Added testers/groups successfully 200
App Distribution upload finished successfully!
Does any Flutter dev encounter similar issue? Kindly guide me for this.
Thank You

new blackberry app world error "bar manifest file package version must be greater than ..."

I've started getting a weird error message when trying to upload a playbook app update to BlackBerry world. I think this problem started after installing version 1.6.1 of their eclipse plugin.
The error message:
"The package version in your .bar manifest file for signals_playbook must be greater than the previous version, but lower than any the next release version added to the vendor portal. . Your .bar manifest file package version must be greater than 3.0. Correct your .bar manifest file and try again to continue."
My AndroidManifest.xml contains:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ca.rcp.mobile.cror.signals"
android:versionCode="7"
android:versionName="3.1" >
The Manifest file contained within the BAR shows this info:
Archive-Manifest-Version: 1.1
Archive-Created-By: Apk2Bar version 1.6.1
Package-Author: xxxxxxxx
Package-Author-Id: some hash xxxxxxxxx
Package-Name: xxxxx.cror.signals
Package-Id: some hash xxxxxxxxx
Package-Version: 1.0.7.1
Package-Version-Id: some hash xxxxxxxx
Package-Type: application
Package-Architecture: armle-v7
Package-Author-Certificate-Hash: some hash xxxxx
Application-Name: Railway Signals
Application-Id: some hash xxxxxxxx
Application-Version: 1.0.7.1
Application-Version-Id: some hash xxxxxxxxxxx
Application-Requires-System: Tablet OS/2.0.0.7109
My system:
Windows 7 x64 using Eclipse 3.7.2 with latest ADT and updates.
I can see why BlackBerry world is complaining, it thinks the version number is 1.0.7.1. How do I get it to show 3.1.0.0??
I tried editing the manifest file contained within the bar, saving it and resubmitting. But that didn't work (didn't think it would but was worth a try).
Does anyone know where is the 1.0.7.1 coming from?
Can I override it?
Thanks
Rob
We suddenly started having the same problem with our builds. Evidently something changed in the BlackBerry build tools. Try setting the application's android:versionName attribute to a 4-part value (such as 3.1.0.1). BlackBerry has always used this format (major.minor.micro.build) for native apps. It seems that unless your Android manifest has the same format, the BlackBerry build tools fail to parse the versionName attribute and use a fall-back. From what I can tell, the fall-back is to use the value of android:versionCode as the micro version in a default application version code; that is it sets the app version in the .bar file manifest to
1.0.<android:versionCode value>.1
(I sure wouldn't want to be the engineer that had to defend implementing this behavior.)
An alternative approach is to create a custom manifest file that has the app version you want. Create a file named MANIFEST.MF in the same directory as AndroidManifest.xml. Then add the specific .bar manifest entries you want. For instance, it might be:
Archive-Manifest-Version: 1.1
Package-Version: 3.1.0.0
Application-Version: 3.1.0.0
Then open the project properties in Eclipse, navigate to BlackBerry, and for the "Custom BAR Manifest" drop-down, select "Add custom values (merge)".
Thank you, Ted!
There is another link on this topic;
http://supportforums.blackberry.com/t5/BlackBerry-World-Development/The-package-version-in-your-bar-manifest-file-for-New-Bundle/td-p/2754567
We started to notice problem after move to Gradle:
Before
AndroidManifest.xml:
android:versionCode="1312310309" android:versionName="2.28.4"
MANIFEST.MF:
Application-Version: 14.1231.309.0
After
AndroidManifest.xml:
android:versionCode="134" android:versionName="2.30.31402271059"
MANIFEST.MF
Application-Version: 1.0.134.0
I also had the same problem but I fixed it by adding this line in my Android Manifest file android:versionCode="30" previously I had android:versionCode="29" so upgraded it by one .And the problem got fixed for me.

updating sencha touch 2 android app

I am trying to submit a update to the google play store for my sencha touch 2 app.
the following is my packager.json file.
{
"applicationName":"DBS",
"applicationId":"com.keshav.dbs",
"versionCode":"2",
"versionString":"1.0.1",
"iconName":"ic_launcher.png",
"inputPath":"./build/package/Android",
"outputPath":"./build/native/Android",
"configuration":"Release",
"platform":"Android",
"deviceType":"Universal",
"certificatePath":"/Developer/Android-Keystore/myAndroidKeyStore",
"certificateAlias":"myandroidkey",
"certificatePassword":"<password>",
"sdkPath":"/Developer/sdks/android-sdk-macosx",
"androidAPILevel":"16",
"orientations": [
"portrait"
]
}
I run the following command
sencha package run packager.json
this creates the apk file however when i try to upload the new apk i get a message saying the versonCode 1 is already in use.
The instruction of packaging on Senchas website dont include the "versionCode" property I added that my self
Does anyone know how to change the version code for sencha app?
I was able to edit platforms/cordova/android/AndroidManifest.xml and update the android:versionCode, then run sencha app build native
It built the new APK (signed, based on my config) and it was accepted by the Google Play store.
Much easier than un-packaging and repackaging.
well here it is ...
After looking around the internet i found this approach works....
After Sencah creates the package use apktool to un-package the apk then edit the AndroidManifest.xml and package it up again with apktool.
Note when you re-package the app tit will be unsigned so you will have to sign it again for it install on peoples devices

Categories

Resources