-
Notifications
You must be signed in to change notification settings - Fork 315
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
AGP upgrading from 7.4.2 to 8.0.1 error "Namespace not specified. Please specify a namespace in the module's build.gradle file." #409
Comments
Can you provide a bit more context about why you need to upgrade this project to AGP 8.0.1? If you want to use media3 1.0.1, you can probably just use the artifacts from maven rather than building the library yourself? |
Personally, I have to vendor media3 to add some rejected changes like automatic FFMPEG decoder assembly, among other patches. Relying on the artifacts really isn't feasible for me. |
@OxygenCobalt Thanks for sharing - would your use-case be solved if you could build a local version of this project with its currently defined AGP version (7.2.2) and use something like (I'm cribbing from a similar comment from @bubenheimer in #346 (comment), who points out that I'm aware our current instructions tell you to put everything in one Android Studio project, I'm just wondering if we should revisit those instructions. |
@icbaker Thank you for your replay. My context: |
Can this be automated by gradle in some way @icbaker? One of the reasons I still vendor is that I can make all build steps be 100% executed by gradle with no extra scripting. |
@OxygenCobalt That's a good question. I did a bit of digging and it seems there isn't currently a good way with Gradle for one project to depend on another, with different Gradle/AGP versions, but with 'synchronized' re-building. Given that, I think we will stick with our current recommendation of putting everything into a single AS project (and unfortunately therefore requiring the same AGP version). I'm also looking into upgrading us to AGP 8.0.1, but it requires quite a lot of changes. @D7766 if you just want to experiment then I would not try and upgrade to AGP 8.0.1, just leave it on 7.4.2 and ignore Android Studio's recommendation for now. I will keep this issue open to track my efforts to upgrade to AGP 8.0.1. |
@icbaker Would you still be able to look into why "publishToMavenLocal" does not work? The media3 project looks set up to publish to a repo via standard Gradle & AGP mechanisms, which generally means that it will publish to local as well; there is no extra setup required to make this work. It is puzzling that it is not working. |
@bubenheimer I just tried I then bumped the version number to I did this in a Debian-based development environment. If you're seeing a different behaviour when following the same steps then I suggest you file a separate issue, though I'm afraid we have limited capacity to investigate build problems that don't repro for us, so we may not be able to offer much assistance. |
This is blocking the upgrade to AGP 8.0.1. The Android Studio Upgrade Assistant refuses to run with the error: > Modules have the same package for their `main` and `androidTest` > artifacts > > The package specifications in `AndroidManifest.xml` files define the > same package for the `main` and `androidTest` artifacts, in the > following modules: `effect`, `muxer`, `transformer`, `test_exoplayer_abr`, `test_exoplayer_performance`, and `container`. This change also adds the `.test` suffix to `test/AndroidManifest.xml` files where it's missing, because although it's not mentioned in the Upgrade Assistant error it does cause problems later. ``` > Incorrect package="androidx.media3.database" found in source AndroidManifest.xml: libraries/database/src/test/AndroidManifest.xml. Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported. Recommendation: remove package="androidx.media3.database" from the source AndroidManifest.xml: libraries/database/src/test/AndroidManifest.xml. ``` Issue: androidx/media#409 PiperOrigin-RevId: 533460180
This is a pre-requisite for the Android Studio upgrade assistant to upgrade from AGP 7.2.2 to 8.0.1, otherwise it fails and complains this is missing. Issue: androidx/media#409 PiperOrigin-RevId: 533463246
Docs: * https://developer.android.com/build/publish-library/configure-pub-variants#single-pub-var * https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/dsl/PublishingOptions This resolves the following warning from Android Gradle Plugin 7.2.2 and helps unblock the upgrade to AGP 8.0.1: > Software Components will not be created automatically for Maven > publishing from Android Gradle Plugin 8.0. To opt-in to the future > behavior, set the Gradle property > `android.disableAutomaticComponentCreation=true` in the > `gradle.properties` file or use the new publishing DSL. > > Affected Modules: `lib-cast`, `lib-common`, `lib-container`, > `lib-database`, `lib-datasource`, `lib-datasource-cronet`, > `lib-datasource-okhttp`, `lib-datasource-rtmp`, `lib-decoder`, > `lib-effect`, `lib-exoplayer`, `lib-exoplayer-all (legacy)`, > `lib-exoplayer-dash`, `lib-exoplayer-hls`, `lib-exoplayer-ima`, > `lib-exoplayer-rtsp`, `lib-exoplayer-smoothstreaming`, > `lib-exoplayer-workmanager`, `lib-extractor`, `lib-media2 (legacy)`, > `lib-mediasession (legacy)`, `lib-muxer`, `lib-session`, > `lib-transformer`, `lib-ui`, `lib-ui-leanback`, `test-utils`, > `test-utils-robolectric` Issue: androidx/media#409 PiperOrigin-RevId: 533464133
This change was auto-generated by the Android Studio Upgrade Assistant. Issue: androidx/media#409 PiperOrigin-RevId: 533467455
This is blocking the upgrade to AGP 8.0.1. The Android Studio Upgrade Assistant refuses to run with the error: > Modules have the same package for their `main` and `androidTest` > artifacts > > The package specifications in `AndroidManifest.xml` files define the > same package for the `main` and `androidTest` artifacts, in the > following modules: `effect`, `muxer`, `transformer`, `test_exoplayer_abr`, `test_exoplayer_performance`, and `container`. This change also adds the `.test` suffix to `test/AndroidManifest.xml` files where it's missing, because although it's not mentioned in the Upgrade Assistant error it does cause problems later. ``` > Incorrect package="androidx.media3.database" found in source AndroidManifest.xml: libraries/database/src/test/AndroidManifest.xml. Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported. Recommendation: remove package="androidx.media3.database" from the source AndroidManifest.xml: libraries/database/src/test/AndroidManifest.xml. ``` Issue: #409 PiperOrigin-RevId: 533460180
This is a pre-requisite for the Android Studio upgrade assistant to upgrade from AGP 7.2.2 to 8.0.1, otherwise it fails and complains this is missing. Issue: #409 PiperOrigin-RevId: 533463246
Docs: * https://developer.android.com/build/publish-library/configure-pub-variants#single-pub-var * https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/dsl/PublishingOptions This resolves the following warning from Android Gradle Plugin 7.2.2 and helps unblock the upgrade to AGP 8.0.1: > Software Components will not be created automatically for Maven > publishing from Android Gradle Plugin 8.0. To opt-in to the future > behavior, set the Gradle property > `android.disableAutomaticComponentCreation=true` in the > `gradle.properties` file or use the new publishing DSL. > > Affected Modules: `lib-cast`, `lib-common`, `lib-container`, > `lib-database`, `lib-datasource`, `lib-datasource-cronet`, > `lib-datasource-okhttp`, `lib-datasource-rtmp`, `lib-decoder`, > `lib-effect`, `lib-exoplayer`, `lib-exoplayer-all (legacy)`, > `lib-exoplayer-dash`, `lib-exoplayer-hls`, `lib-exoplayer-ima`, > `lib-exoplayer-rtsp`, `lib-exoplayer-smoothstreaming`, > `lib-exoplayer-workmanager`, `lib-extractor`, `lib-media2 (legacy)`, > `lib-mediasession (legacy)`, `lib-muxer`, `lib-session`, > `lib-transformer`, `lib-ui`, `lib-ui-leanback`, `test-utils`, > `test-utils-robolectric` Issue: #409 PiperOrigin-RevId: 533464133
This change was auto-generated by the Android Studio Upgrade Assistant. Issue: #409 PiperOrigin-RevId: 533467455
I just pushed some commits (linked above) that update the I'm going to close this, since I think the question has been answered and we've also now updated. |
@icbaker I tried what you did with publishToMavenLocal on the commit you referenced, but it did not put any artifacts in my local .m2 folders. I suspect there is something private in your build setup that I don't have. I remember that it also does not even seem to build the desired artifacts if I just do ./gradlew clean publishToMavenLocal. I'm on Intel Mac. |
This is blocking the upgrade to AGP 8.0.1. The Android Studio Upgrade Assistant refuses to run with the error: > Modules have the same package for their `main` and `androidTest` > artifacts > > The package specifications in `AndroidManifest.xml` files define the > same package for the `main` and `androidTest` artifacts, in the > following modules: `effect`, `muxer`, `transformer`, `test_exoplayer_abr`, `test_exoplayer_performance`, and `container`. This change also adds the `.test` suffix to `test/AndroidManifest.xml` files where it's missing, because although it's not mentioned in the Upgrade Assistant error it does cause problems later. ``` > Incorrect package="androidx.media3.database" found in source AndroidManifest.xml: libraries/database/src/test/AndroidManifest.xml. Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported. Recommendation: remove package="androidx.media3.database" from the source AndroidManifest.xml: libraries/database/src/test/AndroidManifest.xml. ``` Issue: androidx#409 PiperOrigin-RevId: 533460180
This is a pre-requisite for the Android Studio upgrade assistant to upgrade from AGP 7.2.2 to 8.0.1, otherwise it fails and complains this is missing. Issue: androidx#409 PiperOrigin-RevId: 533463246
Docs: * https://developer.android.com/build/publish-library/configure-pub-variants#single-pub-var * https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/dsl/PublishingOptions This resolves the following warning from Android Gradle Plugin 7.2.2 and helps unblock the upgrade to AGP 8.0.1: > Software Components will not be created automatically for Maven > publishing from Android Gradle Plugin 8.0. To opt-in to the future > behavior, set the Gradle property > `android.disableAutomaticComponentCreation=true` in the > `gradle.properties` file or use the new publishing DSL. > > Affected Modules: `lib-cast`, `lib-common`, `lib-container`, > `lib-database`, `lib-datasource`, `lib-datasource-cronet`, > `lib-datasource-okhttp`, `lib-datasource-rtmp`, `lib-decoder`, > `lib-effect`, `lib-exoplayer`, `lib-exoplayer-all (legacy)`, > `lib-exoplayer-dash`, `lib-exoplayer-hls`, `lib-exoplayer-ima`, > `lib-exoplayer-rtsp`, `lib-exoplayer-smoothstreaming`, > `lib-exoplayer-workmanager`, `lib-extractor`, `lib-media2 (legacy)`, > `lib-mediasession (legacy)`, `lib-muxer`, `lib-session`, > `lib-transformer`, `lib-ui`, `lib-ui-leanback`, `test-utils`, > `test-utils-robolectric` Issue: androidx#409 PiperOrigin-RevId: 533464133
This change was auto-generated by the Android Studio Upgrade Assistant. Issue: androidx#409 PiperOrigin-RevId: 533467455
Hello,
I have Android Studio Flamingo 2022.2.1 Patch 1, Gradle version 7.5, AGP 7.4. If I open Androidx media 1.0.1 project and run configuration Demo - it works correctly.
The Studio offered changes in namespace in effect and extractor libraries for androidTest. I deleted the namespace parameter in lib-effect - AndroidManifest.xml (androidTest) and writed text "namespace androidx.media3.effect" in android { ... } section into builde.gradle (Module :lib-effect). I did the same for extractor library. It works correctly too.
Now AGP Upgrade Assistant offeres upgrade project's Android Gradle Plugin from 7.4.2 to 8.0.1. But during upgrading there is the error Sync Failed. The error message from sync is:
`Namespace not specified. Please specify a namespace in the module's build.gradle file like so:
android {
namespace 'com.example.namespace'
}
How do I upgrade succesfully? Is there any bug in AGP 8.0.1? I would like use new Androidx Exoplayer 1.0.1, not older version ExoPlayer v 2.
Thank you for you replay.
The text was updated successfully, but these errors were encountered: