firebase-kotlin-sdk icon indicating copy to clipboard operation
firebase-kotlin-sdk copied to clipboard

Adding JVM support for Firebase Storage

Open pontomedon opened this issue 9 months ago • 1 comments
trafficstars

This is based on previous work by Cesar Ramirez and it is obviously depending on work done on the java sdk: https://github.com/GitLiveApp/firebase-java-sdk/pull/44

I know the checks are failing, I'll need some input on how I can publish a snapshot of firebase-java-sdk to make them succeed. It all works locally when deploying to maven local.

I needed to make sure we never call the firebase storage API with null metadata - when doing this on a desktop target, the CONTENT_LENGTH = 0 header gets removed somehow, causing the firebase backend to respond with a HTTP 411. Passing defaults causes a few bytes to be serialized in the first requrest before the upload, which circumvents the problem.

The root cause for this must be in the http driver somewhere, as it doesn't happen when running the same code on Android.

pontomedon avatar Feb 18 '25 20:02 pontomedon

fixes #689 and #533

pontomedon avatar Feb 18 '25 21:02 pontomedon

Is it possible to implement these changes directly in my personal project?

I tried to clone the repo and checkout to this branch (to import the library locally), but I can't even sync the project, I'm facing an issue in all modules. It happens in all podspec sync tasks like: :firebase-storage:podspec

-----------
* What went wrong:
Execution failed for task ':firebase-config:generateDummyFramework'.
> Failed to calculate the value of task ':firebase-config:generateDummyFramework' property 'outputFramework'.
   > Failed to query the value of task ':firebase-config:generateDummyFramework' property 'frameworkName'.
      > Collection is empty.

Could anyone help me please? I would really appreciate it. This usage of storage is blocking my project

AbelVolpi avatar Jun 28 '25 21:06 AbelVolpi

You'll have to do the following:

  • check out https://github.com/GitLiveApp/firebase-java-sdk/pull/44
  • update gradle.properties and set the version 0.4.9-AbelVolpi-SNAPSHOT
  • deploy firebase-java-sdk to your maven local ./gradlew publishToMavenLocal
  • check out this branch
  • update libs.versions.toml and set gitlive-firebase-java-sdk = "0.4.9-AbelVolpi-SNAPSHOT"
  • update gradle.properties and set all firebase-*.version to 2.1.1-AbelVolpi-SNAPSHOT
  • deploy firebase-kotlin-sdk to your maven local ./gradlew publishToMavenLocal
  • in your project, make sure you have mavenLocal() in your repository list and depend on firebase-kotlin-sdk in version 2.1.1-AbelVolpi-SNAPSHOT

alternatively: you can open ~/.m2/repository and copy the whole dev/gitlive folder into your repository, under a subfolder .localMaven, and add this directory as a local maven to your repositories: maven { url = URI("file://${rootProject.projectDir}/.localMaven") }, that way it will work on CI as well.

pontomedon avatar Jul 19 '25 11:07 pontomedon

@pontomedon - You need to run

./gradlew apiDump

https://github.com/pontomedon/firebase-kotlin-sdk/actions/runs/17046144917/job/48322367413

Then fix the errors, commit this and we will be able to merge in.

Reedyuk avatar Aug 18 '25 16:08 Reedyuk