11apply plugin : " com.android.application"
2+ apply plugin : " org.jetbrains.kotlin.android"
23apply plugin : " com.facebook.react"
34
4- import com.android.build.OutputFile
5-
65/**
76 * This is the configuration block to customize your React Native Android app.
87 * By default you don't need to apply any configuration, just uncomment the lines you need.
@@ -13,8 +12,8 @@ react {
1312 // root = file("../")
1413 // The folder where the react-native NPM package is. Default is ../node_modules/react-native
1514 // reactNativeDir = file("../node_modules/react-native")
16- // The folder where the react-native Codegen package is. Default is ../node_modules/react-native- codegen
17- // codegenDir = file("../node_modules/react-native- codegen")
15+ // The folder where the react-native Codegen package is. Default is ../node_modules/@ react-native/ codegen
16+ // codegenDir = file("../node_modules/@ react-native/ codegen")
1817 // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
1918 // cliFile = file("../node_modules/react-native/cli.js")
2019
@@ -52,14 +51,6 @@ react {
5251 // hermesFlags = ["-O", "-output-source-map"]
5352}
5453
55- /**
56- * Set this to true to create four separate APKs instead of one,
57- * one for each native architecture. This is useful if you don't
58- * use App Bundles (https://developer.android.com/guide/app-bundle/)
59- * and want to have separate APKs to upload to the Play Store.
60- */
61- def enableSeparateBuildPerCPUArchitecture = false
62-
6354/**
6455 * Set this to true to Run Proguard on Release builds to minify the Java bytecode.
6556 */
@@ -78,45 +69,33 @@ def enableProguardInReleaseBuilds = false
7869 */
7970def jscFlavor = ' org.webkit:android-jsc:+'
8071
81- /**
82- * Private function to get the list of Native Architectures you want to build.
83- * This reads the value from reactNativeArchitectures in your gradle.properties
84- * file and works together with the --active-arch-only flag of react-native run-android.
85- */
86- def reactNativeArchitectures () {
87- def value = project. getProperties(). get(" reactNativeArchitectures" )
88- return value ? value. split(" ," ) : [" armeabi-v7a" , " x86" , " x86_64" , " arm64-v8a" ]
89- }
9072
9173android {
9274
75+ buildToolsVersion rootProject. ext. buildToolsVersion
9376 compileSdkVersion rootProject. ext. compileSdkVersion
94- namespace " com.example. reactnativeonnxruntimemodule"
77+ namespace " com.reactnativeonnxruntimemodule"
9578 compileOptions {
9679 sourceCompatibility JavaVersion . VERSION_17
9780 targetCompatibility JavaVersion . VERSION_17
9881 }
9982 packagingOptions {
10083 pickFirst ' **/libc++_shared.so'
10184 pickFirst ' **/libfbjni.so'
85+ excludes = [
86+ " META-INF" ,
87+ " META-INF/**" ,
88+ ]
10289 }
10390 defaultConfig {
104- applicationId " com.example. reactnativeonnxruntimemodule"
91+ applicationId " com.reactnativeonnxruntimemodule"
10592 minSdkVersion rootProject. ext. minSdkVersion
10693 targetSdkVersion rootProject. ext. targetSdkVersion
10794 versionCode 1
10895 versionName " 1.0"
10996 testBuildType System . getProperty(' testBuildType' , ' debug' )
11097 testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
11198 }
112- splits {
113- abi {
114- reset()
115- enable enableSeparateBuildPerCPUArchitecture
116- universalApk false // If true, also generate a universal APK
117- include " armeabi-v7a" , " x86" , " arm64-v8a" , " x86_64"
118- }
119- }
12099 signingConfigs {
121100 debug {
122101 storeFile rootProject. file(' debug.keystore' )
@@ -135,20 +114,6 @@ android {
135114 proguardFile " ${ rootProject.projectDir} /../node_modules/detox/android/detox/proguard-rules-app.pro"
136115 }
137116 }
138- // applicationVariants are e.g. debug, release
139- applicationVariants. all { variant ->
140- variant. outputs. each { output ->
141- // For each separate APK per architecture, set a unique version code as described here:
142- // https://developer.android.com/studio/build/configure-apk-splits.html
143- def versionCodes = [" armeabi-v7a" : 1 , " x86" : 2 , " arm64-v8a" : 3 , " x86_64" : 4 ]
144- def abi = output. getFilter(OutputFile . ABI )
145- if (abi != null ) { // null for the universal-debug, universal-release variants
146- output. versionCodeOverride =
147- versionCodes. get(abi) * 1048576 + defaultConfig. versionCode
148- }
149-
150- }
151- }
152117}
153118
154119repositories {
@@ -164,19 +129,8 @@ dependencies {
164129 implementation fileTree(dir : " libs" , include : [" *.jar" ])
165130 // The version of react-native is set by the React Native Gradle Plugin
166131 implementation(" com.facebook.react:react-android" )
167-
168- implementation " androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
132+ implementation(" com.facebook.react:flipper-integration" )
169133 implementation ' androidx.test.ext:junit:1.1.5'
170- debugImplementation(" com.facebook.flipper:flipper:${ FLIPPER_VERSION} " ) {
171- exclude group :' com.facebook.fbjni'
172- }
173- debugImplementation(" com.facebook.flipper:flipper-network-plugin:${ FLIPPER_VERSION} " ) {
174- exclude group :' com.facebook.flipper'
175- exclude group :' com.squareup.okhttp3' , module :' okhttp'
176- }
177- debugImplementation(" com.facebook.flipper:flipper-fresco-plugin:${ FLIPPER_VERSION} " ) {
178- exclude group :' com.facebook.flipper'
179- }
180134
181135 if (hermesEnabled. toBoolean()) {
182136 implementation(" com.facebook.react:hermes-android" )
@@ -188,7 +142,7 @@ dependencies {
188142 androidTestImplementation " androidx.test:runner:1.5.2"
189143 androidTestImplementation " androidx.test:rules:1.5.0"
190144
191- implementation project(' :onnxruntime-react-native' )
145+ implementation ( project(' :onnxruntime-react-native' ) )
192146 // specify ORT dependency here so it can be found in libs flatDir repository
193147 implementation " com.microsoft.onnxruntime:onnxruntime-android:latest.integration@aar"
194148}
0 commit comments