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

Latest snapshot no longer compatible with android #261

Closed
revonateB0T opened this issue Jan 7, 2025 · 5 comments
Closed

Latest snapshot no longer compatible with android #261

revonateB0T opened this issue Jan 7, 2025 · 5 comments

Comments

@revonateB0T
Copy link

https://github.com/FooIbar/EhViewer/actions/runs/12643061231/job/35228447452

@revonateB0T
Copy link
Author

> Task :app:minifyDefaultReleaseWithR8 FAILED
ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in /home/runner/work/EhViewer/EhViewer/app/build/outputs/mapping/defaultRelease/missing_rules.txt.
ERROR: R8: Missing class javax.xml.stream.Location (referenced from: nl.adaptivity.xmlutil.XmlReader$LocationInfo nl.adaptivity.xmlutil.jdk.StAXReader.getExtLocationInfo())
Missing class javax.xml.stream.XMLInputFactory (referenced from: javax.xml.stream.XMLInputFactory nl.adaptivity.xmlutil.jdk.StAXReader$Companion.safeInputFactory() and 1 other context)
Missing class javax.xml.stream.XMLOutputFactory (referenced from: javax.xml.stream.XMLOutputFactory nl.adaptivity.xmlutil.jdk.StAXWriter$Companion.access$newFactory(nl.adaptivity.xmlutil.jdk.StAXWriter$Companion, boolean) and 2 other contexts)
Missing class javax.xml.stream.XMLStreamException (referenced from: void nl.adaptivity.xmlutil.jdk.StAXReader.close() and 17 other contexts)
Missing class javax.xml.stream.XMLStreamReader (referenced from: javax.xml.stream.XMLStreamReader nl.adaptivity.xmlutil.jdk.StAXReader.delegate and 24 other contexts)
Missing class javax.xml.stream.XMLStreamWriter (referenced from: javax.xml.stream.XMLStreamWriter nl.adaptivity.xmlutil.jdk.StAXWriter.delegate and 20 other contexts)

@revonateB0T
Copy link
Author

Why are you not publishing snapshot per commit?
Snapshot bumps from 20241203 directly to 20250106, impossible to bisect.

@FooIbar
Copy link

FooIbar commented Jan 7, 2025

2c3c7ac removed the -android artifact so serialization will be resolved to serialization-jvm, which depends on core-jdk, and that's the problem for android builds.

val jvmMain by getting {
dependencies {
runtimeOnly(projects.coreJdk)
}
}

Here is a workaround on the consumer side:

configurations.all {
    resolutionStrategy.dependencySubstitution {
        substitute(module("io.github.pdvrieze.xmlutil:serialization"))
            .using(module("io.github.pdvrieze.xmlutil:serialization-android:0.90.4-20241203.194031-11"))
    }
}

@pdvrieze
Copy link
Owner

pdvrieze commented Jan 7, 2025

@revonateB0T Snapshots are auto-published on push. As I am the sole developer I don't always push the commits, and certainly not on each (small) commit. In this case there is only one relevant commit (from Dec 9) that attempts to build the library with kotlin 2.1.0 (the other commit is updating one of the examples that is not even published as binary).

As to what happened, the way that the android version was implemented is as additional target/variant with manually specified attributes. While I had already created some sort of solution for the -core library I hadn't done that for -serialization yet. Unfortunately when doing so I accidentally retained the dependency on -core-jdk rather than -core (plain).

The correct workaround would be to do this substitution on -core-jdk as the serialization modules are identical (they used to have different class formats) except for their dependencies. The new solution should still have a serialization-android artefact, but this should just be a forwarding dependency.

In any case I have updated the dependency, and things should work now (once a new snapshot has been generated). Please let me know (so I can create a proper release - perhaps an rc first).

@FooIbar
Copy link

FooIbar commented Jan 7, 2025

I can confirm that the new snapshot is working fine. Thanks for the quick fix!

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