I just Convert my project to androidX and project build successfully. But when I want to run that time it's created this error in android studio 3.5.3 with java enabled.
Here's my project gradle:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.google.gms:google-services:4.3.3'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
My module gradle file: All dependency I add here.
apply plugin: 'com.android.application'
android {
dataBinding {
enabled = true
}
compileSdkVersion 28
defaultConfig {
applicationId "com.exam.test"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
signingConfig signingConfigs.release
}
}
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
//Dependencies
dependencies {
api 'com.google.android.material:material:1.0.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
implementation 'com.google.android.gms:play-services-location:16.0.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
implementation 'com.google.code.gson:gson:2.8.5'
implementation('com.crashlytics.sdk.android:crashlytics:2.8.0#aar') {
transitive = true
}
implementation 'androidx.biometric:biometric:1.0.1'
}
apply plugin: 'com.google.gms.google-services'
googleServices.disableVersionCheck = true
Build output: Here pom details not download when running the application
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugAnnotationProcessorClasspath'.
> Could not resolve androidx.databinding:databinding-compiler:3.5.3.
Required by:
project :app
> Could not resolve androidx.databinding:databinding-compiler:3.5.3.
> Could not get resource 'https://dl.google.com/dl/android/maven2/androidx/databinding/databinding-compiler/3.5.3/databinding-compiler-3.5.3.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/androidx/databinding/databinding-compiler/3.5.3/databinding-compiler-3.5.3.pom'.
> Remote host closed connection during handshake
* 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.
these type of problems occure because of some library are not in harmoney with each other
then you should update maybe your problem will be gone .
i had same problem and now resolved it.
first upgrade your gradle
distributionUrl=https://services.gradle.org/distributions/gradle-5.6.4-all.zip
second update your kotlin-plugin
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.61"
third update your android studio to last version 3.6 or higher
note : this part maybe show error then you should update your constraint layout
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta3'
i hope you resolve it
Finally, I solved it by increasing internet speed.
It's because of internet issues. As regular internet, it's created problems. But when I increased internet speed now the problem is solved.
Now it's working properly.
Related
My App was working perfectly and smoothly without adding the applovin SDK, how do I solve the issue of the problem that I encountered?
Here's my Gradle file (Root)
buildscript {
repositories {
maven { url 'https://artifacts.applovin.com/android' }
google()
}
dependencies {
//4.3.1
classpath 'com.android.tools.build:gradle:4.3.1'
classpath 'com.google.gms:google-services:4.3.10'
classpath "com.applovin.quality:AppLovinQualityServiceGradlePlugin:3.0.0"
}
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.1.1' apply false
id 'com.android.library' version '7.1.1' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Here's my Gradle app level
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'applovin-quality-service'
applovin {
apiKey "OkvHFuab6SR_8RzKBqWGvaAdGFTuBmTQiITRJzo2fV0PulrwAyX1OfftyR3O9JsC5eGR7vbUp76zHLFI6TQ1FF"
}
android {
compileSdk 31
defaultConfig {
applicationId "com.test.app"
minSdk 21
targetSdk 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
//FIREBASE
implementation platform('com.google.firebase:firebase-bom:28.0.0')
implementation 'com.google.android.gms:play-services-auth:20.2.0'
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-database:'
implementation 'com.firebaseui:firebase-ui-database:8.0.1'
implementation 'com.google.firebase:firebase-storage'
//CONSTANT SIZE
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation 'com.intuit.ssp:ssp-android:1.0.6'
//NEUMORPH
implementation 'com.github.fornewid:neumorphism:0.3.0'
//ANIMATED BOTTOM BAR NAVIGATION
implementation 'com.github.chetankoli1.BottomNavigation:chetanbottomnavigation:0.0.3'
//LOAD IMAGES FROM ONLINE
implementation 'com.github.bumptech.glide:glide:4.13.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.13.0'
//CIRCLE IMAGE
implementation 'de.hdodenhof:circleimageview:3.1.0'
//ADS
implementation 'com.applovin:applovin-sdk:11.4.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.6.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
This is the error that i am getting when trying to run the app
> Task :app:safedkAdjustInputsDebug FAILED
AGPBI: {"kind":"warning","text":"API 'MergedFlavor.getApplicationId()' is obsolete and has been replaced with 'Variant.getApplicationId()'.\nIt will be removed in version 7.0 of the Android Gradle plugin.\nGradle Properties must be used to change Variant information.\nFor more information, see https://d.android.com/r/tools/use-properties.\nTo determine what is calling MergedFlavor.getApplicationId(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.","sources":[{}]}
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:processDebugManifest'.
> Error processing manifest file for variantdebug
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:processDebugManifest'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:188)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:186)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:174)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
API 'MergedFlavor.getApplicationId()' is obsolete and has been replaced with 'Variant.getApplicationId()'.
It will be removed in version 7.0 of the Android Gradle plugin.
Gradle Properties must be used to change Variant information.
For more information, see https://d.android.com/r/tools/use-properties.
To determine what is calling MergedFlavor.getApplicationId(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
https://docs.gradle.org/7.2/userguide/validation_problems.html#missing_annotation for more details about this problem.
- In plugin 'applovin-quality-service' type 'com.safedk.gradleplugin.tasks.AdjustInstrumentationInputsTask' property 'variant' is missing an input or output annotation.
Reason: A property without annotation isn't considered during up-to-date checking.
Possible solutions:
1. Add an input or output annotation.
2. Mark it as #Internal.
To make it short, here's the cause of the problem
org.gradle.api.GradleException: Error processing manifest file for variantdebug
and,
Caused by: groovy.lang.MissingPropertyException: Could not get unknown property 'manifestOutputDirectory' for task ':app:processDebugManifest' of type com.android.build.gradle.tasks.ProcessMultiApkApplicationManifest.
Any help is highly appreciable
I am new to android, when compiling I get this error, it is a bit weird, because until not long ago I did not get it, and I have not made any important change in the project that I remember, and I tried to synchronize gradle, but it gives me 404 error, and I tried to find where this dependency is, because I haven't put any, so I have no idea, I'm quite confused, I thought it was going to be an easy problem to solve, but I can't find a solution, I can't do anything with the 404 error, I am using Avira VPN and Turbo VPN to connect, because without vpn it is impossible in my country, thanks to them I can develop in android, if someone could tell me if I have to add something to the gradle files or remove something I would appreciate it, I am quite stressed about it, android studio errors get over me sometimes This is all it shows me when I sync:
Failed to resolve: customview-1.1.0
Affected Modules: app
This shows me when I try to compile:
note: here is the url that gives me error:
1: Task failed with an exception.
What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
Could not resolve all files for configuration ':app:debugCompileClasspath'.
Could not find customview-1.1.0.jar (androidx.customview:customview:1.1.0).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/customview/customview/1.1.0/customview-1.1.0.jar
gradle app
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
compileSdkVersion 30
buildToolsVersion '30.0.2'
defaultConfig {
applicationId "com.example.navigationrecicler"
minSdkVersion 24
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
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.2.0'
def work_version = "2.6.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'androidx.drawerlayout:drawerlayout:1.1.1'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
implementation "androidx.work:work-runtime-ktx:$work_version"
implementation "com.anggrayudi:storage:0.12.0"
implementation 'com.github.skydoves:progressview:1.1.2'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.github.mmin18:realtimeblurview:1.2.1'
implementation 'com.yarolegovich:discrete-scrollview:1.5.1'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
implementation 'com.github.CanHub:Android-Image-Cropper:3.3.5'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
gradle proyect
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.5.10"
repositories {
google()
mavenCentral()
maven { url "https://www.jitpack.io" }
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://www.jitpack.io" }
jcenter() // Warning: this repository is going to shut down soon
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
If your problem is with connection , then here is how to solve this
Using your proxy or psiphon , you can set the local proxy port in your setting , lets say 30001
then you can go to %USERNAME%/.gradle/gradle.properties , if the file do not exist then create one.
then you can add this to gradle.properties
systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=30001
systemProp.https.proxyHost=8.36.224.208
systemProp.https.proxyPort=30001
this will make sure that all connection that gradle use , will go over the turned on proxy .
And after checking the dependencies , you dont have this dependency
runtimeOnly 'androidx.customview:customview:1.1.0'
I am implemented VirtualAPK library and failed to build project
My Project gradle file:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.didi.virtualapk:gradle:0.9.8.6'
// 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
}
Also I implemented library and applied as per library guide in Module gradle:
apply plugin: 'com.android.application'
apply plugin: 'com.didi.virtualapk.host'
android {
compileSdkVersion 28
dataBinding {
enabled = true
}
defaultConfig {
applicationId "com.example.vspace"
minSdkVersion 19
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'
}
}
}
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'
implementation 'com.didi.virtualapk:core:0.9.8'
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'
}
And after that I am trying to build project and getting Error like():
Compiling with JDK Java compiler API.
Created classpath snapshot for incremental compilation in 0.024 secs.
[INFO][VAHostPlugin] Used compileClasspath: debug
> Task :app:compileDebugJavaWithJavac FAILED
:app:compileDebugJavaWithJavac (Thread[Daemon worker,5,main]) completed. Took 2.586 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> java.lang.NoSuchMethodException: No similar method computeBuildMapping with params [class org.gradle.invocation.DefaultGradle_Decorated] could be found on type class com.android.build.gradle.internal.ide.ModelBuilder.
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
I was also tried to downgrade and upgrade gradle version and also tried with old Android Studio 3.0.1 and with 3.4.1. But nothing is working here. So, if any one can help then its surely acceptable.
I also refers This question but its can't helped me.
VirtualApk is doing this.....and computeBuildMapping is not supported(based on error in your post) in gradle 3.4.1.
if (project.extensions.extraProperties.get(Constants.GRADLE_3_1_0)) {
ImmutableMap<String, String> buildMapping = Reflect.on('com.android.build.gradle.internal.ide.ModelBuilder')
.call('computeBuildMapping', project.gradle)
.get()
compileArtifacts = ArtifactDependencyGraph.getAllArtifacts(
applicationVariant.variantData.scope, AndroidArtifacts.ConsumedConfigType.COMPILE_CLASSPATH, null, buildMapping)
} else {
compileArtifacts = ArtifactDependencyGraph.getAllArtifacts(
applicationVariant.variantData.scope, AndroidArtifacts.ConsumedConfigType.COMPILE_CLASSPATH, null)
}
so, try building your project with gradle plugin 3.1.0 and gradle version 4.4
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
I was trying to add firebase auth to my android project but getting this error.
I have tried adding 'com.google.firebase:firebase-core:16.0.3' too but its taking more than 40 mins and still not syncing the gradle.
This is build.gradle file:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "myaid.startup"
minSdkVersion 21
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'
}
}
}
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'
implementation 'com.google.firebase:firebase-auth:16.0.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'
}
This is app.gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.google.gms:google-services:4.1.0'
// 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
}
This is the error:
FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring root project 'MyAid'.
Could not resolve all artifacts for configuration ':classpath'.
Could not resolve com.android.tools.build:gradle:3.3.2.
Required by:
project :
Could not resolve com.android.tools.build:gradle:3.3.2.
Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.3.2/gradle-3.3.2.pom'.
Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.3.2/gradle-3.3.2.pom'.
Connection reset
Could not resolve com.android.tools.build:gradle:3.3.2.
Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.3.2/gradle-3.3.2.pom'.
Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.3.2/gradle-3.3.2.pom'.
Connection reset
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
CONFIGURE FAILED in 2m 13s ERROR: Connection reset
I have resolved this problem by removing all my .gradle files, SDK files, .m2 files, .androidstudio files and then re-installing it.
Followed this answer: How to completely uninstall Android Studio
Please check your gradle's proxy settings. Enable it or disable it in the following file:
~/.gradle/gradle.properties
Like:
systemProp.https.proxyPort=1080
systemProp.http.proxyHost=127.0.0.1
systemProp.https.proxyHost=127.0.0.1
systemProp.http.proxyPort=1080
Advices:
If your connection to repositories is not stable, use a proxy
instead of direct connection.
If you used to use a proxy for
gradle, check if it is still working.
My app worked fine but after running it a few times I got a problem with the gradle build. (Android Studio: failed to complete gradle execution, cause is empty) i've restarted my computer and before trying to fix the issue it showed me that I have an update for a few thing in android studio. After the update it asked me to update some versions of implementation in the gradle and then the "com.google.gms:google-services" version in the project gradle. After doing so I get an error saying "IDE error occured" when trying to do a build.
The exception is occuring in the Android Support Plugin.
The exception details:
null
java.lang.NullPointerException
at com.android.tools.idea.run.tasks.InstantRunNotificationTask.<init>(InstantRunNotificationTask.java:64)
at com.android.tools.idea.fd.InstantRunBuildAnalyzer.getNotificationTask(InstantRunBuildAnalyzer.java:188)
at com.android.tools.idea.run.AndroidLaunchTasksProvider.getTasks(AndroidLaunchTasksProvider.java:122)
at com.android.tools.idea.run.LaunchTaskRunner.run(LaunchTaskRunner.java:102)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:713)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:157)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:543)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:488)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:144)
at com.intellij.openapi.progress.impl.ProgressManagerImpl$2.run(ProgressManagerImpl.java:165)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:315)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Project gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.google.gms:google-services:3.2.1' // google-services plugin
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven {
url "https://maven.google.com" // Google's Maven repository
}
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Module gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId 'com.example.elaymac.randochat'
minSdkVersion 15
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 'com.google.firebase:firebase-storage:12.0.1'
implementation 'com.google.firebase:firebase-database:12.0.1'
implementation 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.firebaseui:firebase-ui-database:3.3.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
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.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'
}
apply plugin: 'com.google.gms.google-services'
Thanks!
I solved the problem thanks to Severiano Jaramillo Quintanar's answer!
I faced the exact same problem, I was afraid I broke something... I
fixed it by cleaning and rebuilding the project (I had disabled
instant run as suggested here before but I guess that was not
necessary as I enabled it again after cleaning and rebuilding the
project and worked just fine...).
Build -> Clean Project
Build -> Rebuild Project
I am not sure if rebuilding would be necessary, I did both steps and
it worked fine, maybe just cleaning the project would have been
sufficient.
Hope that helps!!
EDIT
Nice, one more thing. When I solved the problem depicted here I found
another problem, when I clicked run the apk was not being created and
I solved it with my answer on that other thread:
The APK file does not exist on disk
In Android Studio:
Go to File / Invalidate caches.. /
Then select both options and restart
After restarting of Android Studio your problem is solved out