How to change Platform-TOOLs - android

I'm building an app with Android Studio.
This is my grandle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.mcsolution.easymanagementandroid"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
multiDexEnabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.0.0'
compile files('libs/gson-2.2.4.jar')
compile 'com.itextpdf:itextg:5.5.9'
compile 'com.android.support:cardview-v7:25.0.0'
}
If I try to start my application, I can use it never problem.
If I try to upen all view.xml file, I have this error:
The SDK Platform-TOOLs version (23.1) is too old to check APIs compiled with API 26; please update more....
How can I change Platform-TOOLs and fix my problem ?

Open SDK Manager
Go to system settings > Android SDK
Go to SDK Tools Tab
you will find Android SDK platform-Tools 23.1 and you will find an update available
just update it
As also reported in this link

Related

Could not find class xxx referenced from method xxx when running app on API 19

I have a problem when I try to run my application on android device that uses API level 19 (Android 4.4.2). When I run the app on API>21 it works perfectly fine.
The errors I'm getting:
I tried setting buildToolsVersion to 19.1.0 instead of 23.0.3 but then I can't use MultiDex and I can't build the app without it.
here is my build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion '23.0.3'
defaultConfig {
applicationId "multisoft.testsurfaceview"
minSdkVersion 19
targetSdkVersion 19
versionCode 1
multiDexEnabled true
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:19.0.0'
compile files('/Users/admin/Desktop/Projects/testsurfaceview/libs/classes.jar')
}
I can't seem to find where the problem could be, any suggestions?
remove this compile files('/Users/admin/Desktop/Projects/testsurfaceview/libs/cl‌​asses.jar') from dependencies.
And just add the jar in libs folder and tried it..
see this link you will find your answer.
basically you did not configure multidex properly.
enter link description here

Unable to open android project in windows

I'm new to android and developing android application of password manager. I started working in Ubuntu android studio and due to some problem I switched to windows 10 but Unable to import project showing error of app:compileDebugAidl or Aidl is missing. I tried to change version from 23.2.0 to 21.0.2 or 21.0.0 but unable to solve. please suggest
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.devil.password"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
}

Unable to sync gradle

I get error messages when I try to add recyclerview and cardview dependencies to my build.gradle. Here is my build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.truewebdev.applytheme"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support.recyclerview-v7:23.2.0'
compile 'com.android.support.cardview-v7:23.2.0'
}
Here are the error messages:
If I try to install repository, I get the following:
What is wrong here?
Did you download the Android Support Repository from the SDK Manager?
From android docs:
Make sure you have downloaded the Android Support Repository using the SDK Manager.
http://developer.android.com/tools/support-library/setup.html#libs-with-res

AndroidStudio error that my app isn't compatible with Java 7

Here is my Gradle build file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "problemio.com.problemionew"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
}
My application compiled ok, but when I tried to run it, I got this error:
Any thoughts on what is going wrong here? My machine is set up for Java 6. When I tried to upgrade to Java 7 I got some errors so I had to revert to Java 6.
That error is due to problem in compilation which usually related to duplicated libraries or too many methods and classes. I guess that you are including google play services in you gradle . Try to use specific sub library from here https://developers.google.com/android/guides/setup.
This error
This error about for uses and give referance same classes.Look here

How to add a deppendecy to a build.gradle?

I'm wanting use this github project: https://github.com/makovkastar/FloatingActionButton in my android app, however I dont know if I have to download the project and move to libraries package, or if I have only do this:
dependencies {
compile 'com.melnykov:floatingactionbutton:1.1.0'
}
You need search the file build.gradle of your whole app folder.
There should be 2 of them, open the file under app folder you will see some like:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.2'
compile 'com.melnykov:floatingactionbutton:1.1.0'
}
Put compile 'com.melnykov:floatingactionbutton:1.1.0' in dependencies
You don't need to download the source code if just want to use the library.
Just add line compile 'com.melnykov:floatingactionbutton:1.1.0' to dependencies section in build.gradle

Categories

Resources