Common Errors and Solutions

Here are some common errors with solutions that you may face while using Android Studio.

1) Error:(1, 0) Plugin with id ‘com.android.application’ not found.

You may face this type of error while opening an Android Studio project which is build in another system where the studio sdk or build version may be different. Here some gradle files are missing in the following path.

Gradle Script->Project level->build.gradleerror1

Solution:- Open any of your existing project which is build in your Android studio copy all the content of Project level build.gradle file and paste it and sync the project.


         2) Error:Failed to find Build Tools revision 25.0.3.

You may face this type of error while opening an Android Studio project which is build in another system where the studio buildToolsVersion is different. Go to the follwing path.

Gradle Script->Module level->build.gradle file.

error2.jpg

Solution:– Open any of your existing project which is build in your Android studio go to the Module level build.gradle file and copy the buildToolsVersion from it and paste it and sync the project again.


3)Application Installation Failed

image.png

Solution:-Disable Instant Run in your Project’s Settings follow the below steps.

Step 1.

image (1)

Step 2.

image (2).png

Step 3.

image (3).png

Now try to Run again.


4) Failed to resolve: com.google.firebase:firebase-database:11.0.1

This can occur while adding firebase database to your dependency.

errorfd

Solution:- 

  • Open SDK Manager in Android Studio.
  • Select SDK Tools Tab.
  • Extract Support Repository and Update the Google Repository to 54.
  • Now Sync your project again.

5) DuplicateFileException: Duplicate files copied in APK META-INF/LICENSE.

The above exception occurs while using Firebase Database.

Solution:-

Just add the following lines in your App level build.gradle below the buildToolsVersion

packagingOptions {
    exclude 'META-INF/DEPENDENCIES.txt'
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/notice.txt'
    exclude 'META-INF/license.txt'
    exclude 'META-INF/dependencies.txt'
    exclude 'META-INF/LGPL2.1'

}


 

3 thoughts on “Common Errors and Solutions

    1. This kind of error generate when your build.gradle (project) content missing or related to dependencies..

      To solve this error

      Just open your existing project and copy your build.gradle (project ) file content and paste it on your current project’s build.gradle file

      e.g.

      // Top-level build file where you can add configuration options common to all sub-projects/modules.

      buildscript {
      repositories {
      jcenter()
      }
      dependencies {
      classpath ‘com.android.tools.build:gradle:2.3.2’

      // NOTE: Do not place your application dependencies here; they belong
      // in the individual module build.gradle files
      }
      }

      allprojects {
      repositories {
      jcenter()
      }
      }

      task clean(type: Delete) {
      delete rootProject.buildDir
      }

      Like

Leave a comment