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

Remove the manifest hack #399

Merged
merged 3 commits into from
Jun 29, 2022
Merged

Conversation

PaulWoitaschek
Copy link
Contributor

Fixes #395

I actually could not make any sense of why the original hack was in place at all.

@PaulWoitaschek PaulWoitaschek requested a review from a team as a code owner June 28, 2022 11:13
contract: ActivityResultContract<I, O>,
input: I,
options: ActivityOptionsCompat?
) {

Check warning

Code scanning / detekt

Empty block of code detected. As they serve no purpose they should be removed.

This empty block of code can be removed.
contract: ActivityResultContract<I, O>,
input: I,
options: ActivityOptionsCompat?
) {

Check warning

Code scanning / detekt

Empty block of code detected. As they serve no purpose they should be removed.

This empty block of code can be removed.
Copy link
Member

@Canato Canato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks to doing this, will need to test later when I got the time.

Which Devices and Android OSs did you tested so I can increase the range?
@PaulWoitaschek

@Canato Canato self-assigned this Jun 28, 2022
@PaulWoitaschek
Copy link
Contributor Author

Thanks to doing this, will need to test later when I got the time.

Which Devices and Android OSs did you tested so I can increase the range? @PaulWoitaschek

What do you mean by that? This PR only removes a workaround that - when I understand correctly - caused the build stage to fail.

@Canato
Copy link
Member

Canato commented Jun 28, 2022

What do you mean by that? This PR only removes a workaround that - when I understand correctly - caused the build stage to fail.

But did you test the sample app on Android 11 and 12 on some devices? Is always good to check if this is working before we ship.

@PaulWoitaschek
Copy link
Contributor Author

PaulWoitaschek commented Jun 28, 2022

Yes I did now (Android 12). But anyways, I do not see anyhow how this can affect the runtime code.

Copy link
Contributor

@vanniktech vanniktech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this hack added in the first place? I never understood it myself

@Canato
Copy link
Member

Canato commented Jun 28, 2022

Why was this hack added in the first place? I never understood it myself

This was done when updating Update gradle 7.0 and Java 11 and Update Android 12 (SDK 31)

On Android 12 we need the android:exported value for Activities and some libraries won't have it, causing issues when we compile the code and merge the Manifests

  • androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity
  • androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity
  • androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity

@vanniktech
Copy link
Contributor

OKay but then isn't the solution now to update to the newest version of androidx.test.core. Also it seems like only instrumentation tests are affected

@PaulWoitaschek
Copy link
Contributor Author

But these are test only dependencies 🤔

@PaulWoitaschek
Copy link
Contributor Author

Also it seems like only instrumentation tests are affected

Am I blind? (On mobile currently). I don't see any?

@vanniktech
Copy link
Contributor

But these are test only dependencies 🤔

Exactly what I'm saying: instrumentation tests

@PaulWoitaschek
Copy link
Contributor Author

That was referring to the message above, our messages arrived at the same second.

Copy link
Member

@Canato Canato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning this

@Canato Canato merged commit 2f867e9 into CanHub:main Jun 29, 2022
@ahmednawaz22
Copy link

@Canato
AndroidManifest.xml:49:13-49 Error:
Attribute activity#androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity@theme value=(@android:style/Theme) from [com.github.CanHub:Android-Image-Cropper:4.3.0] AndroidManifest.xml:49:13-49
is also present at [androidx.test:core:1.0.0] AndroidManifest.xml:29:13-84 value=(@style/InstrumentationActivityInvokerEmptyActivityTheme).
Suggestion: add 'tools:replace="android:theme"' to element at AndroidManifest.xml:46:9-53:20 to override.
/app/src/main/AndroidManifest.xml:57:13-56 Error:
Attribute activity#androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity@theme value=(@android:style/Theme.Dialog) from [com.github.CanHub:Android-Image-Cropper:4.3.0] AndroidManifest.xml:57:13-56
is also present at [androidx.test:core:1.0.0] AndroidManifest.xml:36:13-87 value=(@style/InstrumentationActivityInvokerFloatingActivityTheme).
Suggestion: add 'tools:replace="android:theme"' to element at AndroidManifest.xml:54:9-61:20 to override.

@PaulWoitaschek
Copy link
Contributor Author

I think it's the other way around. That commit was released as 4.3.1 and you are using older versions (4.2 and 4.3)

@ahmednawaz22
Copy link

@PaulWoitaschek Thanks!!
after upgrading 'com.github.CanHub:Android-Image-Cropper:4.3.2' , still I can't build app and build execution failed with these errors:
/app/src/main/AndroidManifest.xml:27:9-33:20 Error:
android:exported needs to be explicitly specified for element <activity#androidx.test.core.app.InstrumentationActivityInvoker$EmptyActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
/app/src/main/AndroidManifest.xml:34:9-40:20 Error:
android:exported needs to be explicitly specified for element <activity#androidx.test.core.app.InstrumentationActivityInvoker$EmptyFloatingActivity>. Apps targeting Android 12 and higher are required to specify an explicit value for android:exported when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

@PaulWoitaschek
Copy link
Contributor Author

Now that doesn't seem image cropper related. Looks like you should update your android test dependency

@ahmednawaz22
Copy link

ahmednawaz22 commented Sep 28, 2022

thanks @PaulWoitaschek
issue was in manifest file of jetifier-core-1.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove manifest overwrites
4 participants