Skip to content

Commit 7221848

Browse files
authored
Remove hyphens from UUID to satisfy mapping file ID requirements (#14)
* Remove hyphens from UUID to satisfy mapping file ID requirements Remove hyphens from UUID to satisfy mapping file ID requirements I don't know if this is official or documented anywhere, but it looks like the mapping file ID must be a UUID *without hyphens*. Uploading a file with a UUID like 6ac7912c-d163-47a0-ae4e-f6d3ad3a21c7 results in an API response like: ``` "error": { "code": 3, "message": "Invalid URL: Not a valid uuid." } ``` Removing the hyphens makes it work. I'm not sure how "generalizable" we want the code in this repository to be. It seems to me that this target should specifically be used to generate a UUID that can be used directly for a mapping file upload. To that end, I think it is correct to follow the exact format that makes this work, rather than make something purely generalizable. * Update README.md with updated UUID spec
1 parent 43c8cfc commit 7221848

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

tools/crashlytics/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ GOOGLE_SERVICES_RESOURCES = google_services_xml(
4949
crashlytics_android_library(
5050
name = "crashlytics_lib",
5151
package_name = "com.example.package",
52-
build_id = "9dfea8fe-4d75-48a7-ba28-4ddb7fe74780",
52+
build_id = "9dfea8fe4d7548a7ba284ddb7fe74780",
5353
resource_files = GOOGLE_SERVICES_RESOURCES,
5454
)
5555

@@ -62,15 +62,15 @@ android_library(
6262
)
6363
```
6464

65-
To generate the Build ID, we have created a tool called `generate_uuid`. Run it
66-
with Bazel:
65+
To generate the Build ID (which is a UUID without hyphens),
66+
we have created a tool called `generate_uuid`. Run it with Bazel:
6767

6868
```
6969
$ bazel run @tools_android//tools/crashlytics:generate_uuid
7070
7171
...
7272
73-
76196b85-5620-4435-81e1-1c0515e0e271
73+
76196b855620443581e11c0515e0e271
7474
```
7575

7676
Finally, depend on the `crashlytics_deps` and `crashlytics_lib` libraries.

tools/crashlytics/com/bazel/crashlytics/GenerateRandomUUID.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
public class GenerateRandomUUID {
44

55
public static void main(String[] args) {
6-
System.out.println(java.util.UUID.randomUUID().toString());
6+
System.out.println(java.util.UUID.randomUUID().toString().replace("-", ""));
77
}
88

99
}

0 commit comments

Comments
 (0)