Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio & ProGuard: cannot resolve symbol getDefaultProguardFile?

IDE: Android Studio 1.1.0

Subject: ProGuard

Problem: ProGuard files or tools not recognized by Android Studio, getDefaultProguardFile can not be resolved and there's no proguard-android.txt and proguard-rules.txt files in the app, see the image below: (from build.gradle)

build.gradle screenshot

How to fix this and achieve ProGuard protection to my App ?

like image 868
Fadi Obaji Avatar asked Apr 09 '15 00:04

Fadi Obaji


People also ask

What is Android Studio for?

Android Studio provides a unified environment where you can build apps for Android phones, tablets, Android Wear, Android TV, and Android Auto. Structured code modules allow you to divide your project into units of functionality that you can independently build, test, and debug.

Is Android Studio for free?

The Android Studio IDE is free to download and use. It has a rich UI development environment with templates to give new developers a launching pad into Android development.

Is Android Studio coding?

Android Studio supports all the same programming languages of IntelliJ (and CLion) e.g. Java, C++, and more with extensions, such as Go; and Android Studio 3.0 or later supports Kotlin and "all Java 7 language features and a subset of Java 8 language features that vary by platform version."

Which language is used in Android Studio?

The official language for Android development is Java. Large parts of Android are written in Java and its APIs are designed to be called primarily from Java.


1 Answers

I had the same trouble as shown here:

enter image description here

The error message makes it seem as if the file is not being found, and therefore not read. However, I went to into sdk/tools/proguard folder to find the file, and at the top added a statement to test if the file was actually being read. I put at the top "Will this crash it?"

enter image description here

As you can see from the error, the file was indeed found during the build process and the statement I added crashed it. Thus, it appears the "can't resolve symbol" error is giving a false positive.

like image 127
NameSpace Avatar answered Oct 14 '22 08:10

NameSpace