Android Question Issues with Androidx

epiCode

Active Member
Licensed User
Scenario:
All SDK etc are installed as per instructions from B4A installation and work fine.

Then I open an example which gives following error on compilation:
Legacy-Support-v4 required

Then I install it using B4A SDK Manager
The error changes to androidx.activity required

It keeps giving maven artifacts not found one after the other
after installing like 30+ artifacts it finally moves on and...

the program fails to compile with 2 errors:
Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)

also other programs which compiled just fine with appcompat "earlier" refuse to compile now.


Query:

Is it possible to have a "known to work fine" androidx artifacts or their version (installed-components.txt) shared the same way SDK files in b4a installation process are ?

What we are looking at basic appcompat and support files required by libraries like Drawer / Sliding panel / recycler / preferences.

If anyone has a working set of working androidx, it would be nice if they can compress only the artifacts as defined in "installed-components.txt" (It would be a max of 30 ~ 50mb)

Any other workaround/alternate solutions are welcome.
 
Solution
1. Which drawer are you using
ACToolbar

Thanks!

It did fail but I managed to find a workaround and its compiling fine now


Sharing the steps which worked for me, just in case it helps someone else

1. Removed all files and folder under Android\extra\b4a_local
2. Close b4a and Force close java.exe in Task Manager (if running)
3. Restart b4a - Open project - Clean Project (Ctrl + P)
4. Compile

If this does not work, a clean restore of android\extra\ folder from resources_6_21.zip should (available here...

epiCode

Active Member
Licensed User
AppCompat compiles fine with the recommended SDK.

Which library caused an error?
It does not specify which library (error msg shared above)
I searched the b4x forums and found that similar error was caused by data transport libs which you resolved for someone else earlier by reverting to old version of same libs.
I've done a fresh install. So I don't have logs now.
However, it is a time consuming but reproduceable error.

I can not use any project which require recycler or v4 support - it goes in the same loop as described in post 1
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I searched the b4x forums and found that similar error was caused by data transport libs which you resolved for someone else earlier by reverting to old version of same libs.
Not relevant if you use the recommended SDK.

I can not use any project which require recycler or v4 support - it goes in the same loop as described in post 1
The prepackaged SDK does support these features.
 
Upvote 0

epiCode

Active Member
Licensed User
Not relevant if you use the recommended SDK.


The prepackaged SDK does support these features.

Hey @Erel

I have narrowed down the issue to Appcompat Library v4
My project uses drawer and is dependent on lib AppCompat
and has the following line in code
B4X:
#Extends: android.support.v7.app.AppCompatActivity

Please suggest a workaround which does not involve discarding appcompat features
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
1. Which drawer are you using?
As i ran into the same problem a few weeks ago i guess he is using the AppCompat Drawer.

The solution was to switch to b4xdrawer
 
Upvote 1

epiCode

Active Member
Licensed User
1. Which drawer are you using
ACToolbar

Thanks!

It did fail but I managed to find a workaround and its compiling fine now


Sharing the steps which worked for me, just in case it helps someone else

1. Removed all files and folder under Android\extra\b4a_local
2. Close b4a and Force close java.exe in Task Manager (if running)
3. Restart b4a - Open project - Clean Project (Ctrl + P)
4. Compile

If this does not work, a clean restore of android\extra\ folder from resources_6_21.zip should (available here https://www.b4x.com/b4a.html)

Cheers!
 
Upvote 0
Solution
Top