Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.Predicate - android-jack-and-jill

I have an external jar library . i can import this file in intellij idea without any problem with java 8 . but when i add this file to android studio , i got this Error
Error:ApiClass.java:114-115: Lambda coming from jar file need their interfaces on the classpath to be compiled, unknown interfaces are java.util.function.Predicate
any one can help me ?
build gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "insta.ir.instagramfollowercustomer"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled = true
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'
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
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:24.2.1'
compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
testCompile 'junit:junit:4.12'
compile files('libs/InstaNewLibraryProject.jar')
}
and gradle propertis :
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.daemon=true
org.gradle.parallel=true

Related

How to fix 'sdk-base' and 'sdk-panowidget' error in Android studio

I'm working on a software that uses daydream controller to switch VR images, using package conflicts,The package used to display the picture is 'sdk-panowidget', and the package used to control the handle is 'sdk-base'.
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.wolfwang.demo_vr"
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.google.vr:sdk-base:1.190.0'
implementation 'com.google.vr:sdk-panowidget:1.40.0'
api fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testImplementation 'junit:junit:4.12'
implementation fileTree(dir: 'lib', include: ['*.aar', '*.jar'], exclude: [])
}
implementation 'com.google.vr:sdk-base:1.190.0'
implementation 'com.google.vr:sdk-panowidget:1.40.0'
Help me solve problems

The SourceSet 'testLocal' is not recognized by the Android Gradle Plugin. Perhaps you misspelled something?

i am trying to compile app on android studio but i am getting the following error
"The SourceSet 'testLocal' is not recognized by the Android Gradle Plugin. Perhaps you misspelled something?"
i am running the following
android studio 3.1.4
build-gradle-4.4-all
here below the code used
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.felkertech.n.cumulustv"
minSdkVersion 21
targetSdkVersion 28
versionCode 65
versionName '1.7.9'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testApplicationId 'com.felkertech.n.cumulustv.test'
}
signingConfigs {
debug {
}
}
buildTypes {
debug {
signingConfig signingConfigs.debug
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
sourceSets { testLocal { setRoot('src/test') } }
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
dexOptions {
jumboMode = true
}
}
any ideas or hints that could help me will be appreciated
Ok so i found the ansewer
the correct code should be
sourceSets
{
androidTest
{
setRoot 'src/test'
}
}
instead of
sourceSets { testLocal { setRoot('src/test') } }

Unable to load the layout file

I have already checked the link But my problem is in version 28.
Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.pankaj.socketio"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.+'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
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'
}
I am getting an error in the layout. Is there anything missing?
Failed to load AppCompat ActionBar with unknown error.

Rendering Error Cardview android studio 3.1 and appCompact Theme Error

I get the problem within android studio regarding cardview rendering error and appCompact Theme Error. here is the screenshot and the gradle code
Android Notification
App Theme error
I have tried this solution and still doesn't work
----Here is the gradle code----
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.shirazikudou.firebase4"
minSdkVersion 23
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard- android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso- core:2.2.2', {
exclude group: 'com.android.support', module: 'support- annotations'
})
api 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint- layout:1.1.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
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:cardview-v7:27.+'
implementation 'com.android.support:design:27.1.1'
}
apply plugin: 'com.google.gms.google-services'

Can I use the recent Java 8 support for Android with Gluon Mobile?

Google released a few months ago a gradle plugin for java 8 support on Android API level 24 and up. This is achieved by adding the dependency to the gradle build file:
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:2.4.0-alpha7'
}
}
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
Is this supported with Gluon Mobile?
I have installed builds tools 25.0.3, and without any modification at all of the build.gradle file that the Gluon plugin generates on a Single View project:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.3.8'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
jcenter()
maven {
url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
}
}
mainClassName = 'com.gluonandroid24.GluonAndroid24'
dependencies {
compile 'com.gluonhq:charm:4.3.7'
}
jfxmobile {
downConfig {
version = '3.6.0'
// Do not edit the line below. Use Gluon Mobile Settings in your project context menu instead
plugins 'display', 'lifecycle', 'statusbar', 'storage'
}
android {
manifest = 'src/android/AndroidManifest.xml'
}
ios {
infoPList = file('src/ios/Default-Info.plist')
forceLinkClasses = [
'com.gluonhq.**.*',
'javax.annotations.**.*',
'javax.inject.**.*',
'javax.json.**.*',
'org.glassfish.json.**.*'
]
}
}
I can include Java 8 streams:
public BasicView(String name) {
super(name);
Label label = new Label("Hello JavaFX World!");
Button button = new Button("Change the World!");
button.setGraphic(new Icon(MaterialDesignIcon.LANGUAGE));
button.setOnAction(e -> label.setText("Sum: " + Stream.of("1", "2", "5")
.mapToInt(Integer::parseInt)
.sum()));
VBox controls = new VBox(15.0, label, button);
controls.setAlignment(Pos.CENTER);
controls.getChildren().stream()
.filter(Label.class::isInstance)
.forEach(System.out::println);
setCenter(controls);
}
and run the project on Desktop and deploy it and run it successfully on Android (at least on my device with Android 7.1.1). Obviously not on iOS.
The jfxmobile plugin already looks for the latest build-tools version you have installed at $AndroidSdk/build-tools. In case you want to set some options, you could set:
jfxmobile {
...
android {
manifest = 'src/android/AndroidManifest.xml'
buildToolsVersion = '25.0.3'
compileSdkVersion = '25'
minSdkVersion = '25'
targetSdkVersion = '25'
}
}

Resources