I'm changing the minSdk version but when I build/generate apk(s) I get this error:
failed linking references.
I have tried Invalidating Caches and restarting
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.clubs"
minSdkVersion 21
targetSdkVersion 27
vectorDrawables.useSupportLibrary = true
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
productFlavors {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0-alpha02'
implementation 'com.google.android.material:material:1.1.0-alpha04'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'nl.psdcompany:duo-navigation-drawer:3.0.0'
implementation 'com.github.ApendIr:slider:1.0'
implementation 'com.azoft.carousellayoutmanager:carousel:1.2.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.2-alpha01'
implementation 'com.jakewharton:butterknife:10.1.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.2-alpha01'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
}
I don't know if this is what is resulting to the apps crashing in some phones
Set the min SDK version within your project's AndroidManifest.xml file:
<uses-sdk android:minSdkVersion="21"/>
Related
earlier was working fine but the time i updated the versions of libraries it went wrong
here is the app.gradle file, also tested with compile version 27 and 28 as well
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.test"
minSdkVersion 19
targetSdkVersion 26
multiDexEnabled true
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
}
}
after changing dependendencies to androidX version , issue is there
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0-alpha02'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
implementation 'com.google.android.material:material:1.1.0-alpha04'
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha03'
implementation 'com.lsjwzh:materialloadingprogressbar:0.5.8-RELEASE'
implementation 'com.jakewharton:butterknife:10.1.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support:multidex:1.0.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
in build.gradle file
classpath 'com.android.tools.build:gradle:3.1.2'
I am trying to implement Playback Notifications with ExoPlayer. But getTitle,getDescription,createPendingIntent(), getLargeIcon are missing and android studio is showing red (Cannot resolve method). How can i get these?
I wrote my code exactly same as the link. I tried it multiple times.
This is my build.gradle file (if required):
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.mediaplayertest"
minSdkVersion 18
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
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:support-media-compat:28.0.0"
implementation "com.android.support:support-compat:28.0.0"
implementation 'com.google.android.exoplayer:exoplayer:2.9.5'
}
You need to define the gradle implementation correctly.
From The hello world example
implementation 'com.google.android.exoplayer:exoplayer-core:2.X.X'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.X.X'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.X.X'
In your gradle build script you have asked for the just "exoplayer"
NOTE: that for the PlaybackNotificationManager class you will need exoplayer-ui meaning for that particular class you would just need
implementation 'com.google.android.exoplayer:exoplayer-ui:2.9.5' but I would also include exoplayer-core
An error occurred when I wrote this syntax to add the picasso library.
(More than one file was found with OS independent path 'okhttp3/internal/publicsuffix/publicsuffixes.gz')
My android gradle is as follows!!
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.i203_153.smarthome"
minSdkVersion 24
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'
}
}
productFlavors {
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.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 files('libs/jackson-annotations-2.1.2.jar')
implementation files('libs/com.fasterxml.jackson.core.jar')
implementation files('libs/com.fasterxml.jackson.databind.jar')
}
How do I fix the following errors? Please help me!!
Try this
compile 'com.squareup.picasso:picasso:2.5.0'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.oneca.myapplication"
minSdkVersion 22
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(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
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 files('libs/mysql-connector-java-8.0.11.jar')}
this is the data in the build.gradle. No grammar error in the java file. what is wrong.
Update your minSdkVersion.
minSdkVersion 24
because your lib implementation files('libs/mysql-connector-java-8.0.11.jar')}
not support below SdkVersion 24.
I used 1.3.4 version and everything was fine but I started using 2.1.9 version and I have mistake"Cannor resolve symbol 'rx'"
This is my Gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.max.project_oo1_client_server"
minSdkVersion 15
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'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
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'
compile 'io.reactivex.rxjava2:rxjava:2.1.9'
compile 'com.squareup.okhttp3:okhttp:3.9.1'
}
the problem is in your import statements.
Search : import rx.Observable;
Replace: import io.reactivex.Observable;
repeat this for all classes.
you can use search and replace but be carefull :
Ctrl+Shift+R on Windows and Linux/Ubuntu
Cmd+Shift+R on Mac OS X