[Android] "Internal Error: Could not find .pro file."
-
I'm trying to deploy a project which depends on some QML components, but when they are marked as dependencies in Qt Creator deployment fails:
@09:02:24: Internal Error: Could not find .pro file.
Error while building/deploying project Flintlock (kit: Android for armeabi-v7a (GCC 4.8, Qt 5.3.0))
When executing step 'Deploy to Android device'@If I remove the QML components as a dependency the application deploys just fine.
Here's what the components source directory looks like:
@Audio Barcode Base64 BooruImage build config.pri DrawSurface File Flintlock.pro Flintlock.pro.user Hash MediaSource SerialFuelPrice WebsocketListener@
And the .pro file:
@TEMPLATE = subdirs
include(config.pri)
booruimage {
SUBDIRS += BooruImage/booruimage.pro
}audio {
SUBDIRS += Audio/audio.pro
}base64 {
SUBDIRS += Base64/base64.pro
}drawsurface {
SUBDIRS += DrawSurface/drawsurface.pro
}websockets {
SUBDIRS += WebsocketListener/websocketlistener.pro
}serialfuelprice {
SUBDIRS += SerialFuelPrice/serialfuelprice.pro
}mediasource {
SUBDIRS += MediaSource/mediasource.pro
}file {
SUBDIRS += File/file.pro
}hash {
SUBDIRS += Hash/hash.pro
}OTHER_FILES += config.pri@
... pretty basic stuff!
I select the components I want in config.pri, which is currently: CONFIG += websockets file drawsurface hash
Works on Desktop Linux at least, what am I doing wrong?
-
Werid. That's how Qt Creator generated the .pro file, I just enclosed them in the config conditions.
It has worked fine on Linux/X11 and Windows/Cygwin, deploys (make installs) correctly, so I didn't suspect those paths were the issue.
I've changed the .pro file as you suggested and cleaned the build trees for both projects, re-ran qmake, rebuilt, and the error remains exactly as above.
Since the dependency was a git repo of a different name, I renamed the .pro inside to match the name of the directory it is in (so, components.pro), as well as the .pro.user file. I've also tried removing the build directories and rebuilding the projects from scratch. The dependency itself is found and built when the project is built, only the deploy step fails.
Rather than taking shots in the dark at what might be causing this, do you know off-hand what the error means? Which .pro file, where, and what does it do? Why is it looking for a .pro file after the build is complete, anyway?
I've added some qDebug() lines to QmakeProFileNode::findProFileFor in my qtcreator source and I'm recompiling it. I'll be able to see what it's looking for and where, at least, and I'll post my findings as soon as I have some.
-
As silly as it may sound, it's not finding one of your pro file. Does the log/compile/general console tell you which one ?
-
Oh, that doesn't sound silly at all! Here's the information Qt Creator is providing to me:
Issues is empty.
Compile output has:
@15:36:05: Internal Error: Could not find .pro file.
Error while building/deploying project components (kit: Android for armeabi-v7a (GCC 4.8, Qt 5.3.0))
When executing step 'Deploy to Android device'@(and nothing else, just that).
General messages is empty.
My recompilation of Qt Creator is complete, though, and it says:
@Scanning for .pro file for file: ""
Checking path: "/home/nautilus/Flintlock/components/Audio/Audio.pro"
Scanning for .pro file for file: ""
Checking path: "/home/nautilus/Flintlock/components/Base64/Base64.pro"
Scanning for .pro file for file: ""
Checking path: "/home/nautilus/Flintlock/components/BooruImage/BooruImage.pro"
Scanning for .pro file for file: ""
Checking path: "/home/nautilus/Flintlock/components/config.pri"
Checking path: "/home/nautilus/Flintlock/components/MediaSource/MediaSource.pro"
Scanning for .pro file for file: ""
Checking path: "/home/nautilus/Flintlock/components/DrawSurface/DrawSurface.pro"
Scanning for .pro file for file: ""
Checking path: "/home/nautilus/Flintlock/components/SerialFuelPrice/SerialFuelPrice.pro"
Scanning for .pro file for file: ""
Checking path: "/home/nautilus/Flintlock/components/File/File.pro"
Scanning for .pro file for file: ""
Checking path: "/home/nautilus/Flintlock/components/Hash/Hash.pro"
Scanning for .pro file for file: ""
Checking path: "/home/nautilus/Flintlock/components/config.pri"
Checking path: "/home/nautilus/Flintlock/components/WebsocketListener/WebsocketListener.pro"
Scanning for .pro file for file: ""@For this code:
@const QmakeProFileNode *QmakeProFileNode::findProFileFor(const QString &fileName) const
{
qDebug() << "Scanning for .pro file for file: " << fileName;
if (fileName == path())
{
qDebug() << "Found path: " << path();
return this;
}
foreach (ProjectNode *pn, subProjectNodes())
{
qDebug() << "Checking path: " << pn->path();
if (QmakeProFileNode *qmakeProFileNode = qobject_cast<QmakeProFileNode *>(pn))
if (const QmakeProFileNode *result = qmakeProFileNode->findProFileFor(fileName))
{
qDebug() << "Found path: " << pn->path();
return result;
}
}
return 0;
}@So it makes sense that it can't find a .pro file for ""...
If you're curious, the error is hit at src/plugins/android/androiddeployqtstep.cpp +240:
@
if (!node) { // should never happen
emit addOutput(tr("Internal Error: Could not find .pro file."), BuildStep::ErrorMessageOutput);
return false;
}
@I'm going to assume by the comment there that I didn't do something terribly wrong to break it and I bumped into a bug of sorts, I'll try to reproduce it on a smaller scale and report it.
-
I had the same problem. I figured out what was going wrong. In my project I had the following QT dependencies:
@
QT += network xml xmlpatterns
QT -= gui
@This was created by project template for a static library.
Compiling this gave this error:
@
14:35:53: Internal Error: Could not find .pro file.
Error while building/deploying project Test-Android (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.4.0))
When executing step "Build Android APK"
@When adding Qt core dependency, everyhing was compiling again:
@
QT += core network xml xmlpatterns
QT -= gui
@ -
I had the same problem. I figured out what was going wrong. In my project I had the following QT dependencies:
@
QT += network xml xmlpatterns
QT -= gui
@This was created by project template for a static library.
Compiling this gave this error:
@
14:35:53: Internal Error: Could not find .pro file.
Error while building/deploying project Test-Android (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.4.0))
When executing step "Build Android APK"
@When adding Qt core dependency, everyhing was compiling again:
@
QT += core network xml xmlpatterns
QT -= gui
@ -
Correction on that last post, that wasn't the problem....
A bit more detail, this project file
@
QT += network xml xmlpatternsQT -= gui
TARGET = test3
TEMPLATE = lib
CONFIG += staticlibSOURCES += test3.cpp
HEADERS += test3.h
unix {
target.path = /usr/lib
INSTALLS += target
}
@gives this output:
@
14:55:28: Internal Error: Could not find .pro file.
Error while building/deploying project test3 (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.4.0))
When executing step "Build Android APK"
@Removing the TEMPLATE = lib line does build.
It does not matter if you try to create a static or dynamic library, both of them will fail.So it seems there is a bug in building libraries for Android?
-
Correction on that last post, that wasn't the problem....
A bit more detail, this project file
@
QT += network xml xmlpatternsQT -= gui
TARGET = test3
TEMPLATE = lib
CONFIG += staticlibSOURCES += test3.cpp
HEADERS += test3.h
unix {
target.path = /usr/lib
INSTALLS += target
}
@gives this output:
@
14:55:28: Internal Error: Could not find .pro file.
Error while building/deploying project test3 (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.4.0))
When executing step "Build Android APK"
@Removing the TEMPLATE = lib line does build.
It does not matter if you try to create a static or dynamic library, both of them will fail.So it seems there is a bug in building libraries for Android?
-
Thanks, that worked for me.
[quote author="ssolomin" date="1419954269"]I've seen simular problem when try build lib with Qt5.4 and Qt Creator. And I've found workaround: go to the "project" tab and switch off "Make install" and "Build Android APK" steps.[/quote]
-
Thanks, that worked for me.
[quote author="ssolomin" date="1419954269"]I've seen simular problem when try build lib with Qt5.4 and Qt Creator. And I've found workaround: go to the "project" tab and switch off "Make install" and "Build Android APK" steps.[/quote]
-
Thanks for the discussions. The above workaround also works for me:
In Qt5.4.0-based Qt Creator 3.3.0, go to "Projects" -> "Build"
-
Disable "Make install".
-
Disable "Build Android APK".
Then my library project will build successfully.
Is there any plan to fix this issue by the Qt Projecr team?
-
-
Thanks for the discussions. The above workaround also works for me:
In Qt5.4.0-based Qt Creator 3.3.0, go to "Projects" -> "Build"
-
Disable "Make install".
-
Disable "Build Android APK".
Then my library project will build successfully.
Is there any plan to fix this issue by the Qt Projecr team?
-