-
Notifications
You must be signed in to change notification settings - Fork 128
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
Dependency change needs Android O? #783
Comments
Hi @slowcar microsoft-graph-core used to have a dependency on azure-identity that was replaced by azure-core. This change shipped with version 2.0.2. We've made that change as graph core was not using anything from azure identity, only from azure core. Making the overall total weight smaller for people not leveraging azure identity as the authentication provider. Azure-identity has always had a dependency on azure-core. So effectively, unless your application was previously excluding azure identity or azure core, it always had azure core as an upstream dependency. What could have happened is either:
Since version 3.X the required API level has always been 26. As far as I can remember this level was mostly required by upstream dependencies like the azure ones. It's fine for you to exclude that dependency as long as your application is not using the token credentials auth provider. Hopefully this provides clarity on the API level requirement and what could potentially have changed. Let us know if you have any further question. |
Thank you for the quick reply. I am not sure what exactly triggered the build issue, just that we located it in the azure-core and "resolved" it by removing the dependency. We don't use the token auth provider, we already have msal handling the authentication and use that. Regarding the minSDK, your readme states "Android developers targeting lower android API levels can do so by enabling desugaring in their project.", which we did, so i wondered what exactly could have changed. |
You're welcome! I'm not sure what triggered the change for your application either but I wanted to list out the different things that could have. As I understand your question is answered, I'm going to go ahead and close this issue. |
Desugaring doesn't work in my case. Graph Core v2 uses |
would using a package like android-retrofuture bring compatibility for your project? |
No, I've tried it but with no luck. android-retrofuture offers |
Oh so the references are broken. Interesting I thought they'd have used the same package name to offer a drop in replacement. Assembly redirect in dotnet doesn't seem to have an equivalent in Java /android ecosystems unfortunately. The alternative would be to find another package that backports futures, on the same package name. An equivalent to polyfill in JavaScript. |
Copying and re-positioning retrofuture might work, I would have a try some day. Is is possible to avoid using CompletableFuture in Graph Core library? |
The completableFuture usage is only at a dozen places or so in core today, so it might be feasible to do without. However the service library (this repo) depends on it at thousands of places, which makes things a bit trickier. |
@baywet I've added the comment to that issue. |
Readme should be changed since it is misleading: "Android developers targeting lower android API levels can do so by enabling desugaring in their project.". It does not work. |
Thanks for the feedback everyone. We're still trying to find a definitive answer to android API level < 26. But we can update the documentation in the meantime. I've logged #872 to tackle that. |
Without changing the library version, our build broke, and it looks like a depenency was changed, and now requires Android 0 (SDK 26)
This is the error we get:
com.android.tools.r8.a: MethodHandle.invoke and MethodHandle.invokeExact are only supported starting with Android O (--min-api 26)
The dependency graph lists
+--- com.microsoft.graph:microsoft-graph:3.5.0
| +--- com.google.code.gson:gson:2.8.6
| --- com.microsoft.graph:microsoft-graph-core:2.0.2
| +--- com.squareup.okhttp3:okhttp:4.9.1 (*)
| --- com.azure:azure-core:1.16.0
We are currently on minSDK 21 for our app and use desugaring, as suggested in your description.
When we exclude azure-core, we can build the library:
implementation ('com.microsoft.graph:microsoft-graph:3.6.0') {
exclude group: 'com.azure', module: 'azure-core'
}
It looks like everything is working, but i'd rather ask if we can skip this dependency.
It's a bit strange, that the SDK requirement changed without any warning. Our CI built the branch successfully yesterday (31.05. at 13:16 CEST)
AB#9657
The text was updated successfully, but these errors were encountered: