Giter VIP home page Giter VIP logo

microsoftgraph / android-java-snippets-sample Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 16.0 414 KB

Code snippets that use the Microsoft Graph to perform common tasks, such as sending email or managing groups, from within an Android app. This sample uses the Microsoft Graph Client Library to work with the data, and the Microsoft Authentication Library (MSAL) for authentication of users' work or school Office 365 accounts and personal accounts.

License: MIT License

Java 99.32% Batchfile 0.35% Shell 0.32%
devxsample

android-java-snippets-sample's People

Contributors

iambmelt avatar jasonjoh avatar nokafor avatar officegsx avatar ricalo avatar titusgicheru avatar v-dobr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-java-snippets-sample's Issues

404 Error for Events Snippets

All of the snippets for groups run without errors, however, whenever I try to run any of the events snippets, this error is returned:

"GET https://graph.microsoft.com/v1.0/me/events
SdkVersion: graph-android-v1.1.0
Authorization: Bearer
eyJ0eXAiOiJKV1QiLCJub25jZSl[...]
SampleID: android-java-snippets-sample

404: Not Found
[...]

[Some information was truncated for brevity, enable debug logging for more details]"

I'm not sure why the group snippets would work but these wouldn't, it's probably a configuration issue on my end or something like that. I'm fairly new to this sort of stuff so thanks for the patience (for what's probably a trivial problem) and let me know if I need to post more information.

'Download a file under root' throws NoClassDefFoundError

It appears that DrivesSnippets.java#L183 is using a transitive guava dependency off of the test classpath causing runtime errors in non-test scenarios (Device/emulator deployments)

07-12 16:58:08.464 13503-13503/com.microsoft.graph.snippets D/AndroidRuntime: Shutting down VM
07-12 16:58:08.474 13503-13503/com.microsoft.graph.snippets E/AndroidRuntime: FATAL EXCEPTION: main
                                                                              Process: com.microsoft.graph.snippets, PID: 13503
                                                                              java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/common/io/CharStreams;
                                                                                  at com.microsoft.graph.snippets.snippet.DrivesSnippets$5$1$1.success(DrivesSnippets.java:183)
                                                                                  at com.microsoft.graph.snippets.snippet.DrivesSnippets$5$1$1.success(DrivesSnippets.java:177)
                                                                                  at com.microsoft.graph.concurrency.DefaultExecutors$1.run(DefaultExecutors.java:88)
                                                                                  at com.microsoft.graph.concurrency.SynchronousExecutor$1.onPostExecute(SynchronousExecutor.java:53)
                                                                                  at com.microsoft.graph.concurrency.SynchronousExecutor$1.onPostExecute(SynchronousExecutor.java:45)
                                                                                  at android.os.AsyncTask.finish(AsyncTask.java:632)
                                                                                  at android.os.AsyncTask.access$600(AsyncTask.java:177)
                                                                                  at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
                                                                                  at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                  at android.os.Looper.loop(Looper.java:145)
                                                                                  at android.app.ActivityThread.main(ActivityThread.java:5942)
                                                                                  at java.lang.reflect.Method.invoke(Native Method)
                                                                                  at java.lang.reflect.Method.invoke(Method.java:372)
                                                                                  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
                                                                                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
                                                                               Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.common.io.CharStreams" on path: DexPathList[[dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-support-annotations-23.4.0_0578f1eede481b4125c9f914e349e34d2cb9d5b9-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_9-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_8-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_7-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_6-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_5-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_4-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_3-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_2-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_1-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_0-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-joda-time-2.7_9dcfa9905f3edf50b4fd840ba123cb0c6035c5fd-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-javax.inject-1_a94ccfb8d13042944448ddf204c81168ea46be9b-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-internal_impl-24.0.0_a443701a0e1dcb3e24317e5c9e8738471c2f58b9-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-gson-2.3.1_2a1d8361cfd6c9e9c885b7cc966287ab0c90799c-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-dagger-1.2.2_13c654c5ab765eaa5bb09b92f0011a387fb4c303-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-com.microsoft.graph-msgraph-sdk-android-0.9.2_fbfa32d6b84186c794373fbe346710b815a2f6d4-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-com.microsoft.aad-adal-1.2.0_488cef6af937749ec39329dfc5c99d5543178f4e-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-com.android.support-support-vector-drawable-23.3.0_6790e4efe9321e001acafd70302e29c6e39991ee-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-com.android.support-support-v4-24.0.0_5aa9594475785f1d18af6c4a87f6eaa349d745c2-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-com.android.support-appcomp
07-12 16:58:08.474 13503-13503/com.microsoft.graph.snippets D/Error: ERR: exClass=java.lang.ClassNotFoundException
07-12 16:58:08.474 13503-13503/com.microsoft.graph.snippets D/Error: ERR: exMsg=Didn't find class "com.google.common.io.CharStreams" on path: DexPathList[[dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-support-annotations-23.4.0_0578f1eede481b4125c9f914e349e34d2cb9d5b9-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_9-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_8-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_7-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_6-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_5-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_4-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_3-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_2-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_1-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_0-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-joda-time-2.7_9dcfa9905f3edf50b4fd840ba123cb0c6035c5fd-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-javax.inject-1_a94ccfb8d13042944448ddf204c81168ea46be9b-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-internal_impl-24.0.0_a443701a0e1dcb3e24317e5c9e8738471c2f58b9-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-gson-2.3.1_2a1d8361cfd6c9e9c885b7cc966287ab0c90799c-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-dagger-1.2.2_13c654c5ab765eaa5bb09b92f0011a387fb4c303-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-com.microsoft.graph-msgraph-sdk-android-0.9.2_fbfa32d6b84186c794373fbe346710b815a2f6d4-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-com.microsoft.aad-adal-1.2.0_488cef6af937749ec39329dfc5c99d5543178f4e-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-com.android.support-support-vector-drawable-23.3.0_6790e4efe9321e001acafd70302e29c6e39991ee-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-com.android.support-support-v4-24.0.0_5aa9594475785f1d18af6c4a87f6eaa349d745c2-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-com.android.support-appcompat-v7-23.3.0_200ac3e2251c4b09b92858a98fff48d7a2159be8-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-com.android.support-animated-vector-drawable-23.3.0_c44ff839119e699260294ff6bf0838b1cf0671e1-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-butterknife-6.1.0_14ec7cfe6216b00c529ea8f9e6821daa6d97fade-classes.dex"],nativeLibraryDirectories=[/vendor/lib, /system/lib, /vendor/lib, /system/lib]]
07-12 16:58:08.474 13503-13503/com.microsoft.graph.snippets D/Error: ERR: file=BaseDexClassLoader.java
07-12 16:58:08.474 13503-13503/com.microsoft.graph.snippets D/Error: ERR: class=dalvik.system.BaseDexClassLoader
07-12 16:58:08.474 13503-13503/com.microsoft.graph.snippets D/Error: ERR: method=findClass line=56
07-12 16:58:08.484 13503-13503/com.microsoft.graph.snippets D/Error: ERR: stack=java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/common/io/CharStreams;
                                                                         at com.microsoft.graph.snippets.snippet.DrivesSnippets$5$1$1.success(DrivesSnippets.java:183)
                                                                         at com.microsoft.graph.snippets.snippet.DrivesSnippets$5$1$1.success(DrivesSnippets.java:177)
                                                                         at com.microsoft.graph.concurrency.DefaultExecutors$1.run(DefaultExecutors.java:88)
                                                                         at com.microsoft.graph.concurrency.SynchronousExecutor$1.onPostExecute(SynchronousExecutor.java:53)
                                                                         at com.microsoft.graph.concurrency.SynchronousExecutor$1.onPostExecute(SynchronousExecutor.java:45)
                                                                         at android.os.AsyncTask.finish(AsyncTask.java:632)
                                                                         at android.os.AsyncTask.access$600(AsyncTask.java:177)
                                                                         at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
                                                                         at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                         at android.os.Looper.loop(Looper.java:145)
                                                                         at android.app.ActivityThread.main(ActivityThread.java:5942)
                                                                         at java.lang.reflect.Method.invoke(Native Method)
                                                                         at java.lang.reflect.Method.invoke(Method.java:372)
                                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
                                                                      Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.common.io.CharStreams" on path: DexPathList[[dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-support-annotations-23.4.0_0578f1eede481b4125c9f914e349e34d2cb9d5b9-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_9-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_8-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_7-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_6-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_5-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_4-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_3-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_2-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_1-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-slice_0-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-joda-time-2.7_9dcfa9905f3edf50b4fd840ba123cb0c6035c5fd-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-javax.inject-1_a94ccfb8d13042944448ddf204c81168ea46be9b-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-internal_impl-24.0.0_a443701a0e1dcb3e24317e5c9e8738471c2f58b9-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-gson-2.3.1_2a1d8361cfd6c9e9c885b7cc966287ab0c90799c-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-dagger-1.2.2_13c654c5ab765eaa5bb09b92f0011a387fb4c303-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-com.microsoft.graph-msgraph-sdk-android-0.9.2_fbfa32d6b84186c794373fbe346710b815a2f6d4-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-com.microsoft.aad-adal-1.2.0_488cef6af937749ec39329dfc5c99d5543178f4e-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-com.android.support-support-vector-drawable-23.3.0_6790e4efe9321e001acafd70302e29c6e39991ee-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-com.android.support-support-v4-24.0.0_5aa9594475785f1d18af6c4a87f6eaa349d745c2-classes.dex", dex file "/data/data/com.microsoft.graph.snippets/files/instant-run/dex/slice-com.android.support-appcompat-v7-23.3.0_200ac3e2251c4b09b92858a98fff48d7a2159be8-classes.dex", de

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.