Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Built dist from master does not contain package android.util #2104

Open
CruorVult opened this issue Jun 12, 2023 · 3 comments
Open

Built dist from master does not contain package android.util #2104

CruorVult opened this issue Jun 12, 2023 · 3 comments
Assignees

Comments

@CruorVult
Copy link

I've built dist (make all_dist) without errors. But when translating sources that uses package android.util, for example SparseArray, it fails.

package android.util does not exist
import android.util.SparseArray;

Using other packages like org.json translates successful

Use this command to translate
"$HOME/j2objc/dist/j2objc" -d "gen" -classpath "$HOME/j2objc/dist/lib/json.jar" --no-package-directories -sourcepath "." "Test.java"

Comparing with public distribution I've noticed that there is no libandroid_util.a in lib folder

@tomball
Copy link
Collaborator

tomball commented Jun 12, 2023

We removed the android.util classes from the jre_emul libraries because with Java 9+ they can't be in the same module as JRE classes. This issue shows there's more work that needs to be done to fix android.util support.

As a temporary workaround, you should be able to just copy the sources you need from this package into your iOS app or a separate library. Several of these classes depend upon com.android.internal.util classes, which can also be included.

@tomball tomball self-assigned this Jun 12, 2023
@CruorVult
Copy link
Author

Tom, thank you for answer! I'll copy the sources as you recommended.

@blazek
Copy link

blazek commented Sep 9, 2024

I would be nice to get fixed.

It would be useful to mention this in build instructions https://developers.google.com/j2objc/guides/building-j2obj.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants