Closed Bug 1299997 Opened 8 years ago Closed 8 years ago

Crash: java.lang.NoClassDefFoundError: java.nio.charset.StandardCharsets at org.mozilla.gecko.sync.repositories.uploaders.RecordUploadRunnable.<clinit>(RecordUploadRunnable.java)

Categories

(Firefox for Android Graveyard :: Android Sync, defect, P1)

defect

Tracking

(firefox51 fixed)

RESOLVED FIXED
Firefox 51
Tracking Status
firefox51 --- fixed

People

(Reporter: Grisha, Assigned: Grisha)

References

Details

(Whiteboard: [MobileAS])

Crash Data

Attachments

(1 file)

Caused by the new atomic uploads (see Bug 1253111).

java.nio.charset.StandardCharsets is API19+, so devices below that are crashing when trying to sync.
Assignee: nobody → gkruglov
Status: NEW → ASSIGNED
Crash Signature: java.lang.NoClassDefFoundError: java.nio.charset.StandardCharsets at org.mozilla.gecko.sync.repositories.uploaders.RecordUploadRunnable.<clinit>(RecordUploadRunnable.java) → [@ java.lang.NoClassDefFoundError: java.nio.charset.StandardCharsets at org.mozilla.gecko.sync.repositories.uploaders.RecordUploadRunnable.<clinit>(RecordUploadRunnable.java) ]
Comment on attachment 8787471 [details]
Bug 1299997 - Can't use API19+ StandardCharsets

https://reviewboard.mozilla.org/r/76220/#review74286

::: mobile/android/services/src/main/java/org/mozilla/gecko/sync/repositories/uploaders/RecordUploadRunnable.java:31
(Diff revision 1)
>   * Responsible for creating and posting a <code>SyncStorageRequest</code> request object.
>   */
>  public class RecordUploadRunnable implements Runnable {
>      public final String LOG_TAG = "RecordUploadRunnable";
>  
> -    public final static byte[] RECORDS_START = "[".getBytes(StandardCharsets.UTF_8);
> +    public final static byte[] RECORDS_START = "[".getBytes(Charset.forName("UTF-8"));

Even better:

```
= { 91 };   // [ in UTF-8
= { 44 };   // , in UTF-8
= { 93 };   // ] in UTF-8
```

and save the import and the work.
Attachment #8787471 - Flags: review+
Comment on attachment 8787471 [details]
Bug 1299997 - Can't use API19+ StandardCharsets

https://reviewboard.mozilla.org/r/76220/#review74286

> Even better:
> 
> ```
> = { 91 };   // [ in UTF-8
> = { 44 };   // , in UTF-8
> = { 93 };   // ] in UTF-8
> ```
> 
> and save the import and the work.

Heh, sure.
Pushed by gkruglov@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/617559427df0
Can't use API19+ StandardCharsets r=rnewman
Attachment #8787471 - Flags: review?(s.kaspari)
https://hg.mozilla.org/mozilla-central/rev/617559427df0
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 51
Iteration: --- → 1.3
Product: Android Background Services → Firefox for Android
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: