Firebase-android-sdk: firebase-firestore's POM file specifies an incorrect type of its dependency, io.grpc:grpc-android

Created on 19 Mar 2019  路  9Comments  路  Source: firebase/firebase-android-sdk

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs in __the code in this repository__.
If you have a general question, need help debugging, or fall into some
other category use one of these other channels:

  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: 3.3.2
  • Firebase Component: Firestore (Database, Firestore, Storage, Functions, etc)
  • Component version: 18.1.0

[REQUIRED] Step 3: Describe the problem

firebase-firestore:18.1.0's POM file specifies an incorrect packaging type of its dependency, io.grpc:grpc-android. The artifact type of grpc-android should be "aar" instead of "jar". https://mvnrepository.com/artifact/io.grpc/grpc-android/1.18.0

<?xml version='1.0' encoding='UTF-8'?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.google.firebase</groupId>
  <artifactId>firebase-firestore</artifactId>
  <version>18.1.0</version>
  <packaging>aar</packaging>
  <dependencies>
    <!-- redacted for clarity -->   
    <dependency>
      <groupId>io.grpc</groupId>
      <artifactId>grpc-android</artifactId>
      <version>1.16.1</version>
      <scope>compile</scope>
      <!-- The type SHOULD BE aar instead of jar -->
      <type>jar</type>
    </dependency>
    <!-- redacted for clarity -->   
  </dependencies>
  <name>firebase-firestore</name>
</project>

Steps to reproduce:

What happened? How can we make the problem occur?
This could be a description, log/console output, etc.

Relevant Code:

// TODO(you): code here to reproduce the problem
firestore bug

Most helpful comment

@ashwinraghav tells me that this should be fixed in the next release (coming out in the next few weeks). So I'm going to close the issue. Thanks very much for the report!

All 9 comments

Thank you for reporting this @senpo! I was able to reproduce your problem when installing Firestore via Maven. We will try to get this resolved as soon as possible.

Hey @senpo ,
Are you using a build system that is not Gradle. What problem does this lead to in practice for you?

I'm using Bazel with rules_jvm_external to resolve maven dependencies.

Also see https://github.com/bazelbuild/rules_jvm_external/issues/70

Thank you!

The underlying resolver is Coursier. Any build tool using Coursier to resolve its dependencies will run into this problem.

Are there any updates to this issue? Will the POM files be retroactively fixed?

Hey Jin,
Thanks for your patience on this issue. We have a fix in progress that will be applied to releases going forward. We do not plan to patch existing releases since that would make builds non-hermetic.

If you need to unblock yourself in the mean time, you should be able to run this command have generate a maven repo that you can depend on. This generates a pom file that does not codify the type at all (as opposed to codifying it incorrectly as a jar). That might fix your problem ?

./gradlew  -PpublishMode=RELEASE  -PprojectsToPublish="firebase-firestore" firebasePublish

The maven repo should be in build/m2repository

build/m2repository/com/google/firebase/firebase-firestore/18.2.0/firebase-firestore-18.2.0.pom

This will work for me, but not downstream users of Coursier or Bazel's rules_jvm_external, since the erroneous pom will still be present on the upstream repo.

It's not clear to me how and why Gradle doesn't run into this issue. Do you know if they have special workarounds for non-matching dependency types like this?

@ashwinraghav tells me that this should be fixed in the next release (coming out in the next few weeks). So I'm going to close the issue. Thanks very much for the report!

I can verify that this is fixed with 19.0.0. Thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jkasten2 picture jkasten2  路  4Comments

Belka1000867 picture Belka1000867  路  3Comments

gitton picture gitton  路  6Comments

quiro91 picture quiro91  路  5Comments

SteveBurkert picture SteveBurkert  路  3Comments