android-r8

R8 minify: Type defined multiple times

孤街浪徒 提交于 2021-02-07 09:11:01
问题 When building a signed release APK I'm getting following error: .gradle/caches/transforms-2/files-2.1/532a317ccd54c8ae4f622faeb8b534a9/jetified-wordup-core-0.2.1-runtime.jar:de/codereddev/wordup/database/WordDao_Impl$5.class, Type de.codereddev.wordup.database.WordDao_Impl$5 is defined multiple times: /home/codered_dev/.gradle/caches/transforms-2/files-2.1/532a317ccd54c8ae4f622faeb8b534a9/jetified-wordup-core-0.2.1-runtime.jar:de/codereddev/wordup/database/WordDao_Impl$5.class, /home/codered

Dealing with R8 + JvmStatic Annotation + Lambda in public API for Android Library written in Kotlin

ぃ、小莉子 提交于 2021-02-07 05:52:08
问题 First of all, please note that I'm not expecting why do you want to obfuscate library comments. This is a genuine problem I'm asking about. I have been having an issue dealing with R8/obfuscation with an Android library written in Kotlin. I've a public API method which is annotated with @JvmStatic and that method takes a Lambda as parameter. For example, take a look at code below, typealias MyLambdaCallback = (String, Map<String, Any>) -> Unit @Keep object MyApi { private var callback:

Dealing with R8 + JvmStatic Annotation + Lambda in public API for Android Library written in Kotlin

谁说胖子不能爱 提交于 2021-02-07 05:51:01
问题 First of all, please note that I'm not expecting why do you want to obfuscate library comments. This is a genuine problem I'm asking about. I have been having an issue dealing with R8/obfuscation with an Android library written in Kotlin. I've a public API method which is annotated with @JvmStatic and that method takes a Lambda as parameter. For example, take a look at code below, typealias MyLambdaCallback = (String, Map<String, Any>) -> Unit @Keep object MyApi { private var callback:

Proguard (R8) obfuscate custom view names

坚强是说给别人听的谎言 提交于 2021-01-27 21:36:38
问题 I am using R8 in my app and have several custom views (which are referenced in xml layouts) tho their names are not obfuscated at all. Is there any way to achieve this? I am using the standard Gradle rules: release { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } And also tried with android.enableR8.fullMode=true but it's the same. 回答1: I am using R8 in my app and have several custom views (which are

How to keep original line numbers in stack traces with R8?

十年热恋 提交于 2020-12-26 11:06:27
问题 I'm trying to figure out how to keep original line numbers with R8. Doing an app with current AndroidStudio and obfuscating it with R8, and even uploading mapping.txt file to Google Play Console, the Stack Traces of the users are useless in some cases, because the lines of the crash are not the same as in the real non obfuscated file. This is a sample, my class doesn't have 3000 lines, but the error is reported in line 3052 ( com.mypackage.activities.ManagerActivity.onCreate (ManagerActivity

How to keep class constructor argument parameter names with Android R8

给你一囗甜甜゛ 提交于 2020-08-05 03:57:30
问题 I'm writing Android library, so I want to preserve parameter names for some constructors/methodes. I'm deploying my library as AAR file. After Gradle upgrade from 3.3.2 to 3.4.0 all arguments in constructors and public methods are renamed to something like "var1", before that everything was fine. As I understand main difference is that, now by default R8 is used to minify and obfuscate our code instead of Proguard. So probably I'm missing something in configuration. Let's say that I have

How to keep class constructor argument parameter names with Android R8

雨燕双飞 提交于 2020-08-05 03:55:13
问题 I'm writing Android library, so I want to preserve parameter names for some constructors/methodes. I'm deploying my library as AAR file. After Gradle upgrade from 3.3.2 to 3.4.0 all arguments in constructors and public methods are renamed to something like "var1", before that everything was fine. As I understand main difference is that, now by default R8 is used to minify and obfuscate our code instead of Proguard. So probably I'm missing something in configuration. Let's say that I have