From 2a8bce7361e24f99e57b0ab55b9f3b11f0d36e0a Mon Sep 17 00:00:00 2001 From: Peter Lazar Date: Mon, 19 Jun 2023 13:36:57 +0200 Subject: [PATCH 1/7] =?UTF-8?q?feat(android):=20=F0=9F=8C=9F=20add=20suppo?= =?UTF-8?q?rt=20for=20React=20Native=200.73?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/build.gradle | 1 + android/src/main/AndroidManifest.xml | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index b186c4aa1b..a8965cdf55 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -12,6 +12,7 @@ if (isNewArchitectureEnabled()) { } android { + namespace = "io.sentry.react" compileSdkVersion safeExtGet('compileSdkVersion', 31) defaultConfig { diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 6077a0bba9..6f8d003046 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ - + - + From 314ec58099536ec3d725fbd326928593541bfcf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kry=C5=A1tof=20Wold=C5=99ich?= <31292499+krystofwoldrich@users.noreply.github.com> Date: Tue, 20 Jun 2023 11:51:34 +0200 Subject: [PATCH 2/7] Apply suggestions from code review --- android/build.gradle | 5 ++++- android/src/main/AndroidManifest.xml | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index a8965cdf55..11e6983782 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -12,7 +12,10 @@ if (isNewArchitectureEnabled()) { } android { - namespace = "io.sentry.react" + // Conditional for compatibility with AGP <4.2. + if (project.android.hasProperty("namespace")) { + namespace 'io.sentry.react' + } compileSdkVersion safeExtGet('compileSdkVersion', 31) defaultConfig { diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 6f8d003046..80c1952ed3 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -2,7 +2,6 @@ - + From 068b3d1f937c0aaa7763330cbae7cef97a5da822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kry=C5=A1tof=20Wold=C5=99ich?= <31292499+krystofwoldrich@users.noreply.github.com> Date: Tue, 20 Jun 2023 11:54:45 +0200 Subject: [PATCH 3/7] Update CHANGELOG.md --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 818026b536..7ac16de198 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +### Features + +- Use `android.namespace` to be compatible with AGP 8.x and RN 0.73 ([#3133](https://github.com/getsentry/sentry-react-native/pull/3133)) + ## 5.6.0 ### Features From 1566edf4ab265448631f5d8df0ceeb0b2ae643ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kry=C5=A1tof=20Wold=C5=99ich?= <31292499+krystofwoldrich@users.noreply.github.com> Date: Tue, 20 Jun 2023 13:02:42 +0200 Subject: [PATCH 4/7] Fix RN Cli namespace matching --- android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index 11e6983782..0c5c6d4822 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -14,7 +14,7 @@ if (isNewArchitectureEnabled()) { android { // Conditional for compatibility with AGP <4.2. if (project.android.hasProperty("namespace")) { - namespace 'io.sentry.react' + namespace = 'io.sentry.react' } compileSdkVersion safeExtGet('compileSdkVersion', 31) From e59d66b0e18f4cd84f9234685d939f695830ed82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kry=C5=A1tof=20Wold=C5=99ich?= <31292499+krystofwoldrich@users.noreply.github.com> Date: Tue, 20 Jun 2023 13:08:00 +0200 Subject: [PATCH 5/7] Update android/build.gradle --- android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index 0c5c6d4822..1abb0fd311 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -14,7 +14,7 @@ if (isNewArchitectureEnabled()) { android { // Conditional for compatibility with AGP <4.2. if (project.android.hasProperty("namespace")) { - namespace = 'io.sentry.react' + namespace = "io.sentry.react" } compileSdkVersion safeExtGet('compileSdkVersion', 31) From 0624f9474d9746d51be01c6ac5a021ee9ae88c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kry=C5=A1tof=20Wold=C5=99ich?= <31292499+krystofwoldrich@users.noreply.github.com> Date: Tue, 20 Jun 2023 13:36:16 +0200 Subject: [PATCH 6/7] Ensure compatibility with older versions keep package in android manifest --- android/src/main/AndroidManifest.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 80c1952ed3..6077a0bba9 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,4 +1,5 @@ - + From 267921c9a89d0fbaa5805bba21ba9e71a3d5b55a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kry=C5=A1tof=20Wold=C5=99ich?= <31292499+krystofwoldrich@users.noreply.github.com> Date: Thu, 22 Jun 2023 17:23:26 +0200 Subject: [PATCH 7/7] Update build.gradle --- android/build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index 1abb0fd311..b4e739ccb7 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -12,11 +12,12 @@ if (isNewArchitectureEnabled()) { } android { + compileSdkVersion safeExtGet('compileSdkVersion', 31) + // Conditional for compatibility with AGP <4.2. if (project.android.hasProperty("namespace")) { namespace = "io.sentry.react" } - compileSdkVersion safeExtGet('compileSdkVersion', 31) defaultConfig { minSdkVersion safeExtGet('minSdkVersion', 21)