简体   繁体   English

使用Java或Kotlin在libs中搜索aar文件名

[英]search an aar file name in libs with java or kotlin

I try to search my libs content in Android project for a specific AAR file name with java or Kotlin code. 我尝试使用Java或Kotlin代码在Android项目中的libs内容中搜索特定的AAR文件名。 I searched a lot but can't find an answer. 我搜索了很多,但找不到答案。

I appreciate your help. 我感谢您的帮助。

The way we solved it, to make a list--or enum--of all libraries and then try, catch to check a method in each library. 我们解决该问题的方法是,列出所有库的列表或枚举,然后尝试捕获每个库中的方法。 if you get the result, you can add this library to an empty array list. 如果得到结果,则可以将此库添加到空数组列表中。 do it for all libraries and the array list is the list of libraries that are available. 对所有库执行此操作,数组列表是可用库的列表。 don't forget to catch the right exception. 不要忘记捕捉正确的异常。 I caught it with: NoClassDefFoundError. 我发现了:NoClassDefFoundError。 it is different due to your purpose. 因您的目的而不同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM