jp_0124
jp_0124

Reputation: 51

Proguard files not being created

I have several projects in Android Studio. I am using
buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } in my gradle script. I have updated Android Studio to the latest version and use the latest version of build tools. However, the proguard files, for example, mapping.txt, are never generated. What am I doing wrong? Thanks in advance!

Upvotes: 0

Views: 1428

Answers (1)

jp_0124
jp_0124

Reputation: 51

I have solved this problem. The steps are:

  1. Create a new empty project in Android Studio, and the default file, proguard-rules.pro, is created in the app folder.
  2. Outside of Android Studio (e.g. Windows Explorer), copy proguard-rules.pro to the app directory.
  3. It will show up in your project when it is re-opened.
  4. Edit proguard-rules.pro as explained in the comments in the proguard-rules file.
  5. Generate your apk and you'll see that the mapping.txt and other proguard files are created.

Upvotes: 1

Related Questions