11plugins {
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
85def PRJ_SRC_ROOT = ' ./'
9- def ofRoot (){ return ' ../../../../' }
6+ def ofRoot () { return ' ../../../../' }
107final ofSource = ofRoot() + ' libs/openFrameworks'
118final ofLibs = ofRoot() + ' libs'
129final addons = ofRoot() + ' addons'
1310def OFX_ANDROID = ofRoot() + ' addons/ofxAndroid'
1411final ofLibOutput = ofRoot() + ' libs/openFrameworksCompiled/lib/android'
15- def LIB_OUTPUT = ofRoot() + ' ./../../../../libs/openFrameworksCompiled/lib/android'
12+ def LIB_OUTPUT = ofRoot() + ' ./../../../../libs/openFrameworksCompiled/lib/android'
1613def enableProguardInReleaseBuilds = true
1714def enableProguardInDebugBuilds = true
1815tasks. register(" prepareKotlinBuildScriptModel" ){}
1916
20-
2117android {
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
12781dependencies {
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+ }
0 commit comments