1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 07:13:02 +04:00

Merge pull request #23447 from onuralpszr:gradle80_namespace

AGP 8.0 build.gradle namespace and aidl buildFeature requirement added #23447 

Hello,

Android Gradle Plugin version 8.0 is asking for namespace. This is become mandatory and after I update my AGP to 8.0, I got this error 


```
Namespace not specified. Please specify a namespace in the module's build.gradle file like so:

android {
    namespace 'com.example.namespace'
}

If the package attribute is specified in the source AndroidManifest.xml, it can be migrated automatically to the namespace value in the build.gradle file using the AGP Upgrade Assistant; please refer to https://developer.android.com/studio/build/agp-upgrade-assistant for more information.
```

This change fix this future releases. However I am not sure how opencv wants to user namespace I used "org.opencv" if there is a different namespace please let me know so I can changed that too. Also should I add namepsace into "opencv/modules/java/android_sdk/android_gradle_lib/build.gradle" here ?

### Sources

Android developer link: https://developer.android.com/studio/preview/features#namespace-dsl
Issue Tracker Google: https://issuetracker.google.com/issues/191813691?pli=1#comment19

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
Onuralp Sezer
2023-04-28 13:41:39 +03:00
committed by GitHub
parent 6dbc5e032f
commit 5ccb4e0487
2 changed files with 29 additions and 0 deletions
+8
View File
@@ -97,6 +97,7 @@ def openCVersionCode = ((@OPENCV_VERSION_MAJOR@ * 100 + @OPENCV_VERSION_MINOR@)
println "OpenCV: " +openCVersionName + " " + project.buildscript.sourceFile
android {
@OPENCV_ANDROID_NAMESPACE_DECLARATION@
compileSdkVersion @ANDROID_COMPILE_SDK_VERSION@
defaultConfig {
@@ -114,6 +115,13 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_@ANDROID_GRADLE_JAVA_VERSION_INIT@
targetCompatibility JavaVersion.VERSION_@ANDROID_GRADLE_JAVA_VERSION_INIT@
}
@ANDROID_GRADLE_BUILD_FEATURE_AIDL@
buildTypes {
debug {
packagingOptions {