I have created a news app in which I want to use navigation drawer,but when I add a navigation drawer activity it is giving some errors.Even if I make a new project with navgiation drawer properties,its still giving errors.
I have created a news app in which I want to use navigation drawer,but when I add a navigation drawer activity it is giving some errors.Even if I make a new project with navgiation drawer properties,its still giving errors.
> Task :prepareKotlinBuildScriptModel UP-TO-DATE
Warning: Failed to parse host Vitika
Warning: Failed to parse host Vitika
Failed to parse host Vitika
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk16:1.3.72.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app#debugUnitTest/compileClasspath': Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk16:1.3.72.
Show Details
Affected Modules: app
Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve org.jetbrains.kotlin:kotlin-stdlib-jdk16:1.3.72.
Show Details
Affected Modules: app
Build.gradle(Project:News)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.72'
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.3"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Build.gradle(Module:app)
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.vitika.news"
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'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
//noinspection DataBindingWithoutKapt
dataBinding true
}
repositories{
maven{ url 'http://repo1.maven.org/maven2'}
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk16:$kotlin_version"
implementation 'androidx.core:core-ktx:1.3.2'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.android.volley:volley:1.2.0'
implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
implementation "androidx.browser:browser:1.3.0"
def fragment_version = "1.3.3"
// Java language implementation
implementation "androidx.fragment:fragment:$fragment_version"
// Kotlin
implementation "androidx.fragment:fragment-ktx:$fragment_version"
def nav_version = "2.3.5"
// Java language implementation
implementation "androidx.navigation:navigation-fragment:$nav_version"
implementation "androidx.navigation:navigation-ui:$nav_version"
// Kotlin
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
// Feature module Support
implementation "androidx.navigation:navigation-dynamic-features-fragment:$nav_version"
// Testing Navigation
androidTestImplementation "androidx.navigation:navigation-testing:$nav_version"
// Jetpack Compose Integration
implementation "androidx.navigation:navigation-compose:1.0.0-alpha10"
implementation 'com.google.android.material:material:1.3.0'
}
gradle.properties
## 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.
# Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# 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
#Wed May 19 16:22:21 IST 2021
systemProp.https.proxyHost=Vitika
systemProp.https.proxyPort=8080
Available jdk is jdk8 or jdk7 not jdk16.
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
Related
I am trying to add subititle under the video while video play. And I used firebase to store my data in the project. I have implemented a lot since I started the project, so it was a bit confusing. So I am getting some errors.
My errors
Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
Caused by: java.lang.RuntimeException: Duplicate class com.google.api.Advice found in modules jetified-proto-google-common-protos-2.8.3 (com.google.api.grpc:proto-google-common-protos:2.8.3) and jetified-protolite-well-known-types-18.0.0-runtime (com.google.firebase:protolite-well-known-types:18.0.0)
Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
Caused by: com.android.builder.merge.DuplicateRelativeFileException: 5 files found with path 'META-INF/INDEX.LIST' from inputs:
Caused by: com.android.builder.merge.DuplicateRelativeFileException: 5 files found with path 'META-INF/INDEX.LIST'.
build.gradle(:app)
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}
android {
compileSdk 31
defaultConfig {
applicationId "com.talhakara.uzaktanegitimbitirmeprojesi"
minSdk 23
targetSdk 30
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
}
buildFeatures {
viewBinding true
dataBinding true
}
}
def multidex_version = "2.0.1"
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'androidx.annotation:annotation:1.2.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation 'com.google.android.gms:play-services-tasks:17.2.1'
implementation 'androidx.navigation:navigation-fragment:2.3.5'
implementation 'androidx.navigation:navigation-ui:2.3.5'
implementation files('libs\\jmxri-1.2.1.jar')
implementation files('libs\\jmxtools-1.2.1.jar')
implementation files('libs\\jmxri-1.2.1.jar')
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation platform('com.google.firebase:firebase-bom:29.0.0')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.google.firebase:firebase-auth'
//implementation 'com.google.firebase:firebase-firestore'
implementation 'com.google.firebase:firebase-storage'
implementation 'com.google.firebase:firebase-core:20.1.0'
implementation 'com.google.firebase:firebase-messaging:23.0.0'
implementation 'com.google.firebase:firebase-appindexing:20.0.0'
implementation 'com.google.firebase:firebase-invites:17.0.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.google.firebase:firebase-firestore:24.0.1'
implementation 'com.firebaseui:firebase-ui-auth:4.0.0'
implementation 'com.google.firebase:firebase-analytics:17.2.1'
implementation 'com.google.firebase:firebase-database:19.2.0'
implementation ('org.jitsi.react:jitsi-meet-sdk:2.9.0') { transitive = true }
implementation fileTree(include: ['*.jar'], dir: 'libs')
//google cloud speech recognition
//implementation platform('com.google.cloud:libraries-bom:25.4.0')
implementation 'com.google.cloud:google-cloud-speech'
implementation 'com.google.cloud:google-cloud-speech:2.3.0'
// implementation 'io.grpc:grpc-okhttp:1.46.0'
// implementation 'com.google.cloud:google-cloud-speech:2.3.0-alpha'
//
//implementation "androidx.multidex:multidex:$multidex_version"
/* implementation('log4j:log4j:1.2.15') {
exclude group: 'javax.jms', module: 'jms'
}*/
}
gradle-wrapper.properties
#Tue Jun 14 14:42:54 TRT 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
setting.gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
maven {
url "https://github.com/jitsi/jitsi-maven-repository/raw/master/releases"
}
}
}
rootProject.name = "UzaktanEgitimBitirmeProjesi"
include ':app'
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=-Xmx2048m -Dfile.encoding=UTF-8
# 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=true
build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()// mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.0'
classpath 'com.google.gms:google-services:4.3.10'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I am getting duplicate class error also. I tried to solve this problem as much as I could, so I commented the dependcys that I thought were duplicates in build.gradle, but I still get an error. what could be the problem?
Try to change your build.gradle(:app).
Replace:
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}
with
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
Error Code : FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:dataBindingMergeDependencyArtifactsDebug'.
> Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not resolve org.readium:r2-parser:0.1.5.
Required by:
project :app > com.folioreader:folioreader:0.3.9
project :app > org.readium:r2-fetcher:0.1.5
> Skipped due to earlier error
> Could not resolve org.readium:r2-server:0.1.5.
Required by:
project :app > com.folioreader:folioreader:0.3.9
> Skipped due to earlier error
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 26s
1 actionable task: 1 executed
My gradle.build :
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'com.google.gms:google-services:4.3.10'
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url "http://dl.bintray.com/mobisystech/maven"}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
& also the one in "app" folder
apply plugin: 'com.android.application'
android {
signingConfigs {
}
compileSdkVersion 27
defaultConfig {
applicationId "com.suusoft.ebook"
minSdkVersion 16
targetSdkVersion 27
versionCode 4
versionName '1.3'
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
debuggable false
}
}
buildFeatures {
dataBinding true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
implementation 'com.android.support:support-vector-drawable:27.1.1'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.android.volley:volley:1.2.1'
implementation 'com.github.lsjwzh.RecyclerViewPager:lib:v1.1.1'
implementation 'com.google.android.gms:play-services-auth:16.0.0'
implementation 'me.relex:circleindicator:1.2.1#aar'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.android.support.constraint:constraint-layout:2.0.4'
implementation 'com.joooonho:selectableroundedimageview:1.0.1'
implementation 'com.github.barteksc:android-pdf-viewer:2.1.0'
implementation 'com.google.android.gms:play-services-ads:20.6.0'
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.devbrackets.android:exomedia:4.1.0'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.folioreader:folioreader:0.3.9'
implementation 'com.android.support:multidex:1.0.3'
implementation platform('com.google.firebase:firebase-bom:29.2.1')
implementation 'com.google.firebase:firebase-messaging:23.0.2'
}
apply plugin: 'com.google.gms.google-services'
I've tried several ways including :
Reinstall Android Studio and tried another version
Allow auto detect proxy (but i think I'm not connected to any proxies)
Invalidate / Restart IDE
Is there something I miss? Or is there some repository which is out of date / wrong version? Or even wrong code? Please help me, any answer would be appreciated ^_^
I'm in the process of converting my android app from using simple file IO to using a proper database, so I've been going through the tutorials for Android Jetpack's Room. I'm having problems trying to specify the room.schemaLocation argument. My build.gradle file looks like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 31
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.austinweaver.myapp"
minSdkVersion 16
targetSdkVersion 31
multiDexEnabled true
versionCode 13
versionName "2.4.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
* javaCompileOptions {
* annotationProcessorOptions {
* arguments += ["room.schemaLocation": "$projectDir/schemas".toString()]
* }
* }
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.preference:preference:1.1.1'
implementation 'com.google.android.gms:play-services-auth:20.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.google.android.gms:play-services-ads:20.5.0'
implementation 'com.android.support:multidex:1.0.3'
implementation ('io.socket:socket.io-client:2.0.0') {
exclude group: 'org.json', module: 'json'
}
implementation "androidx.room:room-runtime:2.4.0"
annotationProcessor "androidx.room:room-compiler:2.4.0"
androidTestImplementation "androidx.room:room-testing:2.4.0"
}
The block marked with the *s is the issue: without it, my app runs fine but tells me to specify the room.schemaLocation. With that block, the gradle sync works but then the app build fails with the following message:
Unable to find method 'java.nio.file.Path.of(Ljava/lang/String;[Ljava/lang/String;)Ljava/nio/file/Path;'
java.nio.file.Path.of(Ljava/lang/String;[Ljava/lang/String;)Ljava/nio/file/Path;
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
I've tried restarting Android Studio and tried some scattered solutions I found by trying to google the error message, but all the relevant things I found were deprecated or didn't work.
Let me know if there's any information I should have included here, because I'm not sure what else in my project even relates to this. Thanks for any help!
Edit: my project-level build.gradle:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'com.google.gms:google-services:4.3.10'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
If i tap the Debug Icon, Android Studio sometimes automatically creates new BuildConfig files and then complains that it should be only one named Buildconfig.java...
A Clean Project fixes it but it is so annoying that there must be a reliable solution.
Thanks in advance
EDIT:
My build.gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.72'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
My build.gradle(Module: app):
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "de.my.app.id"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
// To inline the bytecode built with JVM target 1.8 into
// bytecode that is being built with JVM target 1.6. (e.g. navArgs)
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.navigation:navigation-fragment:2.2.2'
implementation 'androidx.navigation:navigation-ui:2.2.2'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.2.2'
implementation 'androidx.navigation:navigation-ui-ktx:2.2.2'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.github.siyamed:android-shape-imageview:0.9.3#aar'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.github.RobertApikyan:SegmentedControl:1.2.0'
implementation 'androidx.viewpager2:viewpager2:1.0.0'
implementation 'com.h6ah4i.android.materialshadowninepatch:materialshadowninepatch:1.0.0'
}
EDIT:
I get this error warning in my console when i build & debug:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
Try following ways in order of listing:
Select Make Project from Build menu.
Go to File menu and select Invalidate Cache/restart.
Change the distributionUrl in gradle-wrapper.properties to some other versions (higher one preferred).
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
Update Android studio.
I'm working on an Android Studio project and today when i opened it up all of a sudden this started happening.
Could not find matching constructor for: org.gradle.api.internal.artifacts.ivyservice.ivyresolve.VersionInfo(java.lang.String)
I've already tried to change the gradle versions around but nothing works. Also, I've tried the classic "clean project", "rebuild project" and "invalidate caches and restart"
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.or g/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-XX\:MaxHeapSize\=512m -Xmx512m
# 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
app level gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.25.4'
}
}
plugins {
id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.7.0'
}
apply plugin: 'com.android.application'
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'kotlin-android'
apply plugin: 'io.fabric'
android {
dataBinding {
enabled = false
}
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.virtualflight.VirtualHub"
minSdkVersion 19
targetSdkVersion 28
versionCode 58
versionName "4.0.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
android {
vectorDrawables.useSupportLibrary = true
defaultConfig.applicationId="com.virtualflight.VirtualHub"
defaultConfig {
manifestPlaceholders = [onesignal_app_id: "977e8aef-4b31-4d36-91e4-2555572b9efe",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
customDebugType {
debuggable true
}
}
productFlavors {
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}
repositories {
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.1-alpha01', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//Google dependencies bellow
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation 'com.sothree.slidinguppanel:library:3.4.0'
testImplementation 'junit:junit:4.12'
//Mapbox dependencies bellow
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.8.1'
implementation 'com.mapbox.mapboxsdk:mapbox-android-services:2.1.0'
implementation 'com.mapbox.mapboxsdk:mapbox-java-core:2.1.0'
implementation 'com.mapbox.mapboxsdk:mapbox-java-services:2.1.0'
implementation 'com.mapbox.mapboxsdk:mapbox-java-services-rx:2.1.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-services:2.1.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-telemetry:3.5.7'
implementation 'com.mapbox.mapboxsdk:mapbox-android-ui:2.1.0'
implementation('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
implementation files('libs/volley.jar')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.github.barteksc:android-pdf-viewer:3.1.0-beta.1'
implementation 'com.karumi:dexter:5.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha04'
implementation 'androidx.appcompat:appcompat:1.1.0-alpha02'
implementation 'com.github.AppIntro:AppIntro:v5.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
}
project level gradle
buildscript {
ext.kotlin_version = '1.2.51'
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
maven { url "https://jitpack.io" }
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I realised that OneSignal was causing the issue. I have "solved" this by removing OneSignal as a whole as I wasn't using that anymore.
Downgrade your gradle version below to 4.9