Android Question help needed: after update to v12 got a strange error

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
hi

after updating to version 12 i got the following error when compiling

B4A Version: 12.00
Parsing code. (0.13s)
Java Version: 11
Building folders structure. (0.02s)
Compiling code. (0.10s)

ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code. (0.02s)
Organizing libraries. Error
Maven artifact not found: com.google.android.play/core
Source: InAppUpdate

anyone can help?
thanks
 

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
when removing all google play related code and then tried to compile i got this:

it was all perfect on previous version of B4A - it all started after updating to v 12


B4A Version: 12.00
Parsing code. (0.14s)
Java Version: 11
Building folders structure. (0.28s)
Compiling code. (0.18s)
Compiling layouts code. (0.03s)
Organizing libraries. (0.03s)
(AndroidX SDK)
Compiling resources (1.74s)
Linking resources (0.85s)
Compiling debugger engine code. (2.54s)
Compiling generated Java code. (3.28s)
Finding libraries that need to be dexed. (0.01s)
Dex code (4.40s)
Dex merge Error
Error: Cannot fit requested classes in a single dex file (# fields: 77756 > 65536). Try supplying a main-dex list
Compilation failed
Exception in thread "main" java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, position: null
at com.android.tools.r8.internal.vj.a(R8_3.3.20-dev+aosp1_dd4c01853fd917497aef2d09abff533f0d25b062517ea74449d40e1778a34753:98)
at com.android.tools.r8.D8.main(R8_3.3.20-dev+aosp1_dd4c01853fd917497aef2d09abff533f0d25b062517ea74449d40e1778a34753:4)
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, position: null
at Version.fakeStackEntry(Version_3.3.20-dev+aosp1.java:0)
at com.android.tools.r8.internal.vj.a(R8_3.3.20-dev+aosp1_dd4c01853fd917497aef2d09abff533f0d25b062517ea74449d40e1778a34753:75)
at com.android.tools.r8.internal.vj.a(R8_3.3.20-dev+aosp1_dd4c01853fd917497aef2d09abff533f0d25b062517ea74449d40e1778a34753:28)
at com.android.tools.r8.internal.vj.a(R8_3.3.20-dev+aosp1_dd4c01853fd917497aef2d09abff533f0d25b062517ea74449d40e1778a34753:27)
at com.android.tools.r8.internal.vj.b(R8_3.3.20-dev+aosp1_dd4c01853fd917497aef2d09abff533f0d25b062517ea74449d40e1778a34753:2)
at com.android.tools.r8.D8.a(R8_3.3.20-dev+aosp1_dd4c01853fd917497aef2d09abff533f0d25b062517ea74449d40e1778a34753:22)
at com.android.tools.r8.D8.a(R8_3.3.20-dev+aosp1_dd4c01853fd917497aef2d09abff533f0d25b062517ea74449d40e1778a34753:17)
at com.android.tools.r8.internal.vj.a(R8_3.3.20-dev+aosp1_dd4c01853fd917497aef2d09abff533f0d25b062517ea74449d40e1778a34753:85)
... 1 more
Caused by: com.android.tools.r8.internal.f: Cannot fit requested classes in a single dex file (# fields: 77756 > 65536)
at com.android.tools.r8.internal.YS.a(R8_3.3.20-dev+aosp1_dd4c01853fd917497aef2d09abff533f0d25b062517ea74449d40e1778a34753:14)
at com.android.tools.r8.internal.YS.a(R8_3.3.20-dev+aosp1_dd4c01853fd917497aef2d09abff533f0d25b062517ea74449d40e1778a34753:22)
at com.android.tools.r8.internal.v20.a(R8_3.3.20-dev+aosp1_dd4c01853fd917497aef2d09abff533f0d25b062517ea74449d40e1778a34753:565)
at com.android.tools.r8.internal.r20.a(R8_3.3.20-dev+aosp1_dd4c01853fd917497aef2d09abff533f0d25b062517ea74449d40e1778a34753:7)
at com.android.tools.r8.internal.D2.a(R8_3.3.20-dev+aosp1_dd4c01853fd917497aef2d09abff533f0d25b062517ea74449d40e1778a34753:335)
at com.android.tools.r8.internal.D2.a(R8_3.3.20-dev+aosp1_dd4c01853fd917497aef2d09abff533f0d25b062517ea74449d40e1778a34753:412)
at com.android.tools.r8.D8.d(R8_3.3.20-dev+aosp1_dd4c01853fd917497aef2d09abff533f0d25b062517ea74449d40e1778a34753:794)
at com.android.tools.r8.D8.c(R8_3.3.20-dev+aosp1_dd4c01853fd917497aef2d09abff533f0d25b062517ea74449d40e1778a34753:1)
at com.android.tools.r8.internal.vj.a(R8_3.3.20-dev+aosp1_dd4c01853fd917497aef2d09abff533f0d25b062517ea74449d40e1778a34753:24)
... 5 more
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
i think the two errors are not related
i'm happy to remove the first section that is related to google play - i don't really need it
but the second one seems to be more critical and i can't even get my app to compile

thanks
 
Upvote 0

mcqueccu

Well-Known Member
Licensed User
Longtime User
1. First one you need to update the SDK Manager with only the core library.
OPen the SDK Manager, but make sure to DESELECT everything first. Install ONLY the core library by searching

com.google.android.play:core and install

1670325064518.png


2. Add #Multidex: True to the Main Module
 
Last edited:
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
1. First one you need to update the SDK Manager with only the core library.
OPen the SDK Manager, but make sure to DESELECT everything first. Install ONLY the core library

Next Search com.google.android.play:core and install

View attachment 136782

2. Add #Multidex: True to the Main Module
thank you
i will do as you said and revert asap
once again thanks
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
1. First one you need to update the SDK Manager with only the core library.
OPen the SDK Manager, but make sure to DESELECT everything first. Install ONLY the core library by searching

com.google.android.play:core and install

View attachment 136782

2. Add #Multidex: True to the Main Module
my dear pal
you're a live saviour!!
thank you so much
everything now is perfect

if i may ask - what is the recommended targetSDK now? 32 or 33 ?

once again - thank you so much for your help
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
Seems like there is still a problem
I did all you recommended, compiling went OK and it created the apk file, but I will not install - it says the package is not valid (I'm trying to update an existing app on the device)

Any idea?

Thanks
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
Uninstall the previous version and try again
That can work on my device, what about clients with active app? I can't just tell them all to uninstall first...
It should be updated by Google play store

edit:
i tested 3 apps
1 with no multidex: true
this one was updated perfectly
the other 2 i had to add multidex: true - these two did not install
i think it is related to multidex...
is there a way to bypass or resolve it?
 
Last edited:
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
checked as you recommended with ^B - no change at all
Tried to remove the existing app and then reinstall it using the new apk - it worked.
But this few no solution as I have many active working clients and I can't send them to remove and reinstall, it should update from play store.
Why this happened?
Why the is now unable to update?
This is a disaster
Is this a defect in B4A?
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
made an odd test:
i generated an apk with lower version number than the one in google pay
i removed the existing app from my device
i installed the new one (lower version and multidex: true)
after i saw that it worked perfectly i opened google play and it was updated automatically with no issues

so the thing is - is it only one way?
because when the original app (no mulidex) was installed i couldn't install the new one (with multidex), but when multidex app was installed it did update from the store with the "older" version (no multidex)
seems like it is something new with v12 or multidex or ?
how can i avoid this? either by not using multidex or any other way so it will be able to be sure that the new version (with multidex) will update from the store and not forcing all the existing users to uninstall the app?

thanks
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
No. This is an Android restriction.

No.

Has nothing to do with multidex.
Thank you Erel.
There was no change in my app whatsoever. I just updated to v12 of B4A and the issues started - I had to add multidex or compilation did not pass. Then after this update the app doesn't work.

Same code - no change
Just v12

So how can it be android if nothing changed other than B4A to v12?

How do I resolve this issue? How can I make my app to update the existing users app from Google play?

Thanks
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
The Android SDK was updated and your app now hits the single dex limit. Nothing worth talking about.
I don't exactly know what you did but it was never possible to install an app with a lower version code.
For the test I removed the app from my phone, then I compiled the app with lower version, the original was 35 and the new test 34, then I installed it directly using the api.
The app installed and worked (this one was with multidex)
Then when I opened Google play it updated the app to the one in the store (v35 no multidex)
So how do I now go?
Update the old version (no multidex) worth the new one (with multidex) directly using the apk failed, but the other way around worked.

The big issue is how do I continue? All my clients are with the app without multidex, I can't just send them all to remove it and reinstall
I can't believe Google changed it so it is not compatible anymore, what should I do?
If I upload the new app to the store will it update my existing clients?
 
Upvote 0
Top