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

Consolidate Android manifest #85

Open
hippogamesunity opened this issue Aug 5, 2021 · 17 comments
Open

Consolidate Android manifest #85

hippogamesunity opened this issue Aug 5, 2021 · 17 comments

Comments

@hippogamesunity
Copy link

hippogamesunity commented Aug 5, 2021

Find a way to supply plugin-specific config for Android manifest (appAuthRedirectScheme), that would merge with user-supplied manifest/config


Hi! I had to enable multidex in my project (this article was used https://habr.com/ru/post/487336/), but still can't build on Android.
Manifest merger failed : Attribute data@scheme at AndroidManifest.xml requires a placeholder substitution but no value for <appAuthRedirectScheme> is provided.
I was trying to find a solution on web, but with no luck. Adding
manifestPlaceholders = [appAuthRedirectScheme: 'com.redirectScheme.comm']
to mainTemplate.gradle doesn't help. At the same time, I can build my project with multidex enabled after removing UGD (but this is not an option for me actually).

Also I've found that some people also mentioned UGD related to appAuthRedirectScheme issue here:
https://forum.unity.com/threads/gradle-nightmare-appauthredirectscheme.831934/

Hope to find a solution soon...

@hippogamesunity
Copy link
Author

hippogamesunity commented Aug 5, 2021

Some Unity guy said
You could modify the template in the Unity install directory, but that is not supported and it will affect all of your projects built with that Unity version.
(https://forum.unity.com/threads/cant-build-with-multidex-enabled.773348/).

I was trying to modify all .gradle files inside Unity installation folder one by one and have found a possible solution:

  • open Editor\Data\PlaybackEngines\AndroidPlayer\Tools\GradleTemplates\launcherTemplate.gradle
  • add manifestPlaceholders = [appAuthRedirectScheme: 'com.redirectScheme.comm'] to defaultConfig

This is a bad solution, but at least I was able to build, although it works only for ARMv7 and crashes on app start for ARM64. Also I wonder why modifying mainTemplate.gradle (generated inside your project after enabling Custom Main Gradle Templage option) doesn't do the trick.

@github-actions
Copy link

github-actions bot commented Dec 5, 2021

This issue is stale because it has been open 14 days with no activity. It will be automatically closed in 7 days.

@dustinkerstein
Copy link

@hippogamesunity I had to use that same workaround. Nothing else I tried got my Android build working on Unity 2021.3.3f1.

@ROBYER1
Copy link

ROBYER1 commented Jul 12, 2022

Why is this closed if there isn't a fix in the plugin? There must be some other way to work around this in the package itself?

@PhucDev02
Copy link

PhucDev02 commented Jun 8, 2023

The way of @hippogamesunity works.
But I need a solution for ARM64,because ARM64 is required for upload AAB file to Google Play Store

@fmbnicola
Copy link

fmbnicola commented Jul 9, 2023

Same issue here, but I haven't enabled multidex on my project...
Adding the line to Editor\Data\PlaybackEngines\AndroidPlayer\Tools\GradleTemplates\launcherTemplate.gradle works even for ARM64. Adding it to the custom main gradle template did not work :(
Has anybody had any luck fixing this issue?

@tatelax
Copy link

tatelax commented Oct 31, 2023

@elringus This issue still exists and hippo's solution works. Closing issues simply because there was no activity for 2 weeks is not a great idea.

@elringus
Copy link
Owner

@tatelax Feel free to send a PR to fix the issue, I'll review it.

@Abbabon
Copy link

Abbabon commented Oct 31, 2023

Why is this closed if there isn't a fix in the plugin? There must be some other way to work around this in the package itself?

the 'culture' in this repo is to request a PR to fix the issue and then close the issue... very common these days unfortunately (github should really add this as a state)

@elringus
Copy link
Owner

@AmitWhalo @Abbabon The issues are closed automatically when no activity is detected in a set period of time. It's not like I'm closing them manually.

The 'culture' of many github users is, unfortunately, to treat open-source repos as a product they own and assume they're entitled for tech support just because they're using it. Please don't forget we're sharing the code and maintaining it just out of our good will.

@MattLichter
Copy link
Contributor

Why is this closed if there isn't a fix in the plugin? There must be some other way to work around this in the package itself?

the 'culture' in this repo is to request a PR to fix the issue and then close the issue... very common these days unfortunately (github should really add this as a state)

Nothing unfortunate about it in the slightest. This software is free in every sense of the word. Nobody is entitled to support from anybody.

@Abbabon
Copy link

Abbabon commented Oct 31, 2023

@MattLichter @elringus

> > > Why is this closed if there isn't a fix in the plugin? There must be some other way to work around this in the package itself?

the 'culture' in this repo is to request a PR to fix the issue and then close the issue... very common these days unfortunately (github should really add this as a state)

Nothing unfortunate about it in the slightest. This software is free in every sense of the word. Nobody is entitled to support from anybody.

I'm sorry if I've touched an exposed nerve here - but the actual issue, as a bug in the software is not closed. The repo's state does not reflect the state of the said free software.

@elringus
Copy link
Owner

but the actual issue, as a bug in the software

I'm not even sure the issue is caused by the plugin. Looks like something android/unity-related.

@tatelax
Copy link

tatelax commented Oct 31, 2023

I'm only suggesting that just because an issue hasn't had replies for some period of time doesn't mean it's been resolved. Closing issues makes it harder for people to find solutions.

The fix for this might just be updating the readme to mention that you need to modify a file in your editor install to resolve issues on Android.

@amoffatt
Copy link

amoffatt commented Jan 23, 2024

Expanding on @hippogamesunity's work around:

To avoid editing the Unity installation's gradle files, you can also use a custom launcherTemplate.gradle in your project, and apply the change to it. Enable:

Project Settings -> Player -> Android settings -> Publishing Settings -> Custom Launcher Gradle Template

Then in your project's Assets/Plugins/Android/launcherTemplate.gradle file, within the defaultConfig { } section, add the line:

manifestPlaceholders = [appAuthRedirectScheme: 'com.mydomain.myapp']

This 'com.mydomain.myapp' value is the URL scheme you want to use to launch your app via url, the same as Unity Deep Linking. I don't understand why UnityGoogleDrive uses a different method of setting this scheme than is described in Unity's Deep Linking API, but this workaround should fix the build error.

Repository owner deleted a comment from hippogamesunity Jan 23, 2024
@elringus
Copy link
Owner

why UnityGoogleDrive uses a different method of setting this scheme than is described in Unity's Deep Linking

Because Unity Deep Linking was added in Unity 2021, while the plugin was initially released for Unity 5, and the current min. supported version (the one I'm personally using) is 2019.

@elringus elringus changed the title Can't build UGD with multidex Consolidate Android manifest Jan 23, 2024
@elringus elringus added enhancement and removed bug labels Jan 23, 2024
@Orlokun
Copy link

Orlokun commented Apr 5, 2024

@amoffatt This solution worked in my case. Thanks a lot!

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

No branches or pull requests