Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Starting simple application on Android doesn't work
Forum Updated to NodeBB v4.3 + New Features

Starting simple application on Android doesn't work

Scheduled Pinned Locked Moved Solved Mobile and Embedded
2 Posts 2 Posters 255 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Creaperdown
    wrote on last edited by
    #1

    I have the simple code:

    QQmlApplicationEngine engine;
    QFile some("/home/creapermann/Programming/Etovex/Librum/src/presentation/main.qml");
    auto success = some.open(QFile::ReadOnly);
    auto path = some.fileName();
    
    QObject::connect(
            &engine, &QQmlApplicationEngine::objectCreated, &app,
            [path](QObject* obj, const QUrl& objUrl)
            {
                if(obj == nullptr && QUrl(path) == objUrl)
                    QCoreApplication::exit(-1);
            },
            Qt::QueuedConnection);
    engine.load(path);
    
    return QGuiApplication::exec();
    

    This works just fine on desktop (my main.qml file is just showing a red screen) but on android I get:

    W liblibrum_arm64-v8a.so: QQmlApplicationEngine failed to load component
    W liblibrum_arm64-v8a.so: file:///home/creapermann/Programming/Etovex/Librum/src/presentation/main.qml: No such file or directory
    

    Building other applications with the same config works just fine. I am using a absolute path for testing purposes, I wouldn't know why that would be causing an issue.

    Does someone have an idea what might be causing this?

    JoeCFDJ 1 Reply Last reply
    0
    • C Creaperdown

      I have the simple code:

      QQmlApplicationEngine engine;
      QFile some("/home/creapermann/Programming/Etovex/Librum/src/presentation/main.qml");
      auto success = some.open(QFile::ReadOnly);
      auto path = some.fileName();
      
      QObject::connect(
              &engine, &QQmlApplicationEngine::objectCreated, &app,
              [path](QObject* obj, const QUrl& objUrl)
              {
                  if(obj == nullptr && QUrl(path) == objUrl)
                      QCoreApplication::exit(-1);
              },
              Qt::QueuedConnection);
      engine.load(path);
      
      return QGuiApplication::exec();
      

      This works just fine on desktop (my main.qml file is just showing a red screen) but on android I get:

      W liblibrum_arm64-v8a.so: QQmlApplicationEngine failed to load component
      W liblibrum_arm64-v8a.so: file:///home/creapermann/Programming/Etovex/Librum/src/presentation/main.qml: No such file or directory
      

      Building other applications with the same config works just fine. I am using a absolute path for testing purposes, I wouldn't know why that would be causing an issue.

      Does someone have an idea what might be causing this?

      JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by JoeCFD
      #2

      @Creaperdown this path + file(/home/creapermann/Programming/Etovex/Librum/src/presentation/main.qml) does not exist on Android. Use relative path with QRC or cmake to add qml file to your build.

      1 Reply Last reply
      1
      • C Creaperdown has marked this topic as solved on

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved