Skip to content

Commit fac7e1d

Browse files
committed
Gradle Updates core Android
1 parent 7c4cac8 commit fac7e1d

3 files changed

Lines changed: 71 additions & 122 deletions

File tree

libs/openFrameworksCompiled/project/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ buildscript {
44
mavenCentral()
55
}
66
dependencies {
7-
classpath 'com.android.tools.build:gradle:7.1.3'
7+
classpath 'com.android.tools.build:gradle:8.7.0'
88
}
99
}
1010

Lines changed: 69 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,137 +1,86 @@
11
plugins {
2-
id 'com.android.library'
2+
id 'com.android.library'
33
}
44

5-
6-
7-
// pointing to cmake's source code for the same project
85
def PRJ_SRC_ROOT = './'
9-
def ofRoot(){ return '../../../../' }
6+
def ofRoot() { return '../../../../' }
107
final ofSource = ofRoot() + 'libs/openFrameworks'
118
final ofLibs = ofRoot() + 'libs'
129
final addons = ofRoot() + 'addons'
1310
def OFX_ANDROID = ofRoot() + 'addons/ofxAndroid'
1411
final ofLibOutput = ofRoot() + 'libs/openFrameworksCompiled/lib/android'
15-
def LIB_OUTPUT=ofRoot() + './../../../../libs/openFrameworksCompiled/lib/android'
12+
def LIB_OUTPUT = ofRoot() + './../../../../libs/openFrameworksCompiled/lib/android'
1613
def enableProguardInReleaseBuilds = true
1714
def enableProguardInDebugBuilds = true
1815
tasks.register("prepareKotlinBuildScriptModel"){}
1916

20-
2117
android {
22-
compileSdkVersion 33
23-
//ndkPath "/Users/~/Documents/android-ndk-r21e" // Point to your own NDK if needed
24-
//ndkVersion "23.1.7779620" //NDK will automatically sideload with this
25-
ndkVersion '24.0.8215888'
26-
buildToolsVersion '32.0.0'
27-
28-
// Enable generation of Prefab packages and include them in the library's AAR.
29-
// buildFeatures {
30-
// prefabPublishing true
31-
// }
32-
//
33-
// buildFeatures {
34-
// prefab true
35-
// }
36-
37-
// android.buildFeatures.prefabPublishing true
38-
39-
40-
defaultConfig {
41-
minSdkVersion 21
42-
targetSdkVersion 33
43-
versionCode 15
44-
versionName '15'
45-
ndk.abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
46-
47-
externalNativeBuild {
48-
// if (!project.hasProperty("ndkBuild")) {
49-
cmake {
50-
arguments "-DANDROID_STL=c++_shared",
51-
"-DANDROID_ARM_NEON=TRUE",
52-
"-DANDROID_TOOLCHAIN=clang",
53-
"-DTARGET_OPENGLES=TRUE"
54-
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
55-
}
56-
// } else {
57-
// ndkBuild {
58-
//
59-
// }
60-
// }
61-
}
62-
multiDexEnabled false
63-
}
64-
buildTypes {
65-
release {
66-
minifyEnabled true
67-
shrinkResources false
68-
jniDebuggable false
69-
debuggable false
70-
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
71-
'proguard-rules.pro'
72-
// packagingOptions {
73-
// doNotStrip '**/*.so'
74-
// }
75-
}
76-
debug {
77-
shrinkResources false
78-
jniDebuggable true
79-
debuggable true
80-
// packagingOptions {
81-
// doNotStrip '**/*.so'
82-
// }
83-
}
84-
}
85-
sourceSets {
86-
main {
87-
manifest.srcFile "${PRJ_SRC_ROOT}/AndroidManifest.xml"
88-
java.srcDirs = ["${OFX_ANDROID}/Java"]
89-
// res.srcDirs = ["${PRJ_SRC_ROOT}/res"]
90-
}
91-
}
92-
externalNativeBuild {
93-
// if (!project.hasProperty("ndkBuild")) {
94-
cmake {
95-
path "CMakeLists.txt"
96-
}
97-
// } else {
98-
// ndkBuild {
99-
// path "Android.mk"
100-
// }
101-
// }
102-
}
103-
compileOptions {
104-
sourceCompatibility JavaVersion.VERSION_1_8
105-
targetCompatibility JavaVersion.VERSION_1_8
106-
}
107-
108-
109-
// Include the "mylibrary" module from the native build system in the AAR,
110-
// and export the headers in src/main/cpp/include to its consumers
111-
prefab {
112-
openFrameworksAndroid {
113-
//headers "src/main/cpp/include"
114-
}
115-
}
116-
117-
// Avoid packing the unnecessary libraries into final AAR. For details
118-
// refer to https://issuetracker.google.com/issues/168777344#comment5
119-
// Note that if your AAR also contains Java/Kotlin APIs, you should not
120-
// exclude libraries that are used by those APIs.
121-
packagingOptions {
122-
// exclude("**/libopenFrameworksAndroid.so")
123-
// exclude("**/classes.jar")
124-
}
18+
namespace 'com.example.openframeworksandroid' // Added to fix the previous error
19+
compileSdkVersion 34
20+
ndkVersion '28.0.13004108'
21+
buildToolsVersion '35.0.1'
22+
23+
defaultConfig {
24+
minSdkVersion 24
25+
targetSdkVersion 34
26+
versionCode 12
27+
versionName '12'
28+
ndk.abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
29+
30+
externalNativeBuild {
31+
cmake {
32+
arguments "-DANDROID_STL=c++_shared",
33+
"-DANDROID_ARM_NEON=TRUE",
34+
"-DANDROID_TOOLCHAIN=clang",
35+
"-DTARGET_OPENGLES=TRUE"
36+
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
37+
}
38+
}
39+
multiDexEnabled false
40+
}
41+
buildTypes {
42+
release {
43+
minifyEnabled true
44+
shrinkResources false
45+
jniDebuggable false
46+
debuggable false
47+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
48+
'proguard-rules.pro'
49+
}
50+
debug {
51+
shrinkResources false
52+
jniDebuggable true
53+
debuggable true
54+
}
55+
}
56+
sourceSets {
57+
main {
58+
manifest.srcFile "${PRJ_SRC_ROOT}/AndroidManifest.xml"
59+
java.srcDirs = ["${OFX_ANDROID}/Java"]
60+
}
61+
}
62+
externalNativeBuild {
63+
cmake {
64+
path "CMakeLists.txt"
65+
}
66+
}
67+
compileOptions {
68+
sourceCompatibility JavaVersion.VERSION_1_8
69+
targetCompatibility JavaVersion.VERSION_1_8
70+
}
71+
prefab {
72+
openFrameworksAndroid {
73+
headers "src/main/cpp/include"
74+
}
75+
}
76+
packagingOptions {
77+
exclude("**/libopenFrameworksAndroid.so")
78+
}
12579
}
12680

12781
dependencies {
128-
sourceCompatibility = JavaVersion.VERSION_1_8
129-
targetCompatibility = JavaVersion.VERSION_1_8
130-
131-
implementation fileTree(dir: 'libs', include: ['*.jar'])
132-
implementation 'androidx.appcompat:appcompat:1.6.1'
133-
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
134-
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
135-
implementation "com.getkeepsafe.relinker:relinker:1.4.4"
136-
137-
}
82+
implementation fileTree(dir: 'libs', include: ['*.jar'])
83+
implementation 'androidx.appcompat:appcompat:1.7.0'
84+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
85+
implementation "com.getkeepsafe.relinker:relinker:1.6.0"
86+
}

libs/openFrameworksCompiled/project/android/openframeworksAndroid/project.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99

1010
android.library=true
1111
# Project target.
12-
target=android-19
12+
target=android-24

0 commit comments

Comments
 (0)