Recently updated our project to 2018.4.17. My partner, on Windows, is able to build the project to Android without issue. I am unable to, however. As far as I can tell, all our project settings should be exactly the same, and we’re using the same version of the Android SDK / JDK / NDK.
This is the error I’m getting:
I have NO IDEA what this means, or how to fix it. The little bit I’ve been able to find online about it suggests editing the build.gradle, but we both have “Custom Gradle Template” unchecked, so as far as I’m aware, Unity is auto-generating that for us.
I don’t even really know how to start troubleshooting this, much less what I need to do to fix it. The fact that one of us is able to build fine is also confusing.
@JuliusM hello, I’m the mentioned partner.
After some further digging, we discovered something strange.
I was able to build successfully, but @greay was not, and the key difference was that he had just locally removed the UnityGoogleDrive implementation from our project. I found that if I also removed the UnityGoogleDrive implementation I would now also get the same error. The UGD implementation is fairly isolated and keeps to its own folder fairly well, but now it seems it was, possibly, somehow compensating for this?
Anyways I dug around a lot for any possible AndroidManifest or gradle conflicts to no avail.
So I literally just tried utilizing the unity Custom Gradle Template and added the line: manifestPlaceholders = ['appAuthRedirectScheme': 'YOURSCHEME']
to the defaultConfig {} section. I didn’t even bother to rename YOURSCHEME, as I don’t understand what this is on about.
After doing that, it builds fine and I’m quite baffled. Even with the dummy name.
Is there a way to resolve this without having to do this weird custom gradle template hack? I have a bad feeling it easily backfire on us in the future.
I don’t know how UnityGoogleDrive plugin works or how it was integrated in your project, but if this issue is really caused by this plugin (you can double check that with a new empty project, just importing the plugin and then removing it), then the plugin likely has modified (or required you to modify) the manifest file. There must be a “${appAuthRedirectScheme}” variable in one of your manifests (either the main one or one provided by the plugin). This variable in the manifest is replaced by the value specified in your gradle template. If a plugin needs that value, then obviously it will not work. The only question is if this value was added by UnityGoogleDrive plugin or not. If it was added by the UGD plugin and you don’t want to use this plugin, you could simply remove that value from your manifest. Then you will not need to specify it in gradle template either. You can read more about variables in the manifest here https://developer.android.com/studio/build/manifest-build-variables
That’s sort of the bonkers thing. I’ve dug through our AndroidManifest.xml (and any other possible ones that might have been included) and there is no appAuthRedirectScheme variable present anywhere. There’s nothing obvious calling to Unity Google Drive at this point either. AFAIK we’ve removed UGD completely.
However we have noticed when we removed UGD, that included removing Dependencies.xml (that was in the UGD folder), which I’m guessing might have been what was preventing the error?
This is the contents of of it, which mentions AppAuth.
Hi! I was able to workaround this by adding
manifestPlaceholders = [appAuthRedirectScheme: ‘com.redirectScheme.comm’]
to Editor\Data\PlaybackEngines\AndroidPlayer\Tools\GradleTemplates\launcherTemplate.gradle