{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3141","repository_url":"https://api.github.com/repos/swagger-api/swagger-codegen","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3141/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3141/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3141/events","html_url":"https://github.com/swagger-api/swagger-codegen/issues/3141","id":160394337,"number":3141,"title":"java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/Consts","user":{"login":"tamirtf","id":17542274,"avatar_url":"https://avatars.githubusercontent.com/u/17542274?v=3","gravatar_id":"","url":"https://api.github.com/users/tamirtf","html_url":"https://github.com/tamirtf","followers_url":"https://api.github.com/users/tamirtf/followers","following_url":"https://api.github.com/users/tamirtf/following{/other_user}","gists_url":"https://api.github.com/users/tamirtf/gists{/gist_id}","starred_url":"https://api.github.com/users/tamirtf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tamirtf/subscriptions","organizations_url":"https://api.github.com/users/tamirtf/orgs","repos_url":"https://api.github.com/users/tamirtf/repos","events_url":"https://api.github.com/users/tamirtf/events{/privacy}","received_events_url":"https://api.github.com/users/tamirtf/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-15T10:57:54Z","updated_at":"2016-06-15T13:27:03Z","closed_at":null,"body":"<!--\r\nPlease follow the issue template below for bug reports and feature requests.\r\nAlso please indicate in the issue title which language/library is concerned. Eg:  [JAVA] Bug generating foo with bar \r\n-->\r\n\r\n##### Description\r\n\r\nI generated SDK of Android language which is packaged as AAR. \r\nThe Android application is compiled with the AAR.\r\n\r\nHowever, in run time, it gets the following exception:\r\njava.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/Consts;\r\nat io.swagger.client.ApiInvoker.<clinit>(ApiInvoker.java:55)\r\n\r\nIt could be solved by adding the following line to application's build.gradle:\r\ncompile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'\r\n\r\nI wonder why the user should add any line to build.gradle, except the line of generated artifact (SDK),  instead of used libraries (JARs) would be part in the AAR.\r\n\r\n##### Swagger-codegen version\r\n\r\n<!-- which version of swagger-codegen are you using, is it a regression? -->\r\nThe version is 2.2.0-SNAPSHOT, it's not a regression.\r\n##### Swagger declaration file content or url\r\nIt happens with any swagger declaration file, it's not related to a specific file.\r\n<!-- if it is a bug, a json or yaml that produces it.\r\n    If you post the code inline, please wrap it with\r\n    ```yaml\r\n    (here your code)\r\n    ```\r\n    (for YAML code) or\r\n    ```json\r\n    (here your code)\r\n    ```\r\n    (for JSON code), so it becomes more readable. If it is longer than about ten lines,\r\n    please create a Gist (https://gist.github.com) or upload it somewhere else and\r\n    link it here.\r\n  -->\r\n\r\n##### Command line used for generation\r\njava -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i example.yaml -l android -o androidApis\r\n<!-- including the language, libraries and various options -->\r\n\r\n##### Steps to reproduce\r\n1. 'mvn clean install' to the generated project.\r\n\r\n2. Add to build.gradle:\r\ncompile group: 'io.swagger',\r\n            name: 'swagger-android-client',\r\n            version: '1.0.0',\r\n            ext: 'jar'\r\n\r\n3. Use in an Android application:\r\nCarApi apiCar = new CarApi();\r\n\r\n4. Run the application.\r\n\r\n<!-- unambiguous set of steps to reproduce the bug.-->\r\n\r\n##### Related issues\r\n\r\n<!-- has a similar issue been reported before? -->\r\n\r\n##### Suggest a Fix\r\n\r\n<!-- if you can't fix the bug yourself, perhaps you can point to what might be\r\n  causing the problem (line of code or commit) -->\r\n"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/comments/226186402","html_url":"https://github.com/swagger-api/swagger-codegen/issues/3141#issuecomment-226186402","issue_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3141","id":226186402,"user":{"login":"wing328","id":934260,"avatar_url":"https://avatars.githubusercontent.com/u/934260?v=3","gravatar_id":"","url":"https://api.github.com/users/wing328","html_url":"https://github.com/wing328","followers_url":"https://api.github.com/users/wing328/followers","following_url":"https://api.github.com/users/wing328/following{/other_user}","gists_url":"https://api.github.com/users/wing328/gists{/gist_id}","starred_url":"https://api.github.com/users/wing328/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wing328/subscriptions","organizations_url":"https://api.github.com/users/wing328/orgs","repos_url":"https://api.github.com/users/wing328/repos","events_url":"https://api.github.com/users/wing328/events{/privacy}","received_events_url":"https://api.github.com/users/wing328/received_events","type":"User","site_admin":false},"created_at":"2016-06-15T13:27:03Z","updated_at":"2016-06-15T13:27:03Z","body":"@tamirtf there should be no need to manually add another line in build.gradle in order to make the Android SDK works. I'm looking into it.\r\n\r\nYou can also want to try the Java (okhttp-gson) API client, which works with Java, Android, Scala, etc: https://github.com/swagger-api/swagger-codegen/wiki/FAQ#android"}}
{"actor":{"display_login":"wing328"}}