Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-26954

Android: Reading a JSON file fails on Android Q

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Release 8.0.0, Release 7.3.0
    • Fix Version/s: Release 8.1.0
    • Component/s: Android
    • Environment:

      Android Q, Titanium 7.3.0 (but the master branch will also fail)

      Description

      Running the following code, returns t==null

      var file=Ti.Filesystem.getFile(Config.PathRoot.resources,'some.json');
      var d=file.read();
      var t=d.text;

      Analysis:
      TiBlob#getText checks TiMimeTypeHelper.isBinaryMimeType(mimetype) and if the file is binary, it only allows application/octet-stream. The detected mime type comes from android.webkit.MimeTypeMap#getMimeTypeFromExtension (in TiMimeTypeHelper#getMimeTypeFromFileExtension). This used to return the octet-steam mime on *.json files, but it was probably fixed to properly return application/json.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jquick Joshua Quick
                Reporter:
                buddyguards grebulon
                Reviewer:
                Gary Mathews
                Tester:
                Lokesh Choudhary
              • Watchers:
                17 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration