RELASE AAR不包含任何代码Android?
我正在使用Android Studio Bumble Bee 时,该库具有单个类,
class Lib2 {
fun print(){
println("From lib2")
}
}
我创建了一个模块库,该模块库在
-keepclasseswithmembers class com.example.lib2.Lib2{
public <methods>;
public <fields>;
}
使用 minifyEnabled true
创建版本的AAR
但是当我将AAR集成到App Module时,我没有得到 lib2
。这里怎么了?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自文档:
在英语中,它的意思是“不要混淆具有以下方法和字段结构的类”。
例如,保留所有具有单个构造函数的类
上下文
参数:从我的理解来看,您只想保留整个课程,就可以使用:
我认为,最好使用
@keep
直接在课堂中发出通知,因为:@keep
,您立即知道混淆中要保留哪些类,并且更可读性。更简单:
From documentation:
In English it means "Don't obfuscate classes that have the following methods and fields structure".
For example, keeping all classes which have constructors with single
Context
parameter:Since, from my understanding, you simply want to keep the whole class, you can use:
In my opinion, it's better to use
@Keep
annnotation directly in the class, because:@Keep
you know immediately what classes are being kept from obfuscation and it's much more readable.Much more simple: