Fixed
Status Update
Comments
ly...@gmail.com <ly...@gmail.com> #2
To give more color to this, every android related library or framework that I use is initialized by passing it a Context. This allows me to have a ContentProvider where I can do all my initialization. The benefits of this are:
1. Abstraction - my app module doesn't need to know about anything other than my internal modules and doesn't interface directly with libraries
2. An Application is built for each process, which means that we now have a CameraXConfig.Provider for secondary processes like a crash reporting process, etc... ContentProvider is only created once across all processes (and can be set to create one per process for apps that need to configure the camera across multiple processes, which I'm positive are very rare)
TL;DR the recent trend has been to move away from Application as a source of configuration for a variety of benefits
1. Abstraction - my app module doesn't need to know about anything other than my internal modules and doesn't interface directly with libraries
2. An Application is built for each process, which means that we now have a CameraXConfig.Provider for secondary processes like a crash reporting process, etc... ContentProvider is only created once across all processes (and can be set to create one per process for apps that need to configure the camera across multiple processes, which I'm positive are very rare)
TL;DR the recent trend has been to move away from Application as a source of configuration for a variety of benefits
xo...@google.com <xo...@google.com>
je...@google.com <je...@google.com>
am...@google.com <am...@google.com> #3
Thank you for the feedback, we'll take a look and assess.
am...@google.com <am...@google.com> #4
Bugjuggler:
ly...@gmail.com <ly...@gmail.com> #5
Hi. I've received your bug and will wait for b/146071458 to be fixed and then assign the bug to trevormcguire@google.com.
je...@google.com <je...@google.com> #6
I also have a similar problem. I am using CameraX to build an Android library. So as a library developer, I have little access to the Application class and I cannot tell the consumers of my library to implement CameraXConfig.Provider. Really this is a bad API design and there should be an alternative ASAP. I am currently stuck at this point.
cm...@google.com <cm...@google.com>
am...@google.com <am...@google.com> #7
Hi there,
We're actively looking at this and will provide another method to initialize.
cm...@google.com <cm...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 9015f3cff4053ad56b8b34b0708e3fe13945187c
Author: Trevor McGuire <trevormcguire@google.com>
Date: Thu Dec 05 18:21:19 2019
CameraX on-demand initialization through resources
Allows initializing CameraX without having to extend Application. A
default config provider can be specified through string resource or by
extending Application.
camera:camera-camera2 provides a default string resource which will be
included by default by the resource merger so users don't need to do
anything if they are ok with the default configuration.
Relnote: "Removed requirement that app must extend Application in order
to initialize CameraX. CameraX will now be initialized with a default
Camera2 configuration as long as the camera-camera2 artifact is included
in the application's build.gradle."
Bug: 146923574
Test: Integration tests are all successfully initialized and run
Change-Id: I58ff5c4440f9fec0afb3d9790f652dd91c2c84bd
A camera/camera-camera2/proguard-rules.pro
M camera/camera-camera2/src/main/AndroidManifest.xml
M camera/camera-camera2/src/main/java/androidx/camera/camera2/Camera2Config.java
A camera/camera-camera2/src/main/res/values/strings.xml
M camera/camera-core/src/main/java/androidx/camera/core/CameraX.java
A camera/camera-core/src/main/res/values/public.xml
A camera/camera-core/src/main/res/values/strings.xml
M camera/integration-tests/coretestapp/src/main/AndroidManifest.xml
D camera/integration-tests/coretestapp/src/main/java/androidx/camera/integration/core/CoreApplication.java
M camera/integration-tests/extensionstestapp/src/main/java/androidx/camera/integration/extensions/ExtensionsApplication.java
M camera/integration-tests/viewtestapp/src/main/AndroidManifest.xml
M camera/integration-tests/viewtestapp/src/main/java/androidx/camera/integration/view/ViewCameraXConfigProvider.java
M camera/integration-tests/viewtestapp/src/main/res/values/strings.xml
https://android-review.googlesource.com/1183436
Branch: androidx-master-dev
commit 9015f3cff4053ad56b8b34b0708e3fe13945187c
Author: Trevor McGuire <trevormcguire@google.com>
Date: Thu Dec 05 18:21:19 2019
CameraX on-demand initialization through resources
Allows initializing CameraX without having to extend Application. A
default config provider can be specified through string resource or by
extending Application.
camera:camera-camera2 provides a default string resource which will be
included by default by the resource merger so users don't need to do
anything if they are ok with the default configuration.
Relnote: "Removed requirement that app must extend Application in order
to initialize CameraX. CameraX will now be initialized with a default
Camera2 configuration as long as the camera-camera2 artifact is included
in the application's build.gradle."
Bug: 146923574
Test: Integration tests are all successfully initialized and run
Change-Id: I58ff5c4440f9fec0afb3d9790f652dd91c2c84bd
A camera/camera-camera2/proguard-rules.pro
M camera/camera-camera2/src/main/AndroidManifest.xml
M camera/camera-camera2/src/main/java/androidx/camera/camera2/Camera2Config.java
A camera/camera-camera2/src/main/res/values/strings.xml
M camera/camera-core/src/main/java/androidx/camera/core/CameraX.java
A camera/camera-core/src/main/res/values/public.xml
A camera/camera-core/src/main/res/values/strings.xml
M camera/integration-tests/coretestapp/src/main/AndroidManifest.xml
D camera/integration-tests/coretestapp/src/main/java/androidx/camera/integration/core/CoreApplication.java
M camera/integration-tests/extensionstestapp/src/main/java/androidx/camera/integration/extensions/ExtensionsApplication.java
M camera/integration-tests/viewtestapp/src/main/AndroidManifest.xml
M camera/integration-tests/viewtestapp/src/main/java/androidx/camera/integration/view/ViewCameraXConfigProvider.java
M camera/integration-tests/viewtestapp/src/main/res/values/strings.xml
sp...@google.com <sp...@google.com> #9
Hi All,
This is merged and will be available in the next release. Please take a look and let us know what you think. Thanks.
xa...@google.com <xa...@google.com> #10
Is this in alpha-09 or will it be in the next one?
cm...@google.com <cm...@google.com> #11
re:
ry...@gmail.com <ry...@gmail.com> #12
I notices this issue now.
Well.. I also think this behavior is not so good.
What happens, if we want to use camerax in dynamic features module?
Is this really acceptable?
Rather, initialization using ContentProvider looks better.
Please re-consider on-demand initialization more. 🙇♂️
Well.. I also think this behavior is not so good.
What happens, if we want to use camerax in dynamic features module?
Is this really acceptable?
Rather, initialization using ContentProvider looks better.
Please re-consider on-demand initialization more. 🙇♂️
Description
DESCRIBE THE ISSUE IN DETAIL: Assume we have one module A, that declares permission with manifest placeholder:
Also we have another module B that have dependency on module A. This module has some unit tests and enabled
android.testOptions.unitTests.includeAndroidResources = true
inbuild.gradle
. To run unit tests I need to declare manifest placeholder for test variants in module B inbuild.gradle
:When I'm trying to run unit tests in module B I'm getting the error:
But it works correctly with AGP 7.3.1.
Sample project to reproduce:https://github.com/bacecek/sample-checking-assistant-role/tree/broken-test-manifest-placeholders
Studio Build: Android Studio Electric Eel | 2022.1.1. Build #AI-221.6008.13.2211.9477386, built on January 11, 202 Version of Gradle Plugin: 7.4.0 Version of Gradle: 7.5.1 Version of Java: Temurin 17.0.5 OS: macOS 13.1