Skip to content

Conversation

@IoannisFMG
Copy link

@IoannisFMG IoannisFMG commented Nov 13, 2023

Thanks for proposing a pull request!

To help us review the request, please complete the following:

  • sign contributor license agreement
  • I've ensured that all existing tests pass and added tests (when/where necessary)
  • I've updated the documentation (when/where necessary) and Changelog (when/where necessary)
  • I've added the proper label to this pull request (e.g. bug for bug fixes)

Pull Request Details

In fresh Unity installations the AndroidSdkRoot editor pref is not set. They rather default to the tools installed with the editor (SdkUseEmbedded set to true).

Before the fix, we were unable to build unless a correct SDK path was explicitly set, even if the SdkUseEmbedded option was enabled.

By checking the SdkUseEmbedded boolean first we can mitigate the problem.

The code can be further optimized by getting the set AndroidSdkRoot in an else statement, but I don't know if that's within the scope of this fix.

Test Plan

Test Plan: Add your test plan here

  1. Add a non Android SDK path as an Android SDK location in Editor's external tools.
  2. Check "Android SDK Tools installed with Unity (recommended)"
  3. Try to create a build.
  4. The build will stop, failing to find the embedded Android SDK path since it checks for a null or an empty string first.

In fresh Unity installations the `AndroidSdkRoot` editor pref is not set. They rather default to `SdkUseEmbedded` set to true.

Before the fix, we were unable to build unless an SDK path was explicitly set, even if the "Use Embedded SDK" option was enabled. 

Facebook SDK was not allowing to export a project without an Android SDK Root path explicitly set.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants