Unverified Commit 633d9eb1 authored by Aleksey Kontsevich's avatar Aleksey Kontsevich Committed by GitHub

Fixed 5.15 build on Android (removed deprecated API) (#9136)

* Fixed 5.15 build on Andoid (removed deprecated API)

* Removed -nostdlib++ hack fix

* APK build error fix
parent 92b95e33
...@@ -57,7 +57,6 @@ linux { ...@@ -57,7 +57,6 @@ linux {
-Wno-parentheses-equality # android gstreamer header files -Wno-parentheses-equality # android gstreamer header files
QMAKE_CFLAGS_WARN_ON += \ QMAKE_CFLAGS_WARN_ON += \
-Wno-unused-command-line-argument # from somewhere in Qt generated build files -Wno-unused-command-line-argument # from somewhere in Qt generated build files
QMAKE_LINK += -nostdlib++ # Hack fix?: https://forum.qt.io/topic/103713/error-cannot-find-lc-qt-5-12-android
target.path = $$DESTDIR target.path = $$DESTDIR
equals(ANDROID_TARGET_ARCH, armeabi-v7a) { equals(ANDROID_TARGET_ARCH, armeabi-v7a) {
DEFINES += __androidArm32__ DEFINES += __androidArm32__
...@@ -232,13 +231,6 @@ CONFIG(debug, debug|release) { ...@@ -232,13 +231,6 @@ CONFIG(debug, debug|release) {
SOURCE_DIR = $$IN_PWD SOURCE_DIR = $$IN_PWD
!iOSBuild {
OBJECTS_DIR = $${OUT_PWD}/obj
MOC_DIR = $${OUT_PWD}/moc
UI_DIR = $${OUT_PWD}/ui
RCC_DIR = $${OUT_PWD}/rcc
}
LANGUAGE = C++ LANGUAGE = C++
LOCATION_PLUGIN_DESTDIR = $${OUT_PWD}/src/QtLocationPlugin LOCATION_PLUGIN_DESTDIR = $${OUT_PWD}/src/QtLocationPlugin
......
...@@ -7,11 +7,10 @@ ...@@ -7,11 +7,10 @@
<category android:name="android.intent.category.LAUNCHER"/> <category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"/> <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"/>
<action android:name="android.hardware.usb.action.USB_DEVICE_DETACHED"/> <action android:name="android.hardware.usb.action.USB_DEVICE_DETACHED"/>
<action android:name="android.bluetooth.device.action.ACL_CONNECTED" /> <action android:name="android.bluetooth.device.action.ACL_CONNECTED"/>
<action android:name="android.bluetooth.device.action.ACL_DISCONNECTED" /> <action android:name="android.bluetooth.device.action.ACL_DISCONNECTED"/>
<action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"/> <action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"/>
</intent-filter> </intent-filter>
<meta-data android:resource="@xml/device_filter" android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"/> <meta-data android:resource="@xml/device_filter" android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"/>
<meta-data android:resource="@xml/device_filter" android:name="android.hardware.usb.action.USB_DEVICE_DETACHED"/> <meta-data android:resource="@xml/device_filter" android:name="android.hardware.usb.action.USB_DEVICE_DETACHED"/>
<meta-data android:resource="@xml/device_filter" android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"/> <meta-data android:resource="@xml/device_filter" android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED"/>
...@@ -36,13 +35,11 @@ ...@@ -36,13 +35,11 @@
<meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/> <meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
<meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/> <meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
<!-- Messages maps --> <!-- Messages maps -->
<!-- Splash screen --> <!-- Splash screen -->
<!-- <!--
<meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/> <meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/>
--> -->
<!-- Splash screen --> <!-- Splash screen -->
<!-- Background running --> <!-- Background running -->
<!-- Warning: changing this value to true may cause unexpected crashes if the <!-- Warning: changing this value to true may cause unexpected crashes if the
application still try to draw after application still try to draw after
...@@ -52,7 +49,7 @@ ...@@ -52,7 +49,7 @@
<!-- Background running --> <!-- Background running -->
</activity> </activity>
</application> </application>
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="28"/> <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28"/>
<!-- Needed to keep working while 'asleep' --> <!-- Needed to keep working while 'asleep' -->
<uses-permission android:name="android.permission.WAKE_LOCK"/> <uses-permission android:name="android.permission.WAKE_LOCK"/>
...@@ -63,20 +60,20 @@ ...@@ -63,20 +60,20 @@
<!-- Support devices without USB host mode since there are other connection types --> <!-- Support devices without USB host mode since there are other connection types -->
<uses-feature android:name="android.hardware.usb.host" android:required="false"/> <uses-feature android:name="android.hardware.usb.host" android:required="false"/>
<!-- Support devices without Bluetooth since there are other connection types --> <!-- Support devices without Bluetooth since there are other connection types -->
<uses-feature android:name="android.hardware.bluetooth" android:required="false"/> <uses-feature android:name="android.hardware.bluetooth" android:required="false"/>
<!-- Support devices that don't have location services --> <!-- Support devices that don't have location services -->
<uses-feature android:name="android.hardware.location.gps" android:required="false" /> <uses-feature android:name="android.hardware.location.gps" android:required="false"/>
<uses-feature android:name="android.hardware.location.network" android:required="false"/> <uses-feature android:name="android.hardware.location.network" android:required="false"/>
<uses-feature android:name="android.hardware.location" android:required="false"/> <uses-feature android:name="android.hardware.location" android:required="false"/>
<uses-feature android:name="android.hardware.usb.accessory"/> <uses-feature android:name="android.hardware.usb.accessory"/>
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application. <!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
Remove the comment if you do not require these default features. --> Remove the comment if you do not require these default features. -->
<!-- %%INSERT_FEATURES --> <!-- %%INSERT_FEATURES -->
......
...@@ -14,25 +14,25 @@ ULogParser::~ULogParser() ...@@ -14,25 +14,25 @@ ULogParser::~ULogParser()
int ULogParser::sizeOfType(QString& typeName) int ULogParser::sizeOfType(QString& typeName)
{ {
if (typeName == QLatin1Literal("int8_t") || typeName == QLatin1Literal("uint8_t")) { if (typeName == QLatin1String("int8_t") || typeName == QLatin1String("uint8_t")) {
return 1; return 1;
} else if (typeName == QLatin1Literal("int16_t") || typeName == QLatin1Literal("uint16_t")) { } else if (typeName == QLatin1String("int16_t") || typeName == QLatin1String("uint16_t")) {
return 2; return 2;
} else if (typeName == QLatin1Literal("int32_t") || typeName == QLatin1Literal("uint32_t")) { } else if (typeName == QLatin1String("int32_t") || typeName == QLatin1String("uint32_t")) {
return 4; return 4;
} else if (typeName == QLatin1Literal("int64_t") || typeName == QLatin1Literal("uint64_t")) { } else if (typeName == QLatin1String("int64_t") || typeName == QLatin1String("uint64_t")) {
return 8; return 8;
} else if (typeName == QLatin1Literal("float")) { } else if (typeName == QLatin1String("float")) {
return 4; return 4;
} else if (typeName == QLatin1Literal("double")) { } else if (typeName == QLatin1String("double")) {
return 8; return 8;
} else if (typeName == QLatin1Literal("char") || typeName == QLatin1Literal("bool")) { } else if (typeName == QLatin1String("char") || typeName == QLatin1String("bool")) {
return 1; return 1;
} }
...@@ -74,7 +74,7 @@ bool ULogParser::parseFieldFormat(QString& fields) ...@@ -74,7 +74,7 @@ bool ULogParser::parseFieldFormat(QString& fields)
QString typeNameFull = fields.mid(prevFieldEnd, spacePos - prevFieldEnd); QString typeNameFull = fields.mid(prevFieldEnd, spacePos - prevFieldEnd);
QString fieldName = fields.mid(spacePos + 1, fieldEnd - spacePos - 1); QString fieldName = fields.mid(spacePos + 1, fieldEnd - spacePos - 1);
if (!fieldName.contains(QLatin1Literal("_padding"))) { if (!fieldName.contains(QLatin1String("_padding"))) {
_cameraCaptureOffsets.insert(fieldName, offset); _cameraCaptureOffsets.insert(fieldName, offset);
offset += sizeOfFullType(typeNameFull); offset += sizeOfFullType(typeNameFull);
} }
...@@ -117,7 +117,7 @@ bool ULogParser::getTagsFromLog(QByteArray& log, QList<GeoTagWorker::cameraFeedb ...@@ -117,7 +117,7 @@ bool ULogParser::getTagsFromLog(QByteArray& log, QList<GeoTagWorker::cameraFeedb
QString messageName = fmt.left(posSeparator); QString messageName = fmt.left(posSeparator);
QString messageFields = fmt.mid(posSeparator + 1, header.msgSize - posSeparator - 1); QString messageFields = fmt.mid(posSeparator + 1, header.msgSize - posSeparator - 1);
if(messageName == QLatin1Literal("camera_capture")) { if(messageName == QLatin1String("camera_capture")) {
parseFieldFormat(messageFields); parseFieldFormat(messageFields);
} }
break; break;
...@@ -131,7 +131,7 @@ bool ULogParser::getTagsFromLog(QByteArray& log, QList<GeoTagWorker::cameraFeedb ...@@ -131,7 +131,7 @@ bool ULogParser::getTagsFromLog(QByteArray& log, QList<GeoTagWorker::cameraFeedb
QString messageName(addLoggedMsg.msgName); QString messageName(addLoggedMsg.msgName);
if(messageName.contains(QLatin1Literal("camera_capture"))) { if(messageName.contains(QLatin1String("camera_capture"))) {
_cameraCaptureMsgID = addLoggedMsg.msgID; _cameraCaptureMsgID = addLoggedMsg.msgID;
geotagFound = true; geotagFound = true;
} }
......
...@@ -246,7 +246,7 @@ void APMAirframeComponentController::_githubJsonDownloadComplete(QString /*remot ...@@ -246,7 +246,7 @@ void APMAirframeComponentController::_githubJsonDownloadComplete(QString /*remot
QGCFileDownload* downloader = new QGCFileDownload(this); QGCFileDownload* downloader = new QGCFileDownload(this);
connect(downloader, &QGCFileDownload::downloadComplete, this, &APMAirframeComponentController::_paramFileDownloadComplete); connect(downloader, &QGCFileDownload::downloadComplete, this, &APMAirframeComponentController::_paramFileDownloadComplete);
downloader->download(json[QLatin1Literal("download_url")].toString()); downloader->download(json[QLatin1String("download_url")].toString());
} else { } else {
qgcApp()->showAppMessage(tr("Param file github json download failed: %1").arg(errorMsg)); qgcApp()->showAppMessage(tr("Param file github json download failed: %1").arg(errorMsg));
qgcApp()->restoreOverrideCursor(); qgcApp()->restoreOverrideCursor();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment