Android Question Error when add androidx.datastore:datastore

Pendrush

Well-Known Member
Licensed User
Longtime User
This line
B4X:
#AdditionalJar: androidx.datastore:datastore
require these dependencies:



When I try to compile, I get this error:

Any workaround?
 

drgottjr

Expert
Licensed User
Longtime User
did you try typing "datastore" in the sdkmanager. looks like they're there ready to go
sorry; i misread the post. probably drunk again
 
Last edited:
Upvote 0

Pendrush

Well-Known Member
Licensed User
Longtime User
1. Create empty project.
2. Add this line: #AdditionalJar: androidx.datastore:datastore
B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: portrait
    #CanInstallToExternalStorage: False
    #AdditionalJar: androidx.datastore:datastore
#End Region
3. Install all needed dependencies reported by B4A.
4. You are unable to compile.

The problem: duplicated classes inside datastore dependencies.
.Actual_jvmKt is defined multiple times
I know what the problem is. I don't know how to resolve it.
 
Last edited:
Upvote 0

Pendrush

Well-Known Member
Licensed User
Longtime User
Datastore is dependencies for other lib.
I am trying to create a wrapper library that will be able to be used in B4A.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I was able to get it compiling by removing the jvm dependencies from the POM files.

The attached zip contains the folders that should be under <sdk>\extras\b4a_remote\androidx\datastore

It is possible that you will encounter an error at runtime. I haven't tested the actual functionality.
 

Attachments

  • datastore.zip
    359.8 KB · Views: 5
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…