new changes maps
This commit is contained in:
@@ -22,14 +22,13 @@ if (keystorePropertiesFile.exists()) {
|
||||
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
|
||||
}
|
||||
|
||||
def googleMapsApiKey = localProperties.getProperty("GOOGLE_MAPS_API_KEY") ?: ""
|
||||
|
||||
android {
|
||||
namespace = "com.nearle.partner"
|
||||
compileSdk = 36
|
||||
|
||||
// Correct NDK version
|
||||
ndkVersion "27.0.12077973"
|
||||
// Must be >= the highest NDK required by any plugin (maplibre_gl needs
|
||||
// 28.1.13356709). NDK releases are backward compatible, so the highest wins.
|
||||
ndkVersion "28.1.13356709"
|
||||
|
||||
packagingOptions {
|
||||
jniLibs {
|
||||
@@ -58,7 +57,6 @@ android {
|
||||
versionName flutterVersionName
|
||||
|
||||
manifestPlaceholders = [
|
||||
GOOGLE_MAPS_API_KEY: googleMapsApiKey,
|
||||
applicationName: "android.app.Application"
|
||||
]
|
||||
|
||||
@@ -120,3 +118,57 @@ tasks.register("copyNotificationSounds", Copy) {
|
||||
tasks.named("preBuild").configure {
|
||||
dependsOn("copyNotificationSounds")
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Release artifact naming: nearlepartner<DDMMYY>v<versionName>.aab / .apk
|
||||
//
|
||||
// The file is RENAMED rather than copied, and any previous nearlepartner*
|
||||
// artifact is removed first, so exactly one bundle ever sits in the output
|
||||
// directory. That matters: when two .aab files are present, Flutter's
|
||||
// "✓ Built ..." line can name the wrong one, which is an easy way to upload a
|
||||
// stale build to the Play Store.
|
||||
// ---------------------------------------------------------------------------
|
||||
// `versionName` is passed in explicitly: script-level `def` variables such as
|
||||
// flutterVersionName are not in scope inside a `def` method in Groovy.
|
||||
def renameReleaseArtifact(File outputDir, String defaultName, String extension, String versionName) {
|
||||
def source = new File(outputDir, defaultName)
|
||||
if (!source.exists()) {
|
||||
return
|
||||
}
|
||||
|
||||
outputDir.listFiles({ File f ->
|
||||
f.name.startsWith("nearlepartner") && f.name.endsWith(extension)
|
||||
} as FileFilter)?.each { it.delete() }
|
||||
|
||||
def stamp = new Date().format("ddMMyy")
|
||||
def target = new File(outputDir, "nearlepartner${stamp}v${versionName}${extension}")
|
||||
if (source.renameTo(target)) {
|
||||
println "Release artifact renamed -> ${target.name}"
|
||||
} else {
|
||||
println "WARNING: could not rename ${source.name}; leaving it in place"
|
||||
}
|
||||
}
|
||||
|
||||
def releaseArtifactVersion = flutterVersionName
|
||||
|
||||
tasks.matching { it.name == "bundleRelease" }.configureEach {
|
||||
doLast {
|
||||
renameReleaseArtifact(
|
||||
layout.buildDirectory.dir("outputs/bundle/release").get().asFile,
|
||||
"app-release.aab",
|
||||
".aab",
|
||||
releaseArtifactVersion
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
tasks.matching { it.name == "assembleRelease" }.configureEach {
|
||||
doLast {
|
||||
renameReleaseArtifact(
|
||||
layout.buildDirectory.dir("outputs/apk/release").get().asFile,
|
||||
"app-release.apk",
|
||||
".apk",
|
||||
releaseArtifactVersion
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
|
||||
<!-- ===== Permissions ===== -->
|
||||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
|
||||
<!-- For older Android versions -->
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.PICTURE_IN_PICTURE" />
|
||||
<!-- Android 13+ notifications -->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
@@ -37,11 +34,6 @@
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:usesCleartextTraffic="true"> <!-- allows http if any -->
|
||||
|
||||
<!-- Google Maps API Key -->
|
||||
<meta-data
|
||||
android:name="com.google.android.geo.API_KEY"
|
||||
android:value="AIzaSyBhkGfnq27sN0wV5y_S-M2KojpFTk_by-Q" />
|
||||
|
||||
<!-- Firebase notification channel -->
|
||||
<meta-data
|
||||
android:name="com.google.firebase.messaging.default_notification_channel_id"
|
||||
|
||||
Reference in New Issue
Block a user