Error in the package line of my classes and in this line of my manifests "? xml version=" 1.0 "encoding=" utf-8 "? "

1

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

    
asked by Jorge1023 23.01.2017 в 05:45
source

2 answers

0

If you check the message:

  

The SDK platform-tools version (24.0.4 rc1) is too old to check APIs   compiled with API 25; please update

indicates that an update of Android SDK Platform-tools is necessary because you have defined a targetSdkVersion to api 25.

targetSdkVersion 25

Update!

    
answered by 23.01.2017 / 17:43
source
3

Friends I already solved my problem what I did was the following:

I followed the following route ...

SDK Manager --- > SDK Tools --- > Here you will see an update available from the SDK platforms-Tools, you just have to update and go!

And about what I was closing the application was because I had a version "minSdkVersion 22" and was installing it on a cell that supported "minSdkVersion 16" what I did was only down to 16, and that was all work perfect later.

    
answered by 23.01.2017 в 09:25