0

When I run ./gradlew :mobile:firebaseUploadReleaseProguardMapping --stacktrace in output I see, that it's not only uploads mapping file, but does project building. It takes about 2-3 minutes to complete, but it doesn't generates APK, so it just wasting my time. Also, I'm executing this command after generating signed apk which will be published and often forget to do this.

Does it possible to compile, sign APK and upload mapping file in one shot? I would also add publishing APK to Google Play to it.

UPDATE:

I've found out, that command for upload really builds and signs APK, but it is generated in different folder. When I use Build -> Generate Signed APK it lays in <project_root>/mobile/mobile-release.apk but with gradlew command it appears in <project_root>/mobile/build/outputs/apk/mobile-release.apl

Dmytro Rostopira
  • 10,588
  • 4
  • 64
  • 86

1 Answers1

1

The task you're pointing out does, in fact, build the APK, sign it, and upload the mappings in one shot. The upload part of the task depends on the build task. You can see that in the series of tasks that it executes.

If you're wondering about the ability to upload a mapping file without having to build the APK, that is a feature we're looking into right now.

The Firebase tools aren't integrated with the Play Store console, so they won't perform the publishing of the APK itself. However, I believe the console gives you a way to programmatically publish an APK. You should probably just do that right after you build.

Community
  • 1
  • 1
Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
  • Thanks for reply. It's easy to perform upload as second command and then merge them in one bash script. But my actual question is to build and upload in one shot, so I don't need to build twice. I think, Firebase team should implement mapping file upload through REST API, not gradle plugin, so it would be much easier – Dmytro Rostopira Jan 22 '17 at 09:26
  • Like I said, when you run the Firebase mappings upload task, it automatically builds the APK before the upload. It's all done in one command. Also, you can put multiple tasks on one gradle command line if you want to do multiple things that are not necessarily related to each other. – Doug Stevenson Jan 22 '17 at 09:28
  • I've tried to run upload task and apk file `mobile-release.apk` in module dir left with previous build number, could it put new apk in different location? – Dmytro Rostopira Jan 22 '17 at 09:37
  • 1
    The name and location of the apk for a build is not the responsibility of the Firebase plugin. That's always going to be the same, based on the decision of the Android plugin. Also, there will not always be a new APK if there is nothing new to build. – Doug Stevenson Jan 22 '17 at 09:40