Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-110151

Qt Quick for Android QML import js path error

    XMLWordPrintable

Details

    • Android

    Description

      Here's part of my directory:

      Resource

          /JS

             Functions.js

          /QML

             Main.qml

       

      Main.qml:

      import '../JS/Function.js' ad Function

       

      Then I met error while adding QML dependency:

      – Adding '(absolute path)/Resource/QML/JS/Function.js' as QML dependency

          – Skipping because file does not exist.

       

      When I add the js path to qrc file and change the import path to 'qrc:/Resource/JS/Function.js', I met another error

      – Adding '(absolute path)/Resource/QML/Main.qml/qrc:/Resource/JS/Function.js' as QML dependency

          – Skipping because file does not exist.

       

      Then I thought the import path was start in 'Resource/QML/Main.qml' instead of 'Resource/QML/', and I changed the import path to '../../JS/Function.js', but still got an error:

      – Adding '(absolute path)/Resource/JS/Function.js' as QML dependency

          – Skipping because file is in QML root path.

       

      The initial code with import path(using qrc path) could successfully run on Windows 10 with 'Desktop Qt 5.13.2 MSVC2017 64bit' compiling.

       

      My Android compiler:

      Android for arm64-v8a (Clang Qt 5.13.2 for Android ARM64-v8a)

      JDK: 1.8.0_201

      SDK: 26.1.1

      NDK: r20b 20.1.5948944

       

      Thanks for helping

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtandroidteam Qt Android Team
            yukinasora Sor4 Yukina
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes