bump Android Gradle Plugin to 8.1.0

- had to do some real buffoonery to make namespaces work. Hope packages end up updating to AGP >= 8.0
This commit is contained in:
0xturboblitz
2024-08-31 17:45:38 +09:00
parent 69b29ab106
commit 0a47d2890c
8 changed files with 53 additions and 15 deletions

View File

@@ -20,7 +20,7 @@ buildscript {
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

View File

@@ -1,7 +1,7 @@
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.proofofpassportapp"
>

View File

@@ -22,7 +22,7 @@ buildscript {
dependencies {
classpath("com.facebook.react:react-native-gradle-plugin")
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.1.0'
classpath 'com.google.gms:google-services:4.3.14'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
classpath 'org.mozilla.rust-android-gradle:plugin:0.9.3'
@@ -40,4 +40,41 @@ allprojects {
}
resolutionStrategy.force 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
}
}
subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
android {
def manifestFile = project.file('src/main/AndroidManifest.xml')
def buildGradleFile = project.file('build.gradle')
if (buildGradleFile.exists()) {
def buildGradleText = buildGradleFile.text
def namespaceMatcher = buildGradleText =~ /namespace\s*['"](.+?)['"]/
if (namespaceMatcher.find()) {
namespace = namespaceMatcher[0][1]
println "Set namespace for ${project.name} to ${namespace} from build.gradle"
return
}
}
if (manifestFile.exists()) {
def manifestText = manifestFile.text
def packageMatcher = manifestText =~ /package="([\w\.]+)"/
if (packageMatcher.find()) {
def packageName = packageMatcher[0][1]
namespace = packageName
println "Set namespace for ${project.name} to ${namespace} from AndroidManifest.xml"
} else {
namespace = project.group
println "No 'package' attribute found. Set namespace for ${project.name} to ${namespace}"
}
} else {
namespace = project.group
println "AndroidManifest.xml not found. Set namespace for ${project.name} to ${namespace}"
}
}
}
}
}

View File

@@ -11,6 +11,7 @@
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
android.defaults.buildfeatures.buildconfig=true
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit

View File

@@ -2,6 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
android {
namespace "io.tradle.nfc"
compileSdkVersion 33
defaultConfig {
targetSdkVersion 33

View File

@@ -1,4 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="io.tradle.nfc">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.NFC" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-feature android:name="android.hardware.nfc" android:required="false" />