Android Question Maven artifact not found: androidx.legacy/legacy-support-core-utils

mjcoon

Well-Known Member
Licensed User
I'm new to B4A (despite using B4P way back), so have a fresh download of V9.80. And would like to use ExternalStorage to access files on my device.

But I get the headline message, which I duly researched on the forum and learnt a bit about migrating to AndroidX and tried to follow the instructions.

The B4A SDK Manager downloaded and installed lots of stuff (some of which is no use because I have an AMD CPU and therefore cannot use the emulator). I concentrated on Platform 28, which is the android.jar chosen on the path settings.

I ran the jetifier tool which performed and now says "nothing to do".

But the headline message still prevents me from compiling the ExternalStorage demo example project.

Any suggestions, please...

Mike.
 

DonManfred

Expert
Licensed User
Longtime User
Can you post your compilationwindow TEXT? Copy the text and post it. Please do not post screenshots.
Like this...

B4A Version: 9.80
Java Version: 11
Parsing code. (0.00s)
Building folders structure. (0.01s)
Compiling code. (0.01s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
(AndroidX SDK) <--------------------------- DOES it appear in your Compilationwindow?
Generating R file. (0.00s)
Compiling generated Java code. (0.09s)
Convert byte code - optimized dex. (1.49s)
Packaging files. (1.52s)
Copying libraries resources (0.00s)
Signing package file (private key). (1.10s)
ZipAlign file. (0.05s)
Installing file to device. (6.44s)
Device serial: 988ad036525346515630
Completed successfully.

If not: Carefully follow the Instalationinstructions:

Start with a new blank folder for the SDK.
 
Upvote 0

Makumbi

Well-Known Member
Licensed User
I'm new to B4A (despite using B4P way back), so have a fresh download of V9.80. And would like to use ExternalStorage to access files on my device.

But I get the headline message, which I duly researched on the forum and learnt a bit about migrating to AndroidX and tried to follow the instructions.

The B4A SDK Manager downloaded and installed lots of stuff (some of which is no use because I have an AMD CPU and therefore cannot use the emulator). I concentrated on Platform 28, which is the android.jar chosen on the path settings.

I ran the jetifier tool which performed and now says "nothing to do".

But the headline message still prevents me from compiling the ExternalStorage demo example project.

Any suggestions, please...

Mike.
You can try reinstalling B4A SDK
 
Upvote 0

moster67

Expert
Licensed User
Longtime User
As to your comment about not being able to use the emulator, actually you should be able to do so now (if your AMD cpu is rather recent, perhaps Ryzen):

One important thing is to enable "Windows Hypervisor Platform" in Windows 10. If you google a bit, you should find instructions about that.

You will also need to install the driver shown below from B4A's Sdk manager.


1581599496385.png



Note: I don't have an AMD cpu but from what I have understood, AMD is now taking back some space in the processor world so it is surely important that AMD is now fully supported by Google.
 
Upvote 0

mjcoon

Well-Known Member
Licensed User
Can you post your compilationwindow TEXT? Copy the text and post it. Please do not post screenshots.
Like this...



If not: Carefully follow the Instalationinstructions:

Start with a new blank folder for the SDK.

Thanks Manfred. My B4A (and my Android Studio for that matter) have successfully compiled other projects; it is just this one (so far) I have a problem with.

The compile yields:

B4A Version: 9.80
Java Version: 11
Parsing code. (0.01s)
Building folders structure. (0.04s)
Compiling code. (0.46s)
Compiling layouts code. (0.01s)
Organizing libraries. Error
Maven artifact not found: androidx.legacy/legacy-support-core-utils

In fact I briefly get the pop-up message "An error occurred. Maven artifact not found: androidx.legacy/legacy-support-core-utils" when I load the project, before trying to compile.

After following the instructions to run the B4A SDK manager (as I reported) I tried using its search function to look for "legacy-support-core-utils" which it reported as having been installed with listing:
androidx.legacy:legacy-support-core-utils (GoogleMaven)
 
Upvote 0

mjcoon

Well-Known Member
Licensed User
Can you post your compilationwindow TEXT? Copy the text and post it. Please do not post screenshots.
Like this...



If not: Carefully follow the Instalationinstructions:

Start with a new blank folder for the SDK.

Thanks Manfred. My B4A (and my Android Studio for that matter) have successfully compiled other projects; it is just this one (so far) that I have a problem with.

The compile yields:

B4A Version: 9.80
Java Version: 11
Parsing code. (0.01s)
Building folders structure. (0.04s)
Compiling code. (0.46s)
Compiling layouts code. (0.01s)
Organizing libraries. Error
Maven artifact not found: androidx.legacy/legacy-support-core-utils

In fact I briefly get the pop-up message "An error occurred. Maven artifact not found: androidx.legacy/legacy-support-core-utils" when I load the project, before trying to compile.

After following the instructions to run the B4A SDK manager (as I reported) I tried using its search function to look for "legacy-support-core-utils" which it reported as having been installed with listing:
androidx.legacy:legacy-support-core-utils (GoogleMaven) Version: 1.0.0

I have to admit I thought that meant the problem was solved, but not so...
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
My B4A (and my Android Studio for that matter) have successfully compiled other projects
Are you using the same SDK in android studio and B4A?
The two SDKs are not compatible.

You should install a seperate SDK only for B4A.

Carefully follow the Instalationinstructions:

Start with a empty blank folder for the new SDK.
 
Upvote 0

mjcoon

Well-Known Member
Licensed User
As to your comment about not being able to use the emulator, actually you should be able to do so now (if your AMD cpu is rather recent, perhaps Ryzen):

One important thing is to enable "Windows Hypervisor Platform" in Windows 10. If you google a bit, you should find instructions about that.

You will also need to install the driver shown below from B4A's Sdk manager.


View attachment 88628


Note: I don't have an AMD cpu but from what I have understood, AMD is now taking back some space in the processor world so it is surely important that AMD is now fully supported by Google.

Thanks Moster, I have successfully made the individual changes you suggested and got the SDK screenshot you showed. But my AMD CPU is several years old: "Athlon II X2 250". There is a bit of conflict whether the Microsoft driver is from 2006 or 2009. I was originally informed I could not run the emulator by Android Studio but that was some years ago and I had not tried since.

Mike.
 
Upvote 0

mjcoon

Well-Known Member
Licensed User
Are you sure that the path under Tools - Configure Paths - android.jar points to the correct Android SDK?

You don't need to run B4A Sdk Manager at all. Carefully follow the installation instructions and download the additional resources: https://www.b4x.com/b4a.html

Thank you Erel, I was not at all sure which would be the "correct" one! Because I have a history of playing with Android I have a lot of partial duplicates to get confused with. But I think I have now sorted it out with your hint.

Maybe that was also the source of the strange message I got from the SDK Manager several times:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.sun.xml.bind.v2.runtime.reflect.opt.Injector$1 (file:/C:/Users/Mike/AppData/Local/Android/sdk/tools/bin/jaxb-impl-2.1.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Please consider reporting this to the maintainers of com.sun.xml.bind.v2.runtime.reflect.opt.Injector$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release

Hopefully I won't see it again (especially if I take your advice not to run the B4A SDK Manager!).

Mike.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Maybe that was also the source of the strange message I got from the SDK Manager several times:
This message is expected and should be ignored.

(especially if I take your advice not to run the B4A SDK Manager!
You can and should run the manager in some cases. However the resources package should include all resources that you need to get started.
 
Upvote 0
Top