minio / minio-java

MinIO Client SDK for Java
https://docs.min.io/docs/java-client-quickstart-guide.html
Apache License 2.0
1.11k stars 484 forks source link

Do you have plans to launch an SDK for Android? #1580

Closed jimie-chaos closed 1 month ago

jimie-chaos commented 1 month ago

2024-09-22 edit: My friend Found The Solve:

// Add on Module `build.gradle.kts
implementation 'org.codehaus.woodstox:woodstox-core-asl:4.2.0' // Woodstox XML 解析器
implementation 'javax.xml.stream:stax-api:1.0-2' // StAX API

But it may cause new conflicts

balamurugana commented 1 month ago

What is the issue you are facing with Android now?

stdStudent commented 1 month ago

@balamurugana, there are incompatibilities on some phones. For example, I believe minio pulls the aalto-xml dependency, which can lead to this error:

E  FATAL EXCEPTION: DefaultDispatcher-worker-8
                 Process: some.app.name, PID: 11111
                 java.lang.ExceptionInInitializerError
                  at org.simpleframework.xml.stream.NodeBuilder.read(NodeBuilder.java:71)
                  at org.simpleframework.xml.core.Persister.read(Persister.java:562)
                  at org.simpleframework.xml.core.Persister.read(Persister.java:462)
                  at io.minio.Xml.unmarshal(Xml.java:53)
                  at io.minio.MinioClient.createMultipartUpload(MinioClient.java:7293)
                  at io.minio.MinioClient.putObject(MinioClient.java:4694)
                  at io.minio.MinioClient.putObject(MinioClient.java:4881)
                  at some.app.name.remote.s3.MinioCloudUploadImpl.uploadData(MinioCloudUploadImpl.kt:50)
                  // ...
                 Caused by: java.lang.ClassCastException: com.fasterxml.aalto.stax.InputFactoryImpl cannot be cast to javax.xml.stream.XMLInputFactory
                  at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:136)
                  at org.simpleframework.xml.stream.StreamProvider.<init>(StreamProvider.java:61)
                  at org.simpleframework.xml.stream.ProviderFactory.getInstance(ProviderFactory.java:38)
                  at org.simpleframework.xml.stream.NodeBuilder.<clinit>(NodeBuilder.java:45)
                  ... 19 more

I tried to use a different implementation (i.e. com.fasterxml.woodstox:woodstox-core), but that just led to the same error (Caused by: java.lang.ClassCastException: com.fasterxml.aalto.stax.InputFactoryImpl cannot be cast to javax.xml.stream.XMLInputFactory).

At this point I don't know what is the origin of this problem. Should I open a new issue here?

balamurugana commented 1 month ago

We do not depend on aalto-xml or woodstox. Below is the dependency tree

$ ./gradlew --console plain api:dependencies

> Task :api:dependencies

------------------------------------------------------------
Project ':api'
------------------------------------------------------------

annotationProcessor - Annotation processors and their dependencies for source set 'main'.
No dependencies

api - API dependencies for the 'main' feature. (n)
+--- com.carrotsearch.thirdparty:simple-xml-safe:2.7.1 (n)
+--- com.google.guava:guava:33.0.0-jre (n)
+--- com.squareup.okhttp3:okhttp:4.12.0 (n)
+--- com.fasterxml.jackson.core:jackson-annotations:2.16.1 (n)
+--- com.fasterxml.jackson.core:jackson-core:2.16.1 (n)
+--- com.fasterxml.jackson.core:jackson-databind:2.16.1 (n)
+--- org.bouncycastle:bcprov-jdk18on:1.78 (n)
+--- org.apache.commons:commons-compress:1.26.0 (n)
+--- commons-codec:commons-codec:1.16.1 (n)
\--- org.xerial.snappy:snappy-java:1.1.10.5 (n)

apiElements - API elements for the 'main' feature. (n)
No dependencies

compileClasspath - Compile classpath for source set 'main'.
+--- com.carrotsearch.thirdparty:simple-xml-safe:2.7.1
+--- com.google.guava:guava:33.0.0-jre
|    +--- com.google.guava:failureaccess:1.0.2
|    +--- com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|    +--- com.google.code.findbugs:jsr305:3.0.2
|    +--- org.checkerframework:checker-qual:3.41.0
|    +--- com.google.errorprone:error_prone_annotations:2.23.0
|    \--- com.google.j2objc:j2objc-annotations:2.8
+--- com.squareup.okhttp3:okhttp:4.12.0
|    +--- com.squareup.okio:okio:3.6.0
|    |    \--- com.squareup.okio:okio-jvm:3.6.0
|    |         +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10
|    |         |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.10
|    |         |    |    +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10
|    |         |    |    \--- org.jetbrains:annotations:13.0
|    |         |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10
|    |         |         \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.10 (*)
|    |         \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10
|    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21 -> 1.9.10 (*)
+--- com.fasterxml.jackson.core:jackson-annotations:2.16.1
|    \--- com.fasterxml.jackson:jackson-bom:2.16.1
|         +--- com.fasterxml.jackson.core:jackson-annotations:2.16.1 (c)
|         +--- com.fasterxml.jackson.core:jackson-core:2.16.1 (c)
|         \--- com.fasterxml.jackson.core:jackson-databind:2.16.1 (c)
+--- com.fasterxml.jackson.core:jackson-core:2.16.1
|    \--- com.fasterxml.jackson:jackson-bom:2.16.1 (*)
+--- com.fasterxml.jackson.core:jackson-databind:2.16.1
|    +--- com.fasterxml.jackson.core:jackson-annotations:2.16.1 (*)
|    +--- com.fasterxml.jackson.core:jackson-core:2.16.1 (*)
|    \--- com.fasterxml.jackson:jackson-bom:2.16.1 (*)
+--- org.bouncycastle:bcprov-jdk18on:1.78
+--- org.apache.commons:commons-compress:1.26.0
|    +--- commons-io:commons-io:2.15.1
|    \--- org.apache.commons:commons-lang3:3.14.0
+--- commons-codec:commons-codec:1.16.1
+--- org.xerial.snappy:snappy-java:1.1.10.5
\--- com.github.spotbugs:spotbugs-annotations:4.8.3
     \--- com.google.code.findbugs:jsr305:3.0.2

compileOnly - Compile-only dependencies for the 'main' feature. (n)
\--- com.github.spotbugs:spotbugs-annotations:4.8.3 (n)

compileOnlyApi - Compile-only API dependencies for the 'main' feature. (n)
No dependencies

default - Configuration for default artifacts. (n)
No dependencies

implementation - Implementation dependencies for the 'main' feature. (n)
No dependencies

javadocElements - javadoc elements for main. (n)
No dependencies

mainSourceElements - List of source directories contained in the Main SourceSet. (n)
No dependencies

runtimeClasspath - Runtime classpath of source set 'main'.
+--- com.carrotsearch.thirdparty:simple-xml-safe:2.7.1
+--- com.google.guava:guava:33.0.0-jre
|    +--- com.google.guava:failureaccess:1.0.2
|    +--- com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|    +--- com.google.code.findbugs:jsr305:3.0.2
|    +--- org.checkerframework:checker-qual:3.41.0
|    \--- com.google.errorprone:error_prone_annotations:2.23.0
+--- com.squareup.okhttp3:okhttp:4.12.0
|    +--- com.squareup.okio:okio:3.6.0
|    |    \--- com.squareup.okio:okio-jvm:3.6.0
|    |         +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10
|    |         |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.10
|    |         |    |    +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10
|    |         |    |    \--- org.jetbrains:annotations:13.0
|    |         |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10
|    |         |         \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.10 (*)
|    |         \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10
|    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21 -> 1.9.10 (*)
+--- com.fasterxml.jackson.core:jackson-annotations:2.16.1
|    \--- com.fasterxml.jackson:jackson-bom:2.16.1
|         +--- com.fasterxml.jackson.core:jackson-annotations:2.16.1 (c)
|         +--- com.fasterxml.jackson.core:jackson-core:2.16.1 (c)
|         \--- com.fasterxml.jackson.core:jackson-databind:2.16.1 (c)
+--- com.fasterxml.jackson.core:jackson-core:2.16.1
|    \--- com.fasterxml.jackson:jackson-bom:2.16.1 (*)
+--- com.fasterxml.jackson.core:jackson-databind:2.16.1
|    +--- com.fasterxml.jackson.core:jackson-annotations:2.16.1 (*)
|    +--- com.fasterxml.jackson.core:jackson-core:2.16.1 (*)
|    \--- com.fasterxml.jackson:jackson-bom:2.16.1 (*)
+--- org.bouncycastle:bcprov-jdk18on:1.78
+--- org.apache.commons:commons-compress:1.26.0
|    +--- commons-io:commons-io:2.15.1
|    \--- org.apache.commons:commons-lang3:3.14.0
+--- commons-codec:commons-codec:1.16.1
\--- org.xerial.snappy:snappy-java:1.1.10.5

runtimeElements - Runtime elements for the 'main' feature. (n)
No dependencies

runtimeOnly - Runtime-only dependencies for the 'main' feature. (n)
No dependencies

shadow
No dependencies

shadowRuntimeElements (n)
No dependencies

signatures (n)
No dependencies

sourcesElements - sources elements for main. (n)
No dependencies

spotbugs - configuration for the SpotBugs engine
\--- com.github.spotbugs:spotbugs:4.8.0
     +--- jaxen:jaxen:2.0.0
     +--- net.sf.saxon:Saxon-HE:12.3
     |    \--- org.xmlresolver:xmlresolver:5.2.0
     |         +--- org.apache.httpcomponents.client5:httpclient5:5.1.3
     |         |    +--- org.apache.httpcomponents.core5:httpcore5:5.1.3
     |         |    +--- org.apache.httpcomponents.core5:httpcore5-h2:5.1.3
     |         |    |    \--- org.apache.httpcomponents.core5:httpcore5:5.1.3
     |         |    +--- org.slf4j:slf4j-api:1.7.25 -> 2.0.9
     |         |    \--- commons-codec:commons-codec:1.15
     |         \--- org.apache.httpcomponents.core5:httpcore5:5.1.3
     +--- org.apache.logging.log4j:log4j-core:2.20.0
     |    \--- org.apache.logging.log4j:log4j-api:2.20.0
     +--- org.ow2.asm:asm:9.6
     +--- org.ow2.asm:asm-analysis:9.6
     |    \--- org.ow2.asm:asm-tree:9.6
     |         \--- org.ow2.asm:asm:9.6
     +--- org.ow2.asm:asm-commons:9.6
     |    +--- org.ow2.asm:asm:9.6
     |    \--- org.ow2.asm:asm-tree:9.6 (*)
     +--- org.ow2.asm:asm-tree:9.6 (*)
     +--- org.ow2.asm:asm-util:9.6
     |    +--- org.ow2.asm:asm:9.6
     |    +--- org.ow2.asm:asm-tree:9.6 (*)
     |    \--- org.ow2.asm:asm-analysis:9.6 (*)
     +--- org.apache.bcel:bcel:6.6.1
     |    \--- org.apache.commons:commons-lang3:3.12.0 -> 3.13.0
     +--- com.github.stephenc.jcip:jcip-annotations:1.0-1
     +--- org.dom4j:dom4j:2.1.4
     +--- org.apache.commons:commons-lang3:3.13.0
     +--- org.apache.commons:commons-text:1.10.0
     |    \--- org.apache.commons:commons-lang3:3.12.0 -> 3.13.0
     +--- org.slf4j:slf4j-api:2.0.9
     +--- com.github.spotbugs:spotbugs-annotations:4.8.0
     |    +--- com.google.code.findbugs:jsr305:3.0.2
     |    \--- org.apache.logging.log4j:log4j-core:{strictly [2.17.1, 3[} -> 2.20.0 (c)
     +--- com.google.code.gson:gson:2.10.1
     \--- org.apache.logging.log4j:log4j-core:{strictly [2.17.1, 3[} -> 2.20.0 (c)

spotbugsPlugins - configuration for the external SpotBugs plugins
No dependencies

spotbugsSlf4j - configuration for the SLF4J provider to run SpotBugs
\--- org.slf4j:slf4j-simple:2.0.0
     \--- org.slf4j:slf4j-api:2.0.0

testAnnotationProcessor - Annotation processors and their dependencies for source set 'test'.
No dependencies

testCompileClasspath - Compile classpath for source set 'test'.
+--- com.carrotsearch.thirdparty:simple-xml-safe:2.7.1
+--- com.google.guava:guava:33.0.0-jre
|    +--- com.google.guava:failureaccess:1.0.2
|    +--- com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|    +--- com.google.code.findbugs:jsr305:3.0.2
|    +--- org.checkerframework:checker-qual:3.41.0
|    +--- com.google.errorprone:error_prone_annotations:2.23.0
|    \--- com.google.j2objc:j2objc-annotations:2.8
+--- com.squareup.okhttp3:okhttp:4.12.0
|    +--- com.squareup.okio:okio:3.6.0
|    |    \--- com.squareup.okio:okio-jvm:3.6.0
|    |         +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10
|    |         |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.10
|    |         |    |    +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10
|    |         |    |    \--- org.jetbrains:annotations:13.0
|    |         |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10
|    |         |         \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.10 (*)
|    |         \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10
|    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21 -> 1.9.10 (*)
+--- com.fasterxml.jackson.core:jackson-annotations:2.16.1
|    \--- com.fasterxml.jackson:jackson-bom:2.16.1
|         +--- com.fasterxml.jackson.core:jackson-annotations:2.16.1 (c)
|         +--- com.fasterxml.jackson.core:jackson-core:2.16.1 (c)
|         \--- com.fasterxml.jackson.core:jackson-databind:2.16.1 (c)
+--- com.fasterxml.jackson.core:jackson-core:2.16.1
|    \--- com.fasterxml.jackson:jackson-bom:2.16.1 (*)
+--- com.fasterxml.jackson.core:jackson-databind:2.16.1
|    +--- com.fasterxml.jackson.core:jackson-annotations:2.16.1 (*)
|    +--- com.fasterxml.jackson.core:jackson-core:2.16.1 (*)
|    \--- com.fasterxml.jackson:jackson-bom:2.16.1 (*)
+--- org.bouncycastle:bcprov-jdk18on:1.78
+--- org.apache.commons:commons-compress:1.26.0
|    +--- commons-io:commons-io:2.15.1
|    \--- org.apache.commons:commons-lang3:3.14.0
+--- commons-codec:commons-codec:1.16.1
+--- org.xerial.snappy:snappy-java:1.1.10.5
+--- com.squareup.okhttp3:mockwebserver:4.12.0
|    +--- com.squareup.okhttp3:okhttp:4.12.0 (*)
|    +--- junit:junit:4.13.2
|    |    \--- org.hamcrest:hamcrest-core:1.3
|    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21 -> 1.9.10 (*)
\--- junit:junit:4.13.2 (*)

testCompileOnly - Compile only dependencies for source set 'test'. (n)
No dependencies

testImplementation - Implementation only dependencies for source set 'test'. (n)
+--- com.squareup.okhttp3:mockwebserver:4.12.0 (n)
\--- junit:junit:4.13.2 (n)

testRuntimeClasspath - Runtime classpath of source set 'test'.
+--- com.carrotsearch.thirdparty:simple-xml-safe:2.7.1
+--- com.google.guava:guava:33.0.0-jre
|    +--- com.google.guava:failureaccess:1.0.2
|    +--- com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
|    +--- com.google.code.findbugs:jsr305:3.0.2
|    +--- org.checkerframework:checker-qual:3.41.0
|    \--- com.google.errorprone:error_prone_annotations:2.23.0
+--- com.squareup.okhttp3:okhttp:4.12.0
|    +--- com.squareup.okio:okio:3.6.0
|    |    \--- com.squareup.okio:okio-jvm:3.6.0
|    |         +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10
|    |         |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.9.10
|    |         |    |    +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10
|    |         |    |    \--- org.jetbrains:annotations:13.0
|    |         |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10
|    |         |         \--- org.jetbrains.kotlin:kotlin-stdlib:1.9.10 (*)
|    |         \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10
|    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21 -> 1.9.10 (*)
+--- com.fasterxml.jackson.core:jackson-annotations:2.16.1
|    \--- com.fasterxml.jackson:jackson-bom:2.16.1
|         +--- com.fasterxml.jackson.core:jackson-annotations:2.16.1 (c)
|         +--- com.fasterxml.jackson.core:jackson-core:2.16.1 (c)
|         \--- com.fasterxml.jackson.core:jackson-databind:2.16.1 (c)
+--- com.fasterxml.jackson.core:jackson-core:2.16.1
|    \--- com.fasterxml.jackson:jackson-bom:2.16.1 (*)
+--- com.fasterxml.jackson.core:jackson-databind:2.16.1
|    +--- com.fasterxml.jackson.core:jackson-annotations:2.16.1 (*)
|    +--- com.fasterxml.jackson.core:jackson-core:2.16.1 (*)
|    \--- com.fasterxml.jackson:jackson-bom:2.16.1 (*)
+--- org.bouncycastle:bcprov-jdk18on:1.78
+--- org.apache.commons:commons-compress:1.26.0
|    +--- commons-io:commons-io:2.15.1
|    \--- org.apache.commons:commons-lang3:3.14.0
+--- commons-codec:commons-codec:1.16.1
+--- org.xerial.snappy:snappy-java:1.1.10.5
+--- com.squareup.okhttp3:mockwebserver:4.12.0
|    +--- com.squareup.okhttp3:okhttp:4.12.0 (*)
|    +--- junit:junit:4.13.2
|    |    \--- org.hamcrest:hamcrest-core:1.3
|    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21 -> 1.9.10 (*)
\--- junit:junit:4.13.2 (*)

testRuntimeOnly - Runtime only dependencies for source set 'test'. (n)
No dependencies

(c) - A dependency constraint, not a dependency. The dependency affected by the constraint occurs elsewhere in the tree.
(*) - Indicates repeated occurrences of a transitive dependency subtree. Gradle expands transitive dependency subtrees only once per project; repeat occurrences only display the root of the subtree, followed by this annotation.

(n) - A dependency or dependency configuration that cannot be resolved.

A web-based, searchable dependency report is available by adding the --scan option.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.6/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 670ms
1 actionable task: 1 executed
stdStudent commented 1 month ago

@balamurugana, thank you! I think, I need com.fasterxml.jackson.core exclusively as a FasterXML implementation.

jimie-chaos commented 1 month ago

@balamurugana so sorry,I'm forget it. problem is MinioClient.putObject throw Exception:Minimum Example phone:redmi note 12 pro android :13

java.lang.RuntimeException: java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/xml/stream/XMLInputFactory;
    at io.minio.S3Base.throwEncapsulatedException(S3Base.java:307)
    at io.minio.MinioClient.putObject(MinioClient.java:1375)
    at zoujunshi.miniotest.MainActivity.upload(MainActivity.kt:80)
    at zoujunshi.miniotest.MainActivity.onCreate$lambda$0(MainActivity.kt:45)
    at zoujunshi.miniotest.MainActivity.$r8$lambda$xo_k2CL1w8v3ecktatkQ58dMU_o(Unknown Source:0)
    at zoujunshi.miniotest.MainActivity$$ExternalSyntheticLambda0.onActivityResult(D8$$SyntheticClass:0)
    at androidx.activity.result.ActivityResultRegistry.doDispatch(ActivityResultRegistry.kt:371)
    at androidx.activity.result.ActivityResultRegistry.dispatchResult(ActivityResultRegistry.kt:331)
    at androidx.activity.ComponentActivity.onActivityResult(ComponentActivity.kt:786)
    at androidx.fragment.app.FragmentActivity.onActivityResult(FragmentActivity.java:152)
    at android.app.Activity.dispatchActivityResult(Activity.java:8932)
    at android.app.ActivityThread.deliverResults(ActivityThread.java:5595)
    at android.app.ActivityThread.handleSendResult(ActivityThread.java:5646)
    at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:67)
    at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2440)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:211)
    at android.os.Looper.loop(Looper.java:300)
    at android.app.ActivityThread.main(ActivityThread.java:8321)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:581)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1028)
Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/xml/stream/XMLInputFactory;
    at org.simpleframework.xml.stream.StreamProvider.<init>(StreamProvider.java:61)
    at org.simpleframework.xml.stream.ProviderFactory.getInstance(ProviderFactory.java:38)
    at org.simpleframework.xml.stream.NodeBuilder.<clinit>(NodeBuilder.java:45)
    at org.simpleframework.xml.stream.NodeBuilder.read(NodeBuilder.java:71)
    at org.simpleframework.xml.core.Persister.read(Persister.java:562)
    at org.simpleframework.xml.core.Persister.read(Persister.java:462)
    at io.minio.Xml.unmarshal(Xml.java:53)
    at io.minio.S3Base.lambda$getRegionAsync$2$io-minio-S3Base(S3Base.java:932)
    at io.minio.S3Base$$ExternalSyntheticLambda13.apply(D8$$SyntheticClass:0)
    at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:618)
    at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:482)
    at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2049)
    at io.minio.S3Base$1.onResponse(S3Base.java:644)
    at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
    at java.lang.Thread.run(Thread.java:1012)
Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.xml.stream.XMLInputFactory" on path: DexPathList[[dex file "/data/data/zoujunshi.miniotest/code_cache/.overlay/base.apk/classes3.dex", zip file "/data/app/~~RZo5wRXGTUpdWlOhsyS0Dg==/zoujunshi.miniotest--bllpGKTkAtDHWmKEFF0Sw==/base.apk"],nativeLibraryDirectories=[/data/app/~~RZo5wRXGTUpdWlOhsyS0Dg==/zoujunshi.miniotest--bllpGKTkAtDHWmKEFF0Sw==/lib/arm64, /system/lib64, /system_ext/lib64]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    ... 17 more
balamurugana commented 1 month ago
Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.xml.stream.XMLInputFactory" on path: DexPathList[[dex file "/data/data/zoujunshi.miniotest/code_cache/.overlay/base.apk/classes3.dex", zip file "/data/app/~~RZo5wRXGTUpdWlOhsyS0Dg==/zoujunshi.miniotest--bllpGKTkAtDHWmKEFF0Sw==/base.apk"],nativeLibraryDirectories=[/data/app/~~RZo5wRXGTUpdWlOhsyS0Dg==/zoujunshi.miniotest--bllpGKTkAtDHWmKEFF0Sw==/lib/arm64, /system/lib64, /system_ext/lib64]]

This is not from minio-java

jimie-chaos commented 1 month ago
Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.xml.stream.XMLInputFactory" on path: DexPathList[[dex file "/data/data/zoujunshi.miniotest/code_cache/.overlay/base.apk/classes3.dex", zip file "/data/app/~~RZo5wRXGTUpdWlOhsyS0Dg==/zoujunshi.miniotest--bllpGKTkAtDHWmKEFF0Sw==/base.apk"],nativeLibraryDirectories=[/data/app/~~RZo5wRXGTUpdWlOhsyS0Dg==/zoujunshi.miniotest--bllpGKTkAtDHWmKEFF0Sw==/lib/arm64, /system/lib64, /system_ext/lib64]]

这不是来自minio-java

from at io.minio.Xml.unmarshal(Xml.java:53)

jimie-chaos commented 1 month ago

root exception from org.simpleframework.xml.core.Persister,but it not work at android. this wrong from android. so my title is Do you have plans to launch an SDK for Android?

jimie-chaos commented 1 month ago

@balamurugana Have you noticed this:

package io.minio;

import io.minio.errors.XmlParserException;
import java.io.Reader;
import java.io.StringReader;
import java.io.StringWriter;
import org.simpleframework.xml.Serializer;
import org.simpleframework.xml.convert.AnnotationStrategy;
import org.simpleframework.xml.core.Persister;
import org.simpleframework.xml.stream.Format;

/** XML marshaller and unmarshaller. */
public class Xml {
...

look my log ,java.lang.NoClassDefFoundError throw from Xml So I think this problem comes from Minio Java

balamurugana commented 1 month ago

The exception says "javax.xml.stream.XMLInputFactory" is missing. You have to fix that.

jimie-chaos commented 1 month ago

@balamurugana Also, it is possible for me to execute the same code in Java, so is Minio Java not compatible with Android

异常显示缺少“javax.xml.stream.XMLInputFactory”。您必须修复该问题。

In android studio ,i can find the class,but not found in runtime,I have currently attempted to use text parsing to parse the XML data of Putobject(download source code and Override) It seems that this situation occurs in all code that needs to parse XML. I have tried to modify the dependencies configuration before but it did not work, and I am unable to solve this problem. Thanks for your help.

jimie-chaos commented 1 month ago

@balamurugana can you open the issues,maybe someone resolve java.lang.ClassNotFoundException: Didn't find class "javax.xml.stream.XMLInputFactory" exception or I need sreate new issues.thanks:)

balamurugana commented 1 month ago

@jimie-chaos This is not minio-java issue. You should open issues with respective project.