Install build tools
Install Ruby with rbenv on macOS and install CocoaPods without sudo
:
gem install cocoapods
Install Ruby with rbenv on macOS and install CocoaPods without sudo
:
gem install cocoapods
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install rbenv
I have system Ruby:
% which -a ruby
/usr/bin/ruby
ruby -v
ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.x86_64-darwin23]
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
When my QT app starts first time on MacOS, its directory ./Application Support/Sharlines/Lines/
does not exit, but QT creates it when I write to QSettings
first time.
To create the local directory I added the following code:
// Local data directory does not exist when the app is run first time on MacOS.
if (fs::create_directories(GetLocalFolder()))
{
qDebug() << static_cast<QString>(qtil::Format() << "Local folder '" << GetLocalFolder() << "' has been created.");
}
According to the official repository docs I tried to install CocaPods:
sudo gem install cocoapods
but got the following error:
ERROR: Error installing cocoapods:
The last version of drb (>= 0) to support your Ruby & RubyGems was 2.0.6. Try installing it with `gem install drb -v 2.0.6` and then running the current command again
drb requires Ruby version >= 2.7.0. The current ruby version is 2.6.10.210.
Installed some dependencies and the installation of CocoaPods succeeded:
sudo gem install drb -v 2.0.6
sudo gem install activesupport -v 6.1.7.8
sudo gem install cocoapods
When I switched to QT 6.7.2
and set QT_ANDROID_TARGET_SDK_VERSION "34"
(that is Android 14) my QT app started to crash with the following stack traces:
On google Pixel 5 64-bit only 1080x2340 Android 14 (SDK 34) arm64-v8a
:
Exception java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
at android.os.Parcel.createExceptionOrNull (Parcel.java:3189)
at android.os.Parcel.createException (Parcel.java:3167)
at android.os.Parcel.readException (Parcel.java:3150)
at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:202)
at android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:154)
at android.content.ContentProviderProxy.call (ContentProviderNative.java:764)
at android.content.ContentResolver.call (ContentResolver.java:2466)
at android.content.ContentResolver.call (ContentResolver.java:2446)
at ekfr.a (:com.google.android.gms@242013038@24.20.13 (190400-633713831):29)
at com.google.android.gms.wallet.intentoperation.setupwizard.PaymentsSetupWizardAccountChangeIntentOperation.onHandleIntent (:com.google.android.gms@242013038@24.20.13 (190400-633713831):252)
at com.google.android.chimera.IntentOperation.onHandleIntent (:com.google.android.gms@242013038@24.20.13 (190400-633713831):2)
at ajdw.onHandleIntent (:com.google.android.gms@242013038@24.20.13 (190400-633713831):8)
at pbh.run (:com.google.android.gms@242013038@24.20.13 (190400-633713831):70)
at pbg.run (:com.google.android.gms@242013038@24.20.13 (190400-633713831):152)
at elbx.run (:com.google.android.gms@242013038@24.20.13 (190400-633713831):21)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:644)
at java.lang.Thread.run (Thread.java:1012)
QT generates gradle.properties
with the following values:
android.useAndroidX=true
android.enableJetifier=true
androidBuildToolsVersion=34.0.0
androidCompileSdkVersion=34
androidNdkVersion=26.2.11394342
buildDir=build
qt5AndroidDir=C:/dev/libs/Qt6/android/release/arm64-v8a/./src/android/java
qtAndroidDir=C:/dev/libs/Qt6/android/release/arm64-v8a/./src/android/java
qtMinSdkVersion=23
qtTargetAbiList=arm64-v8a
qtTargetSdkVersion=33
To build my app for iOS I tried to run CMake from the command line without QT Creator:
cmake -S /Users/admin/dev/repos/examples/src/LinesGame/LinesGameQt -B . -DCMAKE_GENERATOR:STRING=Xcode \
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=./.qtc/package-manager/auto-setup.cmake -DQT_QMAKE_EXECUTABLE:FILEPATH=/Users/admin/dev/libs/QT6/release/iOS/bin/qmake6 \
-DCMAKE_PREFIX_PATH:PATH=/Users/admin/dev/libs/QT6/release/iOS \
-DCMAKE_C_COMPILER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang \
-DCMAKE_CXX_COMPILER:FILEPATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ \
-DCMAKE_TOOLCHAIN_FILE:FILEPATH=/Users/admin/dev/libs/QT6/release/iOS/lib/cmake/Qt6/qt.toolchain.cmake \
-DCMAKE_OSX_ARCHITECTURES:STRING=arm64 -DCMAKE_OSX_SYSROOT:STRING=iphoneos -DCMAKE_CXX_FLAGS_INIT:STRING= \
-DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM:STRING=XXXXXXX
First I set CMake generator to XCode in QT Creator Kits settings page:
(more…)