Search code examples
pythoneclipsegoogle-app-enginegoogle-cloud-endpointsendpoints-proto-datastore

Android Studio: IncorrectOperationException when 'Add as Library' is clicked whilst trying to configure Google Apps Endpoints client libraries


I am trying to generate and use the android client libraries for a Python google app engine project following this guide https://developers.google.com/appengine/docs/python/endpoints/consume_android

Everytime I get to this step

Select the library you just added, right-click, then select Add As Library to your project.

I get the following exception:

IncorrectOperationException: Must not change document outside command or undo-transparent action.

I'm new to Android Studio but can't seem to find any resources on how to get endpoints client libraries working in Eclipse. Has anyone else experienced this problem?


Solution

  • This is a temporary bug in Android Studio. Instead of using the Add as Library option (which wouldn't work anyway due to https://code.google.com/p/android/issues/detail?id=66610), instead go to File > Project Structure > Modules > your module > Dependencies > + button, File dependency, and select your jar from the file chooser.