Unable to load the layout file - android-studio-3.0

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.

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') } }

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'

Implementation project Android Studio 3.0

android studio multiple modules project
Where can the problem be?
Error Messages Print Screen -
project build.gradle
buildscript { repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app build.gradle
...
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation project(':t2')
}
Setting gradle
include ':app', ':t2'
This problem has been fixed with the new versions of Gradle(v3.3.0) and AndroidStudio(v3.3).

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

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

Resources