I was working on an Android example, in which I first made an error in the library:
compile 'com.android.support:design:25.0.1'
It was fixed by uploading the version to targetSdkVersion 25 and compileSdkVersion 25, previously they were in version 24.
Well all very well only that now I have a new error, the error is in the classes, more specific in the line where the package is declared, this error allows me to compile the program, but when trying to install the apk, the application fails and the cell phone sends me the following message:
An error occurred during package analysis.
Here below I leave the lines where I get the error:
In this line in all classes I get the following error --- >
package com.example.jorge.chatapp;
Said error says: the sdk platform-tools version (24.0.4) is too old to check apis compiled with api 25; please update
In this line of manifests I get the error
? xml version="1.0" encoding="utf-8"? >
Said error says: the sdk platform-tools version (24.0.4) is too old to check apis compiled with api 25; please update
This is my manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
this is my app / build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.example.jorge.chatapp"
minSdkVersion 22
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
testCompile 'junit:junit:4.12'
//Add Library
compile 'com.android.support:design:25.0.1'
compile 'com.google.firebase:firebase-database:9.4.0'
compile 'com.google.firebase:firebase-core:9.4.0'
}
apply plugin: 'com.google.gms.google-services'
this is my Project / build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'com.google.gms:google-services:3.0.0'
// 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
}
And for leaving the example of a class with the error
package com.example.jorge.chatapp;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
To exemplify a little more I leave some images