Resolve Android studio Error: of 30 31 Error: Package does not exist

  • 2021-11-29 08:33:41
  • OfStack

1. Fix bug

Recording this bug is not to say how difficult this problem is, but to try many methods before solving it. It is a process of constant trial and error, such as:

Multiple clean project/rebuild project;

Look at build under the main project/look at the compiled. class file, and find that there is no compiled code for library;

I tried to rename the package name of library, delete it first, and then add it.

I tried a lot of methods, of course, it was useless. Finally, I found that it was related to confusion, so I turned off the confusion of library and compiled it on ok, as follows:


 buildTypes {
    release {
      minifyEnabled true // Turn this off 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }

    debug {
      minifyEnabled false
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }

2. Reflect

Of course, the problem solving is very simple, but this process has taken a lot of time, and there are several points worth thinking about:

About positioning problem: How to locate the problem quickly is the key to solve the problem efficiently. The rapid positioning depends on whether you have enough knowledge and understanding of the system/tool/idea/knowledge system used, rather than just staying at the level of usability.

About search tools: Now the development of the network, we can quickly learn a lot of knowledge we don't know, knowledge is very fast, very complete, a lot; This is the advantage of the Internet, and it is also the core force for its sustainable development. However, the shortcomings will lead us to rely too much on it and lose our thinking power, judgment and decision-making power. At the same time, the knowledge points are too fragmented, which is not convenient for us to form a systematic and effective systematic knowledge system and systematic thinking system for sustainable development.

About character: Patience is a good solution to complex problems. We can't lose heart after trying many times because of problems. This is the same as doing other things. We will definitely encounter some unexpected difficulties in the process of doing it. We need patience in the process of trying. Things in the world are mutually reinforcing. If there are difficulties, there must be corresponding methods.

Additional knowledge: troubleshooting android studiogradle error package symbol not found

Problem: android studio gradle Error Package symbol not found

Solution: The reason is that build. gradle of library project contains release, so just annotate it


buildTypes {
release {
minifyEnabled true

proguardFiles 'proguard-project.txt'

signingConfig signingConfigs.myConfig
}
debug {
debuggable true
}
}

Note:


buildTypes {
 //  release {
 // minifyEnabled true

 // proguardFiles 'proguard-project.txt'

 // signingConfig signingConfigs.myConfig
 //  }
debug {
debuggable true
}
}

Related articles: