Skip to content

Commit be623dd

Browse files
author
TeleGhost Dev
committed
Fix Android native crash: force bundle libc++_shared.so using dummy CMake project
1 parent d348eca commit be623dd

3 files changed

Lines changed: 24 additions & 2 deletions

File tree

android/app/build.gradle

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,25 @@ android {
1111
applicationId "com.teleghost.app"
1212
minSdk 24
1313
targetSdk 34
14-
versionCode 2
15-
versionName "1.0.2-beta"
14+
versionCode 3
15+
versionName "1.0.3-beta"
1616

1717
ndk {
1818
// Архитектуры, поддерживаемые gomobile
1919
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
2020
}
21+
externalNativeBuild {
22+
cmake {
23+
arguments "-DANDROID_STL=c++_shared"
24+
}
25+
}
26+
}
27+
28+
externalNativeBuild {
29+
cmake {
30+
path "src/main/cpp/CMakeLists.txt"
31+
version "3.22.1"
32+
}
2133
}
2234

2335
buildTypes {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
cmake_minimum_required(VERSION 3.10.2)
2+
3+
# It's a dummy project to force Gradle to bundle libc++_shared.so
4+
project("dummy")
5+
6+
add_library(
7+
dummy
8+
SHARED
9+
dummy.cpp
10+
)

android/app/src/main/cpp/dummy.cpp

Whitespace-only changes.

0 commit comments

Comments
 (0)