Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Aapt_rules.txt not found when building apk in android studio

When running proguard to build my apk file, I get the following error:

Warning:Exception while processing task java.io.FileNotFoundException: C:\Users\Josh\Documents\AdscendUnityPlugin2.1.3\AdscendUnityPlugin2.1.3\HelloUnity\Export\HelloUnity\build\intermediates\proguard-rules\debug\aapt_rules.txt (The system cannot find the path specified)

My gradle file:

// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.0'
    }
}

allprojects {
   repositories {
       jcenter()
      flatDir {
        dirs 'libs'
      }
   }
}

apply plugin: 'com.android.application'

repositories {

    maven { url "https://bitbucket.org/adscend/androidsdk/raw/master/" }
}


dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.adscendmedia.sdk:adscendmedia:2.1.26'
}

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.0'

    defaultConfig {
        targetSdkVersion 25
    }

    lintOptions {
        abortOnError false
    }

    buildTypes {
        debug {
            jniDebuggable true
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-unity.txt'

        }
    }

}

I couldn't seem to find the folder 'proguard-rules' either, what could be causing this error? Any ideas?

I am aware i'm running proguard on my debug build, i'm just trying to get it to work at this point.

Thank you

like image 562
Cypras Avatar asked Mar 10 '17 19:03

Cypras


People also ask

How do I enable R8 on my Android?

Enabling R8 in your project To enable R8, open build. gradle module app file and add this piece of code inside the buildTypes . The code inside the release{} block means that this will be applied to the release build version of your application. If you launch the app in the emulator, this code is not executed.

What is minifyEnabled in Android?

minifyEnabled true. // Enables resource shrinking, which is performed by the. // Android Gradle plugin. shrinkResources true. // Includes the default ProGuard rules files that are packaged with.

How do you obfuscate codes on Android?

You can use the Android ProGuard tool to obfuscate, shrink, and optimize your code. Obfuscated code can be more difficult for other people to reverse engineer. ProGuard renames classes, fields, and methods with semantically obscure names and removes unused code.


1 Answers

In my case my custom proguard.pro is blank. Rebuild project works for me.

like image 82
Akira Avatar answered Oct 07 '22 10:10

Akira