How to solve unresolved superstypes - android

I am new to kotlin and I didn't manage to find a direct solution to this issue. I added a fragment class and layout to my project and it started showing this issue during execution.
The error states,
"Supertypes of the following classes cannot be resolved. Please make sure you have the right dependencies in the classpath: class androidx.app.appcompat.app.AppCompatActivty, unresolved supertypes: androidx.core.app.TaskStackBuilder.SupportParentable".
I have attached my gradle file contents.
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 28
defaultConfig {
applicationId "mapp.com.sg.mappfinalassignment"
minSdkVersion 19
targetSdkVersion 28
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
}
}
dependencies {
implementation 'com.android.support:appcompat-v7:28.0.+'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.0.0-beta01'
implementation 'androidx.constraintlayout:constraintlayout:1.1.2'
implementation 'com.google.android.material:material:1.0.0-beta01'
implementation 'androidx.legacy:legacy-support-v4:1.0.0-beta01'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
implementation 'com.android.support:recyclerview-v7:28.+'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-fragment:28.0.0'
implementation 'com.google.android:support-v4:r7'
}
repositories {
jcenter()
mavenCentral()
}
How do I get it to run?

You cannot use new AndroidX dependencies with the old ones. You can try to run Refactor > Migrate to AndroidX in your Android studio or convert you dependencies manually. Here is the documentation which will help you.

Related

issues in implementing firebase crash analytics

I am trying to implement firebase crash analytics for my android app I added the dependencies as as shown in firebase site,I also added the googleservices.json. Now after making changes I installed my map and it crashes.
I have attached screenshot of logcat. Please help me.
build.gradle of app
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 30
buildToolsVersion "30.0.1"
defaultConfig {
applicationId "com.android.quotesapp"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'com.android.support:design:28.0.0'
implementation("androidx.recyclerview:recyclerview:1.2.1")
// For control over item selection of both touch and mouse driven selection
implementation("androidx.recyclerview:recyclerview-selection:1.1.0")
implementation 'com.squareup.picasso:picasso:2.71828'
implementation("com.android.volley:volley:1.2.0")
implementation "androidx.cardview:cardview:1.0.0"
implementation platform('com.google.firebase:firebase-bom:28.3.1')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.firebase:firebase-core:19.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
Add the following in your gradle file:
apply plugin: 'com.google.firebase.crashlytics'
After
buildFeatures {
}
add
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Also add
implementation 'com.google.firebase:firebase-crashlytics:17.0.0'
Also in your project build.gradle if you have not added
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.0.0'
in dependencies then do so

get warning when running apps

Help me please.
I get a warning like this when installing a project on my cellphone
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
I have already updated Kotlin.
Now I use kotlin version 1.3.70 stable
I use Android Studio version 3.5.1
I use gradle version 5.4.1
this is my gradle on app level
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
compileSdkVersion 28
defaultConfig {
applicationId "com.lumbunginovasi.ludesid"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
versionNameSuffix 'default'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
flavorDimensions 'version'
productFlavors {
cs10 {
dimension 'version'
minSdkVersion 19
applicationId "com.lumbunginovasi.kepengbenang.pos"
versionNameSuffix 'pos_cs10'
}
base {
dimension 'version'
minSdkVersion 16
applicationId "com.lumbunginovasi.ludesid"
versionNameSuffix 'base'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation androidXDeps.appCompat
implementation androidXDeps.constraintlayout
implementation androidXDeps.material
implementation coroutineDeps.retrofit
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0-alpha02'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.3.0-alpha01'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha01'
implementation coroutineDeps.core
implementation coroutineDeps.android
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'com.facebook.stetho:stetho-okhttp3:1.5.0'
implementation 'com.google.android.play:core:1.6.1'
implementation project(':ludes_kasir')
implementation project(':ludes_ui')
implementation project(':ludes_core')
implementation project(path: ':ludes_products')
implementation project(path: ':ludes_api')
implementation project(path: ':ludes_sugarORM')
implementation project(path: ':ludes_account')
implementation project(path: ':bluetoothprinter')
implementation 'com.asksira.android:bsimagepicker:1.2.2'
cs10Implementation project(path: ':pos_cs10')
implementation project(path: ':internetservice')
implementation 'com.google.gms:google-services:4.3.3'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation project(path: ':sync_transaction')
}
thank you

Getting "Program type already present" Error When Building Signed APK

I added FFmpeg extension to my ExoPlayer implementation and started getting
the following error when trying to generate a signed APK:
Error: Program type already present: com.google.android.exoplayer2.analytics.AnalyticsCollector$Factory
I can generate a debug APK without problems. I tried to see the dependencies using ./gradlew app:dependencies, however I cannot see what's wrong and which configuration to examine.
I don't see where and which ExoPlayer library is added as duplicate.
Here is my build.gradle file:
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'io.fabric'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.acompany.anandroitvapp"
minSdkVersion 26
targetSdkVersion 27
versionCode 18
versionName "0.9.18_"
multiDexEnabled 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 {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:leanback-v17:27.1.1'
implementation 'com.android.support:preference-leanback-v17:27.1.1'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:support-tv-provider:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.github.bumptech.glide:glide:4.8.0'
// Injections
//compile 'com.google.dagger:dagger:2.12'
//annotationProcessor 'com.google.dagger:dagger-compiler:2.12'
//Retrofit Dependencies
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.exoplayer:exoplayer:2.8.3'
implementation 'com.google.android.exoplayer:extension-leanback:2.6.1'
implementation project(':exoplayer-extension-ffmpeg')
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
implementation 'com.google.firebase:firebase-perf:16.2.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
/* optional: for detailed logging */
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'io.reactivex.rxjava2:rxjava:2.1.14'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
}
apply plugin: 'com.google.gms.google-services'

App crashes after upgrading dependencies to latest version in android

I am getting following error after upgrading my project to the latest dependencies
Didn't find class "com.google.android.gms.common.util.zzq" on
path: DexPathList[[zip
file "/system/framework/org.apache.http.legacy.boot.jar",
zip file "/data/app/com.example.example-jBf5YcFyN-t4Cm8erTCBwQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.example-jBf5YcFyN-t4Cm8erTCBwQ==/lib/x86,
/system/lib]]"
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.example"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
// Enabling multidex support.
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled true
}
// buildToolsVersion '28.0.3'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:animated-vector-drawable:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:cardview-v7:27.1.1'
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:multidex:1.0.3'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'org.jsoup:jsoup:1.10.3'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.6'
implementation 'com.facebook.android:facebook-android-sdk:4.32.0'
implementation 'com.intuit.sdp:sdp-android:1.0.5'
/*map place autosuggest*/
//for calendar class
implementation 'joda-time:joda-time:2.9.9'
implementation 'de.hdodenhof:circleimageview:2.2.0'
//QB dependecies
implementation 'com.quickblox:quickblox-android-sdk-core:3.8.1'
implementation('com.quickblox:quickblox-android-sdk-chat:3.8.0') {
transitive = true
}
implementation 'com.quickblox:chat-message-adapter:2.0'
implementation 'com.quickblox:quickblox-android-sdk-content:3.8.0'
implementation 'com.timehop.stickyheadersrecyclerview:library:0.4.2#aar'
implementation 'com.github.orangegangsters:swipy:1.2.3#aar'
implementation project(':sample-core')
// implementation 'com.jwang123.flagkit:flagkit:1.0'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'
//GoogleServicesPlugin.config.disableVersionCheck = true
Can anyone guide me how to solve this issue.
I have been searching stackoverflow from last two days for the solution of this issue. Please help.
Ensure that your top-level build.gradle contains a reference to the google() repo or to maven { url "https://maven.google.com" }.
remove this from your build.gradle file and sync again
apply plugin: 'com.google.gms.google-services'

Could not resolve com.android.support:recyclerView-v7:26.1.0

In my app I am using RecyclerView for that I have added the dependency file in the Gradle after that I can't run my project because of the error I have put in the title.
Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.nemuees.www.reminder"
minSdkVersion 21
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 fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:recyclerView-v7:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-vector-drawable:26.1.0'
implementation 'com.android.support:support-v4:26.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 'com.android.support:design:26.1.0'
implementation 'com.android.support:gridlayout-v7:26.1.0'
}
And I have referred some SO post regarding this error and put this in my build.gradle
allprojects {
repositories {
google()
jcenter()
maven{
url "https://maven.google.com"
}
}
}
And I have Unchecked the offline Work in Gradle Settings
Can anyone help me to solve this.
May be because you forgot to add buildToolsVersion.
Like
compileSdkVersion 27
buildToolsVersion "27.0.1"
Also it seems looking design dependency added twice so remove that define it once only.
implementation 'com.android.support:design:26.1.0'

Categories

Resources