Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(android): handle namespace properly starting AGP 8 #401

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,17 @@ def getExtOrIntegerDefault(name) {

android {
compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
namespace "com.reactnativeimageresizer"
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
def agpMajorVersion = agpVersion.tokenize('.')[0].toInteger()
def agpMinorVersion = agpVersion.tokenize('.')[1].toInteger()
/**
* Namespace should be declared here starting from AGP 8.x, Starting AGP 7.3 it is also supported.
* For AGP < 7.3, namespace should be declared in AndroidManifest.
* See: https://developer.android.com/build/releases/past-releases/agp-8-0-0-release-notes#namespace-dsl
*/
if (agpMajorVersion >= 7 && agpMinorVersion >= 3) {
namespace "com.reactnativeimageresizer"
}

defaultConfig {
minSdkVersion getExtOrIntegerDefault("minSdkVersion")
Expand Down
2 changes: 1 addition & 1 deletion android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.reactnativeimageresizer">

</manifest>