My friend Gave me a project which was built in Windows platform and I have ubuntu. So when I import the project I am getting this error,
Error:(1, 0) Cause: com/android/build/gradle/AppPlugin : Unsupported major.minor version 52.0
How can get my project running. I have tried all the possible solutions but didn't work any one of them.
I have already point my SDK path and using JDK 1.7.0. Using Gradle 2.14.1 which is latest one.
Here is my gradle.build file.
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.example.lenovo.myapp"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.api-client:google-' +
'api-client-gson:+'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.google.http-client:google-http-client-android:+'
compile 'com.google.api-client:google-api-client-android:+'
compile 'com.google.code.gson:gson:2.2.4'
compile 'org.apache.httpcomponents:httpclient:4.5'
compile 'com.google.android.gms:play-services-identity:9.2.1'
compile 'com.google.android.gms:play-services-plus:9.2.1'
compile 'com.google.android.gms:play-services-gcm:9.2.1'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'org.apache.httpcomponents:httpcore:4.4.1'
compile 'org.apache.httpcomponents:httpmime:4.3.6'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.okhttp:okhttp:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha5'
compile 'com.github.bumptech.glide:glide:3.6.0'
compile 'com.jakewharton:butterknife:6.1.0'
compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.1.3'
testCompile 'junit:junit:4.12'
}
Any solution would be appreciated. I am stuck since last 2 days.
I have already point my SDK path and using JDK 1.7.0
You need JDK 1.8 with the new version of Studio and the build tools.
You are trying to use JDK 1.7. The project was built on 1.8 ( 52.0 - refer this link How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version). So, probaby using 1.8 JDK and JRE may work for you.
Related
I dont quite understand this my sdk version is the same as my 'appcompat' and 'recyclerview' but it still has an error to it,I have tried rebuild and clean the project but still geting the same result, I have the same project to this one but it doesn't have an error like this one, any idea whats going on here?
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.example.parasitologymemorization.parasitologymemorization"
minSdkVersion 18
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
jackOptions {
enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar', '**/*.so'])
compile 'com.android.support.constraint:constraint-layout:1.0.2'
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:26.0.1'
compile 'com.github.satyan:sugar:1.5'
compile 'com.jakewharton:butterknife:8.8.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:recyclerview-v7:26.0.1'
compile 'com.beardedhen:androidbootstrap:2.3.2'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
compile 'com.wonderkiln:camerakit:0.12.0'
compile(name: 'tensorflow', ext: 'aar')
}
Android Studio makes a lot of files as caches and does not delete them. This can cause trouble when there is a need to make new files, so clearing 'cacheswill clear the oldcache` and make Android Studio faster.
So you need to Invalidate Caches/Restart in Android Studio.
Whichever versions it says are wrong in the error message, compile the newest version in your gradle file, even if you don't think you're using them. I've run into this multiple times and that always fixes it.
For example, you should manually compile the recyclerview dependency with version 27.0.0
Just copy the com.android.support:animated vector drawable:27.0.0" in the build.gradle file and then change 27.0.0 to 26.0.1 and that sync the gradle.
I tried to use Google Map Service by using com.google.maps:google-maps-services:0.1.7 version.
After adding complie 'com.google.maps:google-maps-services:0.1.7'to build.gradle(Module: app), I tried to sync the project.
Then I got following errors in Messages Gradle Sync,
D:\Solutions\Security\app\build.gradle
Error:(26, 0) Gradle DSL method not found: 'complie()'
Possible causes:The project 'AIGSecurity' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
Upgrade plugin to version 2.3.2 and sync project
The project 'Security' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper file
The build file may be missing a Gradle plugin.
Apply Gradle plugin
And This is my build.gradle(Module: app) file,
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
defaultConfig {
applicationId "solutions.com.security"
minSdkVersion 18
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'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
complie 'com.google.maps:google-maps-services:0.1.7'
compile 'com.google.android.gms:play-services-maps:10.2.1'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'joda-time:joda-time:2.9.4'
compile 'com.auth0.android:jwtdecode:1.1.0'
compile 'com.android.support.constraint:constraint-layout:+'
androidTestCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-location:10.2.1'
compile 'com.android.support:support-annotations:24.2.0'
compile 'com.google.firebase:firebase-messaging:10.0.1'
}
apply plugin: 'com.google.gms.google-services'
Is there any way to fix this issue ?
you misspelled compile
complie 'com.google.maps:google-maps-services:0.1.7'
to
compile 'com.google.maps:google-maps-services:0.1.20'
I am trying to use opencsv library jar file but while importing i am getting the error message saying "Fail to load plugin descriptor from file *.jar".
I checked for META-INF/plugin.xml file inside the jar, but there is none.
So, i am now importing the source code of opencsv. I am getting error with java 7 api used within the library source code. All the usages of 'java.bean.*' package is giving 'cannot find symbol' error.
Following is the build.gradle file content:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.amadeus.jbisht.mytestproject"
minSdkVersion 23
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(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.+'
testCompile 'junit:junit:4.12'
}
Please let me know what am I missing here. I can see it listed under 'External Libraries' but android studio isnt picking it up.
Gradle dependencies are the way to go:
compile group: 'com.opencsv', name: 'opencsv', version: '3.8+'
E.g.,
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
compile group: 'com.opencsv', name: 'opencsv', version: '3.8+'
}
Gradle will automatically import the required files and integrate the library.
opencsv need some java.bean libraries, but they are not included in the Android SDK.
To resolve this :
download sources of opencsv
download openbean
include both in your Android Studio project
replace java.bean.* dependancies by localpath.bean.* in opencsv sources
I am getting this error when I build my android app on my Machine, it runs perfectly on my old latptop/android enviroment , I get this error. Please let me know, if you need me to show more codes.
Old laptop is running one Android 1.2.2
Gradle 2.2.1 ??
my machine runs on 2.1.1
Gradle 2.10.0
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> java.io.FileNotFoundException: C:\Users\Ahmad\AndroidStudioProjects\AMHAPP\app\build\intermediates\libs3\httpcore-4.3.jar
(The system cannot find the path specified)
OR
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
java.io.FileNotFoundException: C:\Users\Ahmad\AndroidStudioProjects\TestApp.gradle\2.2.1\taskArtifacts\lib\jcifs-1.3.18.jar (The system cannot find the path specified)
Note: the following for the build paths of android studio
Example:
old machine :
compile files('C:/Users/Administrator/AndroidStudioProjects/TestApp/.gradle/2.2.1/taskArtifacts/lib/ftp4j-1.7.2.jar')
new machine:
compile files('C:/Users/Ahmad/AndroidStudioProjects/TestApp/.gradle/2.2.1/taskArtifacts/lib/ftp4j-1.7.2.jar')
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "AMH.Code.testapp"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
android.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'
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
compile files('C:/Users/Ahmad/AndroidStudioProjects/TestApp/.gradle/2.2.1/taskArtifacts/lib/jcifs-1.3.18.jar')
compile files('build/libs2/commons-io-2.4.jar')
compile files('build/intermediates/libs3/httpcore-4.3.jar')
compile files('libs/httpmime-4.0.1.jar')
compile files('libs/apache-mime4j.jar')
compile files('libs/commons-io-2.4.jar')
compile files('C:/Users/Ahmad/AndroidStudioProjects/TestApp/.gradle/2.2.1/taskArtifacts/lib/ftp4j-1.7.2.jar')
compile files('C:/Users/Ahmad/AndroidStudioProjects/TestApp/.gradle/2.2.1/taskArtifacts/lib/libs2/apache-commons-net.jar')
compile files('C:/Users/Ahmad/AndroidStudioProjects/TestApp/.gradle/2.2.1/taskArtifacts/lib/ksoap2-android-assembly-3.4.0-jar-with-dependencies.jar')
compile files('libs/core-2.2.jar')
compile files('C:/Users/Ahmad/AndroidStudioProjects/TestApp/.gradle/2.2.1/taskArtifacts/lib/libs2/zbar.jar')
compile files('libs/commons-net-3.3.jar')
compile files('libs/ksoap2-android-assembly-3.4.0-jar-with-dependencies.jar')
}
apply plugin: 'announce'
Try add this to your build.gradle
android {
useLibrary 'org.apache.http.legacy'
}
Either download jar for httpcore from here : http://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore/4.3.2
and add to your lib package and right click and add it as library
or
add gradle dependency in your gradle dependencies{} tag by adding :
compile 'org.apache.httpcomponents:httpcore:4.4.4'
and sync project.
I am working on an application. It works perfectly on a device with android 5.0. But crashes constantly on lower versions.
Have so far tried it out on 4.4.4, 4.4.2.
I get the following error.
java.lang.NoClassDefFoundError: android.support.v4.util.ContainerHelpers
at android.support.v4.util.SimpleArrayMap.<init>(SimpleArrayMap.java:209)
at android.support.v4.app.FragmentActivity.getLoaderManager(FragmentActivity.java:867)
at android.support.v4.app.FragmentActivity.getSupportLoaderManager(FragmentActivity.java:861)
at com.client.login.LoginActivity.populateAutoComplete(LoginActivity.java:164)
at com.client.login.LoginActivity.setupView(LoginActivity.java:126)
at com.client.login.LoginActivity.onCreate(LoginActivity.java:71)
I am using android studio for development. My build.gradle is as follows
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '22.0.1'
defaultConfig {
applicationId 'com.client'
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
multiDexEnabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug{
}
}
productFlavors {
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/services/com.fasterxml.jackson.databind.Module'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-v4:22.1.1'
compile 'com.android.support:appcompat-v7:22.1.1'
//compile 'com.facebook.android:facebook-android-sdk:3.21.1'
compile 'com.fasterxml.jackson.core:jackson-databind:2.5.0'
compile 'com.fasterxml.jackson.core:jackson-core:2.5.0'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.5.0'
compile 'com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.5.0'
compile 'joda-time:joda-time:2.0'
compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.5.0'
compile 'com.google.guava:guava:18.0'
compile 'com.google.android.gms:play-services:7.3.0'
compile 'com.google.code.gson:gson:2.3.1'
compile 'com.loopj.android:android-async-http:1.4.6'
compile 'com.etsy.android.grid:library:1.0.5'
}
Thanks a lot.
Found the solution on this post
java.lang.NoClassDefFoundError: android.support.v4.app.NavUtilsJB error when adding new module in Android Studio
Problem was due to multi dexing being added in lollipop. Had to add the multidex support library to my gradle for previous android versions.