Cannot use lambda functions in Android with Java 1.8 - java

The library I'm using is bychan, I can't even include it in a Nougat empty app project either loaded as module or through jar.
So this is an example of what was returned in Android Studio's messages:
Can someone explain what they mean by "unknown interface" in the errors below?
Error:TokenDefinitionBuilder.java:118-119: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.Function
Error:TokenDefinitionBuilder.java:118-119: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.Predicate
...
Error:com.android.jack.JackAbortException
This came from a library I've used. I thought adding the types in angle brackets would help? I don't know if it did anything though.
This is the line 118-119 in that library:
strings.stream().<StringMatcher>map(StringMatcher::new).map(
m -> m.tryMatch(input, searchStart)).filter(Objects::nonNull).findFirst().orElse(null));
I'm not sure what it is complaining about? What should I do or change to evade this problem? I had thought that maybe Android doesn't support Lambda Expressions, but the error clearly stated "Lambda coming from...", which means it recognized I used a lambda expression.
Please help.
Update
I have included the library by compiling it in a jar inside another jar library, if that helps. I'm new to the world of Android if you can't tell.
Updates 2
I don't think this is related to the API version? I've set my build target to 25. But the build is still failing.
Also, if you look below, I don't see an option for 1.8? But I've set the build JDK to my 1.8 JDK location.
Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "this.is.where.i.have.my.id"
minSdkVersion 25
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
jackOptions {
enabled true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
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.0.1'
compile 'com.android.support:support-v4:25.0.0'
compile 'com.android.support:design:25.0.0'
compile 'com.android.support:preference-v7:25.0.0'
compile 'com.android.support:preference-v14:25.0.0'
compile 'com.google.android.gms:play-services-appindexing:9.8.0'
testCompile 'junit:junit:4.12'
compile 'com.google.code.gson:gson:2.8.0'
compile files('libs/my_lib_that_contains_lambda.jar')
}

I would not suggest to use java 8. It is not supported nowadays. But, even, it will: remember, that each devices has got its own java machine that will not update. I mean, if you wanna be sure your app works properly setup your project as java 6. Old devices this never support up-to-date JMV
Read this discussion too
Which JDK version (Language Level) is required for Android Studio?

Android SDK < 24 does not support java.util.function.Function and java.util.function.Predicate interfaces because Java 8 allows functional interfaces to contain default methods which is only supported in SDK 24 and above. I had this problem when I was using consumers, and the way I fixed it was to create my own clown of java.util.function.Consumer interface without all the default methods.
You can also fix this issue by increasing the minimum SDK of your app to 24.
Update
Add the following to your build.gradle file
defaultConfig {
jackOptions {
enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

Overall set up looks good to me except for the Java JDK 1.8 part.You need to set a correct path to JDK installation folder in Android Studio in order to use all the new Java 8 features.

Related

Akka Streams, Java and Android Studio

I have been wanting to work on getting Akka Streams (java) to work with Android Studio for a learning project. I add the Akka Actor and Akka Streams dependency to the build.gradle and it syncs perfectly well, adding both of those to the external files. The project bulids fine, but once deployed the app crashes with the following error
Failed to open dex files from /data/app/com.example.akkamagic-ln3G_VACZwI9pFOWqDOdPQ==/base.apk because: Failure to verify dex file '/data/app/com.example.akkamagic-ln3G_VACZwI9pFOWqDOdPQ==/base.apk': Bad index for method_handle_item method_idx: ffff >= f99b
I've come across things that told me to insure that
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
That's added. I've set jetifier to false, since that created a different set of errors and I've added the following for file conflicts.
packagingOptions {
pickFirst 'google/protobuf/*'
pickFirst 'google/protobuf/compiler/plugin.proto'
pickFirst 'reference.conf'
}
Here's the entire build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.akkamagic"
minSdkVersion 27
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
packagingOptions {
pickFirst 'google/protobuf/*'
pickFirst 'google/protobuf/compiler/plugin.proto'
pickFirst 'reference.conf'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}
dependencies {
implementation 'com.android.support:multidex:1.0.3'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'io.magicthegathering:javasdk:0.0.16'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.typesafe.akka:akka-actor_2.12:2.6.3'
implementation 'com.typesafe.akka:akka-stream_2.12:2.6.3'
}
and the gradle.properties
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=false
At this point I don't have any actual code in the project that uses the akka library. If I remove the two akka dependencies from the build.gradle the project syncs, builds, deploys and runs as it should.
I am aware that Akka Streams probably isn't the best for the app I'm running, but I'm just trying to really learn how akka streams works and I don't want to have to learn HTML/CSS/JavaScript right now.

'java' plugin is not compatible with the Android plugins

I'm getting an error right after I installed Android studio and Created a simple app.
Steps followed:
Fresh download & installed Android studio.
Created a new project.
When the project loaded, The gradle failed with error:
Error:The 'java' plugin has been applied, but it is not compatible with the Android plugins.
Module Gradle File:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "info.ankitjc.happybirthday"
minSdkVersion 15
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'
}
Project Gradle File:
// 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.2.3'
// 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
}
I searched for possible solutions here.
Android compile error; Java plugin has been applied, not compatible with android
Gradle error "Java plugin is not compatible with android plugins"
After File > Invalidate Cache/Restart
I think path has not been set as enviorment variable.
check have you declared the java sdk path . set the path as environment variable.
type "javac" in cmd(cmd must have admin previlliage).
If compile is not successfful
1 . Open the jdk location and copy the path of "bin"
2 . Open system properties in control panel.
3 . Advanced system settings -> then select "environment variables"
4 . click on "new"
5 . set variable name as "path" and variable value copied address
then try again
This means the Java plugin is being applied on top of the Android plugin. I don't see anything that stands out in your build files though. Some things to try:
Try doing a clean build from command-line. That will tell you if it's an Android Studio problem.
Create an empty app from a clean slate and see if it builds.
Update Android SDK to latest
Update Android Studio to the latest
Remove Android Studio project files and re-import
Make sure correct Java version is in your path and JAVA_HOME is set correctly
Check if there is any jars in your local lib folder that could be conflicting
Try using beta version of Android plugin compile 'com.android.tools.build:gradle:2.3.0-beta2'
I experienced this error while updating from KAPT to KSP. The docs say to add
id 'org.jetbrains.kotlin.jvm'
to the plugins block, but it appears that adding the Kotlin jvm plugin to the mix was causing my java plugin error. Remove the reference and it compiles. FYI the linked docs are more figurative than literal.
Not sure if this would help, but maybe you can try to explicitly add the java compilation option:
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
Try removing these two lines of code from your build.gradle
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
and
testCompile 'junit:junit:4.12'
Try this one
Procedure :-
1.right click on project ->Open Module Settings or F4
2.then goto SDK Location
3.after that Check on use embedded jdk(recommended)
you can see image given below
build and run project.
You can also add this in your build.gradle file
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
check if more than one jdk is installed.

Android Java: BoofCV Integration Problems

I know these kind of questions were asked here tons of times and none of the provided solutions helped.
I recently tried to add BoofCV to my Android Studio Project using Gradle:
apply plugin: 'com.android.application'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
android {
compileSdkVersion 24
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "com.as.recognize2"
minSdkVersion 14
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
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'])
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:24.1.1'
compile group: "org.boofcv", name: "all", version: "0.26"
compile group: "org.boofcv", name: "android", version: "0.26"
testCompile 'junit:junit:4.12'
}
This is what my build.gradle (app) looks like.
The Gradle Sync succeed but the "Run App" - Build failed giving me errors like these I picked from another question because I have changed much in my project and changing it back would be very difficult.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(org.apache.log4j.chainsaw.ControlPanel$1) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it is *not* an inner class.
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
I get tons of these Errors
And i don't wont to ignore the inner class attributes in proguard configs.
Because of these errors the build takes hours.
Then I downloaded all the Jar - Files from The Boof-CV-Site and embedded them into the libs folder and out-commented the compile commands which use maven to download boofcv. Result:
Error:Error converting bytecode to dex:
Cause: Dex cannot parse version 52 byte code.
This is caused by library dependencies that have been compiled using Java 8 or above.
If you are using the 'java' gradle plugin in a library submodule add
targetCompatibility = '1.7'
sourceCompatibility = '1.7'
to that submodule's build.gradle file.
As you can see at the top of the page I already implemented it. But I can't use the java plugin since I am using the Android.Application Plugin already. And switching back to Java 7 won't work because the new Android Studio 2.2.3 does not support it.
Now I downloaded the source code and embedded them by using File->New->New Module->Import Gradle and navigating to the sources build.gradle. But it contains so many build gradles which all don't know the idea command
and which all don't contain the apply plugin: "java" command and therefore are not able to use the compile function. So I would have to edit each build.gradle (many build.gradle's) by hand.
How can I clearly install Boofcv in Android Studio 2.2.3 or above?
I'm not sure what's wrong but here's a working example that I verified last week: source code This is from the latest SNAPSHOT code, but it's configured to use the previous stable release.
EDIT: Check out the first subsection on this wiki page

Gradle build error: cannot access ITest bad class file: ITest.class default method found in version 50.0 classfile

I have strange problem and don't know how to resolve it.
I have an interface with default method, like this:
public interface ITest{
default String getText(){
return "ITest";
}
}
and class which implements this interface, like this:
public class TestClasssss implements ITest{
private String text;
}
And I trying to use this class inside my app unit tests project.
So, if I copy this classes inside my android's unit test project it compiles ok and all working as expected, however if this class and interface declared in app source folder, application do not compile and crash with
Error:(30, 10) error: cannot access ITest bad class file: ~\ITest.class
default method found in version 50.0 classfile
Please remove or make sure it appears in the correct subdirectory of the classpath.
So, how could I fix this strange behaviour?
My graddle config looks like this:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'me.tatarka:gradle-retrolambda:3.2.5'
}
}
repositories {
mavenCentral()
mavenLocal()
maven {
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
jcenter()
}
apply plugin: 'com.android.application'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'realm-android'
apply plugin: 'com.neenbedankt.android-apt'
apt {
arguments {
androidManifestFile variant.outputs[0]?.processResources?.manifestFile
}
}
android {
compileSdkVersion 24
buildToolsVersion '24.0.1'
defaultConfig {
applicationId "io.projectname"
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt')
}
}
testOptions {
unitTests.returnDefaultValues = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dataBinding {
enabled = true
}
sourceSets {
main {
res.srcDirs =
[
'src/main/res/controls',
'src/main/res/fragments',
'src/main/res/activities',
'src/main/res/views',
'src/main/res'
]
}
}
}
ext {
JUNIT_VERSION = '4.12'
DAGGER_VERSION = '2.2'
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:2.0.111-beta'
testCompile "org.robolectric:robolectric:3.1.1"
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:design:24.2.0'
compile 'com.roughike:bottom-bar:1.3.4'
compile 'com.aurelhubert:ahbottomnavigation:1.2.3'
compile 'joda-time:joda-time:2.9.4'
compile 'com.annimon:stream:1.0.9'
compile 'com.kyleduo.switchbutton:library:1.4.1'
compile 'io.reactivex:rxandroid:1.2.0'
compile 'io.reactivex:rxjava:1.1.5'
compile 'com.jakewharton.rxbinding:rxbinding:0.4.0'
compile('eu.davidea:flexible-adapter:5.0.0-SNAPSHOT') {
changing = true
}
compile 'com.github.aakira:expandable-layout:1.5.1#aar'
compile "cn.aigestudio.wheelpicker:WheelPicker:1.1.2"
compile 'net.sf.biweekly:biweekly:0.5.0'
//Dagger dependencies started
compile "com.google.dagger:dagger:$DAGGER_VERSION"
apt "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
provided 'javax.annotation:jsr250-api:1.0'
compile 'javax.inject:javax.inject:1'
testCompile "junit:junit:$JUNIT_VERSION"
testApt "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
//Dagger dependencies finished
provided 'org.projectlombok:lombok:1.16.10'
}
Make sure that you set up source and target compatibility correctly
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
I was dealing with the same issue, it appears to be some kind of conflict between the compiled java source version accepted on android and the output produced by the code compiled with retrolambda.
The problem raises when you use the default notation for funcional interfaces method.
There's some kind of limited support for that in the retrolambda plugin, quoting the readme of the repo (orfjackal/retrolambda):
retrolambda.defaultMethods
Whether to backport default methods and static methods on interfaces.
LIMITATIONS: All backported interfaces and all classes which implement
them or call their static methods must be backported together,
with one execution of Retrolambda.
Disabled by default. Enable by setting to "true"
So you can try using this in your android module's build.gradle file:
...
android {
...
}
retrolambda {
defaultMethods = true
}
In my case this does not work, but my scenario was quite different than yours. I was having the retrolambda code on one library project and then trying to use that on another app project.
Also I could not get the Jack & Jill compiler to work (theres some kind of java8 support with Jack enabled, see Enable Java 8 Features and the Jack Toolchain at android reference), one cryptic "NullPointer" raises at ./gradlew assembleDebug, so I suggest to avoid jackOptions for now.
Good luck!
I think that you probably need to enable the Jack compiler. You need the following:
Android Studio > 2.1
Default methods are only available if you are targetting API Level 24
Your gradle needs to look something like this:
android {
...
defaultConfig {
...
jackOptions {
enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
This is the Java 8 Language Feature Page in the Android Documentation
I had this issue after using dex2jar. According to https://gitlab.ow2.org/asm/asm/blob/master/asm/src/main/java/org/objectweb/asm/Opcodes.java#L264, version 50 of the JVM bytecode represents Java 1.6, while my dex file was designed to run on version 52 (1.8). I used another dex2jar utility (which should work on any jar, not just dex) to change the version to 1.8. The source is at https://github.com/pxb1988/dex2jar/blob/2.x/dex-tools/src/main/java/com/googlecode/dex2jar/tools/ClassVersionSwitch.java, the command is d2j-class-version-switch.sh 8 <source jar> <destination jar>.
Are you sure that your gradle build is using jdk1.8+? It seems like the build is trying to utilize a class that was built using 1.8 but being tested during build using a lower version.
try:
gradle clean build
OR
gradlew clean build
If you are using Android Studio try to Clean Project, then Build project. If it doesn't help too, then Click to File -> "Invalidate Caches / Restart". It must help

Android Studio 1.4 Rendering Problems NOTE: This project contains Java compilation errors

Rendering Problems
NOTE: This project contains Java compilation errors, which can cause rendering failures for custom views. Fix compilation problems first.
The following classes could not be found:
- android.support.design.widget.AppBarLayout (Fix Build Path, Edit XML, Create Class)
- android.support.design.widget.CoordinatorLayout (Fix Build Path, Edit XML, Create Class)
I am using Android Studio 1.4
Problems here:
if you used sdk 28
compileSdkVersion 28
targetSdkVersion 28
you change it to 27 , that means :
compileSdkVersion 27
targetSdkVersion 27
and in dependencies:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
}
....
this way solved my problem!
happy code!
To use the class ActionBarOverlayLayout you need to include this in the dependencies section :
compile 'com.android.support:design:24.1.1'
Sync the project once again and then you will find no problem
See which Android SDK Build-tools version you Installed from
Android SDK Manager.
Use this version in buildToolsVersion inside build.gradle and remember that targetSdkVersion must be same.
After that add this library, Remember that 23.0.1 is my downloaded version. I use targetSdkVersion 25 and buildToolsVersion "25.0.2".
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
Now from File menu Invalidate cached/Restart you project. And one more thing in XML preview must select your download version.
Have you imported the design library into your project? It looks like you're missing a reference in your build.gradle
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
Check for the following if you have done all of the below then you shouls be able to compile and build your project.
1) Is your Activity extending AppCompactActivity
2) Is your Theme extending Theme.AppCompat.Light or its subclass
3) Have you imported these to your build.gradle
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1 or add them as jar if you are using eclipse
I also had these issues with the Android Studio designer in 1.4.
I uninstalled it and went back to 1.3.2, this version seems to work fine!
i had this problem and i've looked everywhere for answers and none could help me fix this bug. and my final solution is to reinstall android studio 1.3.2 and it worked just fine.
For Windows:
IDE + SDK bundle: https://dl.google.com/dl/android/studio/install/1.3.2.0/android-studio-bundle-141.2178183-windows.exe (1.1 GB)
For Mac:
DMG: https://dl.google.com/dl/android/studio/install/1.3.2.0/android-studio-ide-141.2178183-mac.dmg (351 MB)
Well i also face this problem so i Clean my project but still the error occur then i close Android Studio. And then again open it. and the error gone. this method solved my problem
here is my gradle file
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.project.apps.myproject"
minSdkVersion 21
targetSdkVersion 28
versionCode 7
versionName "1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'}
Go to File>Invalidate catches / Restart

Categories

Resources