Title: Conflicting with JAR files? · Issue #30 · deepmedia/Grease · GitHub
Open Graph Title: Conflicting with JAR files? · Issue #30 · deepmedia/Grease
X Title: Conflicting with JAR files? · Issue #30 · deepmedia/Grease
Description: I am trying to consume a local AAR that our SDK depends on, our SDK will be an AAR as well when release. We have some dependencies on JAR files as well however it seems this plugin is having issue with JAR files and does not respect the ...
Open Graph Description: I am trying to consume a local AAR that our SDK depends on, our SDK will be an AAR as well when release. We have some dependencies on JAR files as well however it seems this plugin is having issue ...
X Description: I am trying to consume a local AAR that our SDK depends on, our SDK will be an AAR as well when release. We have some dependencies on JAR files as well however it seems this plugin is having issue ...
Opengraph URL: https://github.com/deepmedia/Grease/issues/30
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Conflicting with JAR files?","articleBody":"I am trying to consume a local AAR that our SDK depends on, our SDK will be an AAR as well when release. We have some dependencies on JAR files as well however it seems this plugin is having issue with JAR files and does not respect the original AAR structure the AGP generates (without this plugin). I noticed that just by adding this plugin (not actually using it or using `grease` in any of the dependencies) the generated AAR is broken or has different structure and we keep getting NPE. Note that the local AAR and JAR contains native library (.so).\n\n\n1. Consuming JAR using `api(files(\"libs/SDK1.jar\"))` and consuming local AAR using `greaseTree(\"SDK2.jar\")`.\n\n```\ndependencies {\n api(files(\"libs/SDK1.jar\"))\n greaseTree(\"org.slf4j:slf4j-android:1.7.32\")\n greaseTree(files(\"libs/SDK2.aar\"))\n}\n```\n\nStructure of AAR\n\n- libs\n - SDK1.jar\n - OtherSDK.jar\n - classes.jar\n - com\n - sdk2_package\n - this_sdk_package\n - org\n - slf4j\n\n\n\n2. Consuming JAR local AAR using `greaseTree(\"SDK2.jar/aar\")`.\n\n```\ndependencies {\n greaseTree(files(\"libs/SDK1.jar\"))\n greaseTree(\"org.slf4j:slf4j-android:1.7.32\")\n greaseTree(files(\"libs/SDK2.aar\"))\n}\n```\n\nStructure of AAR\n\n - classes.jar\n - com\n - sdk1_package\n - a- (compressed)\n - b- (compressed)\n - sdk2_package\n - this_sdk_package\n - org\n - slf4j\n\n\u003cimg width=\"1132\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/6090216a-c8bc-4b34-9ec5-54999814889a\" /\u003e\n\nAs we can see the libs folder is now gone and ** sdk1_package** is now included in `classes.jar`\n\nBoth of the generated AAR is not working. We compare it to the generated AAR that is working but the local AAR classes.jar was manually extracted.\n\n\n3. Manually extracted classes.jar from local AAR (working).\n\n```\ndependencies {\n api(files(\"libs/SDK1.jar\"))\n implementation(\"org.slf4j:slf4j-android:1.7.32\")\n api(files(\"libs/SDK2_AAR_manually_extracted_classes.jar\"))\n}\n```\n\n- libs\n - SDK1.jar\n - SDK2_manually_extracted_classes.jar\n - classes.jar\n - com\n - sdk1_package\n - a- (uncompressed)\n - b- (uncompressed)\n - sdk2_package\n - this_sdk_package\n\n\u003cimg width=\"1106\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/0c234bf8-8bbe-4f90-8487-b437f3311dfe\" /\u003e\n\nAlso noticed that SDK1 is now uncompressed and has different file name.\n\nDoes this plugin works for cases where both AAR and JAR is simultaneously consumed? I think my major problem here is the plugin does not retain the original behavior of AGP building AAR. I wanted to retain how AGP manage local JAR files while the plugin only handles local AAR.\n\n\nAlso got this warning during building of AAR however the `.so` files was still included in the final AAR.\n`/Users/user/Library/Android/SDK/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-strip: error: '/Users/user/Desktop/Projects/Mobile/Native/Android/Android-App/sdk_module/build/intermediates/merged_native_libs/debug/mergeDebugNativeLibs/out/lib/armeabi-v7a/libSdk.so': The file was not recognized as a valid object file\n`","author":{"url":"https://github.com/ArcherEmiya05","@type":"Person","name":"ArcherEmiya05"},"datePublished":"2025-05-27T00:12:59.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/30/Grease/issues/30"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:09d3f6ea-c6b8-e618-7fce-52cd17314105 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B76A:244841:10A84A2:1725F45:6967D675 |
| html-safe-nonce | 7e60a9d2e08e6479f3f492df9cec9212bcd01065104c33693f66fed71d90ce12 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzZBOjI0NDg0MToxMEE4NEEyOjE3MjVGNDU6Njk2N0Q2NzUiLCJ2aXNpdG9yX2lkIjoiMzk2NTgzMzU3NTk3MDc5MTU3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5fcd12f2263b326acec0291f2c5d4f5ef37ff8716cddc9a4310e85b421b0317b |
| hovercard-subject-tag | issue:3092236622 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/deepmedia/Grease/30/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2ef03eb565376b34f90201cfbfdcd9ab03051ac3e12cb0c45f738f810284fb0d/deepmedia/Grease/issues/30 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2ef03eb565376b34f90201cfbfdcd9ab03051ac3e12cb0c45f738f810284fb0d/deepmedia/Grease/issues/30 |
| og:image:alt | I am trying to consume a local AAR that our SDK depends on, our SDK will be an AAR as well when release. We have some dependencies on JAR files as well however it seems this plugin is having issue ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ArcherEmiya05 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 14e0d722f75b0b025fe0e288daf623a1aaf571977ca14ad1529d490d6c64619b |
| turbo-cache-control | no-preview |
| go-import | github.com/deepmedia/Grease git https://github.com/deepmedia/Grease.git |
| octolytics-dimension-user_id | 66073326 |
| octolytics-dimension-user_login | deepmedia |
| octolytics-dimension-repository_id | 285627279 |
| octolytics-dimension-repository_nwo | deepmedia/Grease |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 285627279 |
| octolytics-dimension-repository_network_root_nwo | deepmedia/Grease |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4170fbd32815203bb4883f3e5f85ebea81eb5d6c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width