Android Question need help: is there a compatibility issue between v11 to v12 ?

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
Following Erel's suggestion – I open a new thread

Here are the facts that caused the entire story
  • I have an existing app in google play store with many users

  • As B4A v12 was released I updated my B4A to v12

  • Trying to open the project with v12 and compile it generated many errors, on another post I was recommended to add the line #multidex: true – that resolved the issue and my app was compiled and an APK was generated

  • Then to test it I tried to update the app on my phone – got an error that the APK is not compatible
    tried it with a few other devices – same result
    a new app with compiled with v12 wont update an existing v11 app

  • Tried to compile on another machine still with v11 – all is perfect (removed the multidex: true line)

  • Made another test – took another app that required multidex: true as this one (the other is a small non commercial app so I could "play" with it – compiled it with a lower version number, removed it from my device and installed the new one (made with v12 and multidex) – then opened google play which immediately updated the app with the one in the store
    so the result as I see it is that google paly store managed to handle that update from v12 with multidex to v11 no multidex
Note:
there was no change in code other than adding multidex: true
In v12 it was mandatory as it wouldn't even complile without it
Did not change even one bit other than that

My problem is that I can't ask all existing users to remove and reinstall the app

I need help in resolving that issue

Is it v12 or multidex that caused the incompatibility?

If I will upload the new version (v12 & multidex) – will it update the existing clients with older version (v11 no multidex)?

Or any other idea?

Thank you
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Then to test it I tried to update the app on my phone – got an error that the APK is not compatible
1. Are you using ADB / USB debug mode? Please do and post the error message from the compilation window.
2. Are you testing your app on Android 4 devices? Enabling multidex limits the app to Android 5+.


There are no compatibility issues between B4A v12 and previous versions. Almost all developers are already using B4A v12 and updating their apps successfully. No one needs to uninstall any app. Many use multidex.
 
Last edited:
Upvote 0

Sagenut

Expert
Licensed User
Longtime User
Together with B4A did you downloaded even the New Android SDK + Resources from the B4A Installation Instructions?
Because it got an important update.
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
1. Are you using ADB / USB debug mode? Please do and post the error message from the compilation window.
2. Are you testing your app on Android 4 devices? Enabling multidex limits the app to Android 5+.


There are no compatibility issues between B4A v12 and previous versions. Almost all developers are already using B4A v12 and updating their apps successfully. No one needs to uninstall any app. Many use multidex.
thanks Erel for your reply.

1.
usually i do use usb debugging, this time i did not - i just created the APK as there was no code change and transfered it to the phone, then tried to run it and got the error it is not compattible

2.
no - i tried on android 13 on samsung s22 ultra

please note -there was no change at all other than adding multidex: true
so in that case it was supposed to be seemless and update but it did not
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
Together with B4A did you downloaded even the New Android SDK + Resources from the B4A Installation Instructions?
Because it got an important update.
i followed the instructions to the last one
then when i had the compilation problems i did add multidex and updated the maven lib
the fact is that now it compiles perfectly and if i install it it works perfectly
but not update if there is an existing installation made with v11
you can see the entire process in the old thread here including all errors and fix recommendation i got

 
Upvote 0

mcqueccu

Well-Known Member
Licensed User
Longtime User
Hello Zeev,
One thing just came to mind, I don't know if its related but I will say it anyway.

1. When you have an application downloaded from the play store on your device, and you compile another one from your IDE while the play store version is installed, It will warn you that the two apps are incompatible. Either the IDE one will overwrite the playstore one before the application can run.


2. Did you get an error when you uploaded the new version with #MULTIDEX to the playstore? if not, then am sure your users will not get any error updating to the latest version.

CLOSED TESTING:
1. You can test this theory by installing the current app version from play store on a secondary device.
2. Enroll a secondary device in your beta testing program.
3. Upload a new update on the play store to closed testing, when it's approved, update the secondary device application with the new update and confirm if it works or not.
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
Hello Zeev,
One thing just came to mind, I don't know if its related but I will say it anyway.

1. When you have an application downloaded from the play store on your device, and you compile another one from your IDE while the play store version is installed, It will warn you that the two apps are incompatible. Either the IDE one will overwrite the playstore one before the application can run.


2. Did you get an error when you uploaded the new version with #MULTIDEX to the playstore? if not, then am sure your users will not get any error updating to the latest version.

CLOSED TESTING:
1. You can test this theory by installing the current app version from play store on a secondary device.
2. Enroll a secondary device in your beta testing program.
3. Upload a new update on the play store to closed testing, when it's approved, update the secondary device application with the new update and confirm if it works or not.
thank you for your reply
due to the nature of our app we do not offer beta
we have a qa group that get the new apk and test it
the flow is simple
if the app in the store is version 10 then we will compile the new one to version 11 and give it to the qa group
they will run the apk and overwrite the app on their device, by this the store will not try to update as the installed version is higher
once all checks out we will regenerate the apk with version 12 and upload to the store
i did not dare to upload the app to the store as it failed to update on the first attempt on the developpers devices so we did not even get to qa
mind you - there was no change to the code - we just opened it with v12 for testing and then the sky fell on our heads
now we stand still - we have an active app on the store that was compiled with v11 and it works like charm
we have updated B4A to v12 and now we're stuck with it as we can't keep on update the app
one option is go back to v11 but then we go out of the normat update routine of b4a and i don't want that
so how shall i now proceed?

one thing is for sure - it all started with v12 update or multidex
so the solution must be somewhere there
either find a way to go back to singledex or any other idea
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
Hello Zeev,
One thing just came to mind, I don't know if its related but I will say it anyway.

1. When you have an application downloaded from the play store on your device, and you compile another one from your IDE while the play store version is installed, It will warn you that the two apps are incompatible. Either the IDE one will overwrite the playstore one before the application can run.


2. Did you get an error when you uploaded the new version with #MULTIDEX to the playstore? if not, then am sure your users will not get any error updating to the latest version.

CLOSED TESTING:
1. You can test this theory by installing the current app version from play store on a secondary device.
2. Enroll a secondary device in your beta testing program.
3. Upload a new update on the play store to closed testing, when it's approved, update the secondary device application with the new update and confirm if it works or not.
as per 2
i don't dare to upload the new version to google play as we can't even test it - when trying to update - using the apk and overwrite the existing one we get error so how can i rely on that? how can i be sure the store will update my clients if directly from apk it does not?
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
ok, done as Erel suggested, strange results...
used USB debugging
on the device was am older version from google play store (no multidex) as all my clients do
the updated version is higher than the one existing on the device
the updated version is debug version (not release)

target sdk is set to 31
there was no change to code or anything - just trying to run the app from the IDE

device#1: Huawei Mate 9 with Android v9the new app was installed and run perfectly - no issues no warnings

device #2: Samsung Galaxy S22 Ultra with Android v13
the new app failed to install - got the following error message
naturally the older version was not harmed
Screenshot_20221213_084041_Package installer.jpg
 
Upvote 0

mcqueccu

Well-Known Member
Licensed User
Longtime User
ok, done as Erel suggested, strange results...
used USB debugging
on the device was am older version from google play store (no multidex) as all my clients do
the updated version is higher than the one existing on the device
the updated version is debug version (not release)

target sdk is set to 31
there was no change to code or anything - just trying to run the app from the IDE

device#1: Huawei Mate 9 with Android v9the new app was installed and run perfectly - no issues no warnings

device #2: Samsung Galaxy S22 Ultra with Android v13
the new app failed to install - got the following error message
naturally the older version was not harmed
View attachment 136954

This is bridge connection Not USB debugging

>>>Use USB cable and connect the phone to your PC.
>>>Make sure Developer mode is enabled on the device and allow USB debugging.
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
This is bridge connection Not USB debugging

>>>Use USB cable and connect the phone to your PC.
>>>Make sure Developer mode is enabled on the device and allow USB debugging.
you're right, sorry
fixed it and here is the error list i got


B4A Version: 12.00
Parsing code. (0.11s)
Java Version: 11
Building folders structure. (0.33s)
Compiling code. (0.20s)
Compiling layouts code. (0.03s)
Organizing libraries. (0.35s)
(AndroidX SDK)
Compiling resources (1.45s)
Linking resources (0.88s)
Compiling debugger engine code. (2.45s)
Compiling generated Java code. (5.04s)
Finding libraries that need to be dexed. (0.01s)
Dex code (5.02s)
Dex merge (5.13s)
Copying libraries resources (5.20s)
ZipAlign file. (0.07s)
Signing package file (private key). (0.91s)
Installing file to device. Error
adb: failed to install WebEFT4Android_RAPID_DEBUG.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl1128612403.tmp/base.apk (at Binary XML file line #54): net.appbyweb.cardreader.NfcScanner: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]
 
Upvote 0

mcqueccu

Well-Known Member
Licensed User
Longtime User
you're right, sorry
fixed it and here is the error list i got


B4A Version: 12.00
Parsing code. (0.11s)
Java Version: 11
Building folders structure. (0.33s)
Compiling code. (0.20s)
Compiling layouts code. (0.03s)
Organizing libraries. (0.35s)
(AndroidX SDK)
Compiling resources (1.45s)
Linking resources (0.88s)
Compiling debugger engine code. (2.45s)
Compiling generated Java code. (5.04s)
Finding libraries that need to be dexed. (0.01s)
Dex code (5.02s)
Dex merge (5.13s)
Copying libraries resources (5.20s)
ZipAlign file. (0.07s)
Signing package file (private key). (0.91s)
Installing file to device. Error
adb: failed to install WebEFT4Android_RAPID_DEBUG.apk: Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: Failed parse during installPackageLI: /data/app/vmdl1128612403.tmp/base.apk (at Binary XML file line #54): net.appbyweb.cardreader.NfcScanner: Targeting S+ (version 31 and above) requires that an explicit value for android:exported be defined when intent filters are present]
You have your answer. There is a problem with the manifest. You need to define android:exported explicitly for the nfcscanner

Or You can recreate new one.
1. Copy it to a text file.
2. Delete everything and save. It will automatically recreate the basic manifest.
3. Add your manifest entries
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
You have your answer. There is a problem with the manifest. You need to define android:exported explicitly for the nfcscanner

Or You can recreate new one.
1. Copy it to a text file.
2. Delete everything and save. It will automatically recreate the basic manifest.
3. Add your manifest entries
thank you

this is the section in my manifest (line 54 is marked)
i can't remove it as it belongs to an external lib i need


AddApplicationText(
<activity
android:name="net.appbyweb.cardreader.NfcScanner"
android:label="Test Activity">
<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED" />
<action android:name="android.nfc.action.TAG_DISCOVERED" />
</intent-filter>
</activity>
)

2022-12-13 10_53_54-Manifest Editor.png
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
thank you

this is the section in my manifest (line 54 is marked)
i can't remove it as it belongs to an external lib i need


AddApplicationText(
<activity
android:name="net.appbyweb.cardreader.NfcScanner"
android:label="Test Activity">
<intent-filter>
<action android:name="android.nfc.action.TECH_DISCOVERED" />
<action android:name="android.nfc.action.TAG_DISCOVERED" />
</intent-filter>
</activity>
)

View attachment 136956
One more thing,
If the manifest has an error how does it work if I install a fresh apk not update?
As I said if I remove the existing app (with no multidex) the new app (with multidex) will install and run

Something is very strange here
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
You need to ask google.


You got told already. Please stop ignoring tips

B4X:
android:exported="true"
must be added to the nfcactivity-entry in the manifest.
Firstly thanks
Secondly I did not and do not ignore any tip I get here, this is why I asked for help
I may be missed it, I will follow the tip and hope it will solve the issue
I will of course update on the results
Once again thanks
 
Upvote 0
Top