@@ -3,62 +3,21 @@ apply plugin: "org.jetbrains.kotlin.android"
33apply plugin : " com.facebook.react"
44
55def projectRoot = rootDir. getAbsoluteFile(). getParentFile(). getAbsolutePath()
6- def resolveNodeExecutable = {
7- def properties = new Properties ()
8- def localPropertiesFiles = [
9- new File (rootDir, " local.properties" ),
10- new File (rootDir. parentFile, " local.properties" ),
11- new File (rootDir. parentFile. parentFile, " local.properties" ),
12- ]
13- localPropertiesFiles. findAll { it. exists() }. each { file ->
14- file. withInputStream { properties. load(it) }
15- }
16-
17- def nodeExecutable = properties. getProperty(" NODE_BINARY" ) ?:
18- properties. getProperty(" nodeExecutable" ) ?:
19- System . getenv(" NODE_BINARY" )
20-
21- return nodeExecutable ?: " node"
22- }
23- def nodeExecutable = resolveNodeExecutable()
24- def nodeCommand = { String expression ->
25- return [nodeExecutable, " --print" , expression]. execute(null , rootDir). text. trim()
26- }
27- def loadGoogleMapsApiKey = {
28- def properties = new Properties ()
29- def localPropertiesFiles = [
30- new File (rootDir, " local.properties" ),
31- new File (rootDir. parentFile, " local.properties" ),
32- new File (rootDir. parentFile. parentFile, " local.properties" ),
33- ]
34- localPropertiesFiles. findAll { it. exists() }. each { file ->
35- file. withInputStream { properties. load(it) }
36- }
37-
38- return properties. getProperty(" ANDROID_GOOGLE_MAPS_API_KEY" )
39- ?: properties. getProperty(" GOOGLE_MAPS_API_KEY" )
40- ?: findProperty(" ANDROID_GOOGLE_MAPS_API_KEY" )
41- ?: findProperty(" GOOGLE_MAPS_API_KEY" )
42- ?: System . getenv(" ANDROID_GOOGLE_MAPS_API_KEY" )
43- ?: System . getenv(" GOOGLE_MAPS_API_KEY" )
44- ?: " "
45- }
46- def googleMapsApiKey = loadGoogleMapsApiKey()
476
487/**
498 * This is the configuration block to customize your React Native Android app.
509 * By default you don't need to apply any configuration, just uncomment the lines you need.
5110 */
5211react {
53- entryFile = file([nodeExecutable , " -e" , " require('expo/scripts/resolveAppEntry')" , projectRoot, " android" , " absolute" ]. execute(null , rootDir). text. trim())
54- reactNativeDir = new File (nodeCommand( " require.resolve('react-native/package.json')" )). getParentFile(). getAbsoluteFile()
55- hermesCommand = new File (nodeCommand( " require.resolve('hermes-compiler/package.json', { paths: [require.resolve('react-native/package.json')] })" )). getParentFile(). getAbsolutePath() + " /hermesc/%OS-BIN%/hermesc"
56- codegenDir = new File (nodeCommand( " require.resolve('@react-native/codegen/package.json', { paths: [require.resolve('react-native/package.json')] })" )). getParentFile(). getAbsoluteFile()
12+ entryFile = file([" node " , " -e" , " require('expo/scripts/resolveAppEntry')" , projectRoot, " android" , " absolute" ]. execute(null , rootDir). text. trim())
13+ reactNativeDir = new File ([ " node " , " --print " , " require.resolve('react-native/package.json')" ] . execute( null , rootDir) . text . trim( )). getParentFile(). getAbsoluteFile()
14+ hermesCommand = new File ([ " node " , " --print " , " require.resolve('hermes-compiler/package.json', { paths: [require.resolve('react-native/package.json')] })" ] . execute( null , rootDir) . text . trim( )). getParentFile(). getAbsolutePath() + " /hermesc/%OS-BIN%/hermesc"
15+ codegenDir = new File ([ " node " , " --print " , " require.resolve('@react-native/codegen/package.json', { paths: [require.resolve('react-native/package.json')] })" ] . execute( null , rootDir) . text . trim( )). getParentFile(). getAbsoluteFile()
5716
5817 enableBundleCompression = (findProperty(' android.enableBundleCompression' ) ?: false ). toBoolean()
5918 // Use Expo CLI to bundle the app, this ensures the Metro config
6019 // works correctly with Expo projects.
61- cliFile = new File (nodeCommand( " require.resolve('@expo/cli', { paths: [require.resolve('expo/package.json')] })" ))
20+ cliFile = new File ([ " node " , " --print " , " require.resolve('@expo/cli', { paths: [require.resolve('expo/package.json')] })" ] . execute( null , rootDir) . text . trim( ))
6221 bundleCommand = " export:embed"
6322
6423 /* Folders */
@@ -131,13 +90,19 @@ android {
13190 namespace ' com.mapconductor.basic'
13291 defaultConfig {
13392 applicationId ' com.mapconductor.basic'
134- minSdkVersion rootProject . ext . minSdkVersion
93+ minSdkVersion 26
13594 targetSdkVersion rootProject. ext. targetSdkVersion
13695 versionCode 1
13796 versionName " 1.0.0"
13897
13998 buildConfigField " String" , " REACT_NATIVE_RELEASE_LEVEL" , " \" ${ findProperty('reactNativeReleaseLevel') ?: 'stable'} \" "
140- manifestPlaceholders[" googleMapsApiKey" ] = googleMapsApiKey
99+
100+ // Set directly here (rather than relying solely on reactnative-for-here's own
101+ // rootProject.subprojects manifestPlaceholders hook) for reliability during local testing.
102+ def localProps = new Properties ()
103+ file(" ${ rootDir} /local.properties" ). withInputStream { localProps. load(it) }
104+ manifestPlaceholders[" hereAccessKeyId" ] = localProps. getProperty(" HERE_ACCESS_KEY_ID" , " " )
105+ manifestPlaceholders[" hereAccessKeySecret" ] = localProps. getProperty(" HERE_ACCESS_KEY_SECRET" , " " )
141106 }
142107 signingConfigs {
143108 debug {
@@ -197,11 +162,6 @@ android {
197162dependencies {
198163 // The version of react-native is set by the React Native Gradle Plugin
199164 implementation(" com.facebook.react:react-android" )
200- implementation project(' :mapconductor_react-for-googlemaps' )
201- implementation project(' :mapconductor_react-for-maplibre' )
202- implementation project(' :mapconductor_react-marker-clustering' )
203- implementation project(' :mapconductor_react-geojson-layer' )
204- implementation project(' :mapconductor_react-heatmap' )
205165
206166 def isGifEnabled = (findProperty(' expo.gif.enabled' ) ?: " " ) == " true" ;
207167 def isWebpEnabled = (findProperty(' expo.webp.enabled' ) ?: " " ) == " true" ;
0 commit comments