I never used this library. It cannot sync properly but my internet is working good enough to download that .jar file
Here is my error:
Unable to resolve dependency for ':app#debug/compileClasspath': Could not download rxjava.jar (io.reactivex.rxjava2:rxjava:2.1.0)
Open File
Show Details
Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Could not download rxjava.jar (io.reactivex.rxjava2:rxjava:2.1.0)
Open File
Show Details
Unable to resolve dependency for ':app#debugUnitTest/compileClasspath': Could not download rxjava.jar (io.reactivex.rxjava2:rxjava:2.1.0)
Open File
Show Details
Unable to resolve dependency for ':app#release/compileClasspath': Could not download rxjava.jar (io.reactivex.rxjava2:rxjava:2.1.0)
Open File
Show Details
Unable to resolve dependency for ':app#releaseUnitTest/compileClasspath': Could not download rxjava.jar (io.reactivex.rxjava2:rxjava:2.1.0)
Open File
Show Details
Here is my build.app gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.tekemuradov.aman.ulgmada"
minSdkVersion 18
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// implement support libraries
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:animated-vector-drawable:27.0.2'
implementation 'com.android.support:design:27.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:27.0.2'
// implement firebase libraries
implementation 'com.google.firebase:firebase-auth:11.0.4'
implementation 'com.google.firebase:firebase-database:11.0.4'
implementation 'com.google.firebase:firebase-storage:11.0.4'
implementation 'com.google.firebase:firebase-core:11.0.4'
// implement firebase-ui
implementation 'com.firebaseui:firebase-ui-database:2.3.0'
// implement lifecycle
implementation 'android.arch.lifecycle:extensions:1.1.0'
// implement circle image view
implementation 'de.hdodenhof:circleimageview:2.2.0'
// implement image cropper
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.+'
// implement image compressor
implementation 'id.zelory:compressor:2.1.0'
// implement test
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'
}
apply plugin: 'com.google.gms.google-services'
configurations.all{
resolutionStrategy.eachDependency{DependencyResolveDetails details ->
def requested = details.requested
if(requested.group == 'com.android.support'){
if (!requested.name.startsWith("multidex")){
details.useVersion('27.0.2')
}
}
}
}
here is my build.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.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.1.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
use
implementation 'io.reactivex.rxjava2:rxjava:2.2.3'
from https://github.com/ReactiveX/RxJava/issues/5794
Related
I am using Firebase for uplodaing the images but whenever i am using StorageReference then it saying cannot able to resolve this symbol i have tried to add dependency of storage but it is also not adding and giving me the error.
Please tell how can i use StorageReference
my build.gradle(app):
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "example.example1.adminshayariapp"
minSdkVersion 16
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'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-database:16.0.4'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation 'com.squareup.picasso:picasso:2.71828'
}
build.gradle(Project):
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'com.google.gms:google-services:4.2.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
}
Please tell what is wrong why i am not able to use StorageReference.
If you are planning on using the Storage Bucket feature from Firebase I notice you are missing some implementations in your App Gradle:
implementation 'com.google.firebase:firebase-storage:19.1.1'
implementation 'com.google.firebase:firebase-auth:19.3.1'
You might not need the second one, but i would recommend authentication anyway. Go ahead and add these into your dependencies, that should solve the issue. If it persists let me know and I'll give it a second look.
Also ensure that you have connected your app to your Firebase project...
In android studio, if you go to tools(top bar) > FireBase > Storage it will guide you through the installation, and ensure that you have all the dependencies you need.
I have two applications where I face the same issue while trying to update project target API from 27 to 29. To do this, first I need to update Gradle plugin at least to 3.2.+.
Project is building fine with 3.1.4, but as soon as I rise Gradle plugin to:
classpath 'com.android.tools.build:gradle:3.5.1
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
(Same error with 3.2.1 and higher)
I see next RunTime exception:
Process: com.my.app, PID: 29804
java.lang.RuntimeException: Unable to instantiate application com.my.app: java.lang.ClassNotFoundException: Didn't find class "com.my.app" on path: DexPathList[[zip file "/data/app/com.my.app-Y6_GNyscecqK5BtUnp_kjQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.my.app-Y6_GNyscecqK5BtUnp_kjQ==/lib/x86, /data/app/com.my.app-Y6_GNyscecqK5BtUnp_kjQ==/base.apk!/lib/x86, /system/lib]]
A problem that :app module source code is not compiled at all
(I can create manual compilation error and run will be still successful)
The same in both application.
What I tired:
I checked generated DEX files in the APK, source code is not there;
I create a new project with 3.5.1 plugin - it works fine;
Tried to delete gradle and .idea folders;
Tried to to clean and invalidate cache
Migrated project to AndroidX;
Added multiDexEnabled true - it was working without it before, anyway;
Copied dependencies to a new Project - works fine;
Added: to gradle.properties android.useAndroidX=true android.enableJetifier=true
My build files:
TOP level
buildscript {
ext.kotlin_version = '1.3.41'
repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.realm:realm-gradle-plugin:6.0.0"
classpath 'com.google.gms:google-services:4.3.2'
classpath 'io.fabric.tools:gradle:1.31.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Application:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'realm-android'
apply plugin: 'io.fabric'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.my.app"
minSdkVersion 21
targetSdkVersion 29
versionCode 2
versionName "1.01"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled = true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
}
ext.anko_version='0.10.5'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.preference:preference:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
implementation 'com.facebook.fresco:fresco:1.2.0'
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation 'io.reactivex.rxjava2:rxkotlin:2.2.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'com.jakewharton.rxbinding2:rxbinding:2.1.0'
implementation "org.jetbrains.anko:anko-sdk21:$anko_version"
implementation "org.jetbrains.anko:anko-appcompat-v7:$anko_version"
implementation "org.jetbrains.anko:anko-constraint-layout:$anko_version"
implementation "org.jetbrains.anko:anko-recyclerview-v7:$anko_version"
implementation "org.jetbrains.anko:anko-recyclerview-v7-coroutines:$anko_version"
implementation "org.jetbrains.anko:anko-cardview-v7:$anko_version"
implementation 'com.r0adkll:slidableactivity:2.0.6'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.1'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.1'
debugImplementation 'com.squareup.leakcanary:leakcanary-support-fragment:1.6.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
kapt "io.realm:realm-annotations-processor:5.9.0"
}
apply plugin: 'com.google.gms.google-services'
Note: another project has different set of dependencies still face the same issue
Why source code is not added to APK after migration to newer Gradle while working fine on the old one?
Update 1
Problem appear as soon as I update project to Gradle 3.2+
Update 2
Build folder doesn't contain class folder and class files
Update 3
Source code from :app module doesn't compile even tho it is in the settings.gradle file; I can create build error in any .java file and run will be executed successfully
I found an issue:
One of my packages name vas cvs - seems it is after Gradle 3.2.+ it is reserved word.
I've been going at this for a while now, and it's driving me insane. I've looked through a few existing Stack Overflow questions, but nothing has worked. I keep getting this error whenever I add the last line, which I need for my AdMob ad units. People seem to solve this issue by changing the version number for this line to 15.0.0, but, as you can see, I've already done this. Please help, if you can. Also, this isn't even the first time I've worked with ad units.
Build.gradle (App level)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.coincalc.anduril.sharetale"
minSdkVersion 17
targetSdkVersion 26
versionCode 2
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
lintOptions {
abortOnError false
}
}
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'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:support-vector-drawable:26.1.0'
implementation 'com.google.firebase:firebase-database:12.0.1'
implementation 'com.google.firebase:firebase-auth:12.0.1'
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'
compile 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.0'
}
apply plugin: 'com.google.gms.google-services'
Build.gradle (Project level)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
classpath 'com.google.gms:google-services:3.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Update the following classpath dependency in your top-level build.gradle:
classpath 'com.google.gms:google-services:4.0.1'
Only newer versions of this plugin understand that the new Firebase dependencies no longer all have to be at the same version.
Read this for more information.
Upgrade your firebase dependencies to latest version, by changing your dependencies to this:
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com. google.firebase:firebase-core:16.0.1'
And in your project level Gradle file, increment your Google services plugin to 4.0.0
Change this:
implementation 'com.google.firebase:firebase-database:12.0.1'
implementation 'com.google.firebase:firebase-auth:12.0.1'
compile 'com.google.firebase:firebase-core:12.0.1'
into this:
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'
Check this for more info:
https://firebase.google.com/support/release-notes/android
I've looked at Firebase documentation, then searched all github issues and also all stack overflow posts but still I'm getting this error again and again. I've been stuck for hours, please have a look. It says-
java.lang.NoSuchMethodError: No static method zzb(ZLjava/lang/Object;)V in class Lcom/google/android/gms/common/internal/zzaa; or its super classes (declaration of 'com.google.android.gms.common.internal.zzaa' appears in /data/app/com.masquerade.priyanshu.topcoder-2/split_lib_dependencies_apk.apk)
According to other stack overflow posts when i try to change firebase core and database version, i get another bunch of errors saying incompatible version.
This is build.gradle( Module: app)
apply plugin: 'com.android.application'
repositories {
mavenLocal()
flatDir {
dirs 'libs'
}
}
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.masquerade.priyanshu.topcoder"
minSdkVersion 16
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(dir: 'libs', include: ['*.jar'])
// implementation 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design: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 'com.google.firebase:firebase-core:11.6.0'
compile 'com.android.support:design:26.1.0'
compile 'com.google.firebase:firebase-database:11.6.0'
compile 'com.firebaseui:firebase-ui-storage:1.0.0'
// Displaying images
compile 'com.github.bumptech.glide:glide:3.6.1'
compile 'com.android.support:cardview-v7:21.+'
}
apply plugin: 'com.google.gms.google-services'
This is build.gradle( Project:app ) -
// 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.0.0'
classpath 'com.google.gms:google-services:3.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenLocal()
maven {
url 'https://maven.fabric.io/public'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
EDIT -
Also I'm getting this warning on compile 'com.google.firebase:firebase-core:11.6.0'
The warning is -
All gms/firebase libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 11.6.0, 11.4.2. Examples include com.google.android.gms:play-services-basement:11.6.0 and com.google.firebase:firebase-storage:11.4.
To solve this, please the change the following line of code from your build.gradle( Project:app ) file:
url 'https://maven.fabric.io/public'
with
url "https://maven.google.com" // Google's Maven repository
Change also this line of code:
compile 'com.firebaseui:firebase-ui-storage:1.0.0'
with
compile 'com.firebaseui:firebase-ui-storage:3.1.0'
Change also this lines of code:
compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.firebase:firebase-database:11.6.0'
with
compile 'com.google.firebase:firebase-core:11.4.2'
compile 'com.google.firebase:firebase-database:11.4.2'
Because Firebase/Play Services Version 11.4.2works with FirebaseUI Version 3.1.0 as seen here.
Also set multiDexEnabled to true in default config.
I am getting the following error when trying to compile the project:
error: package lombok does not exist
And others stating that all the annotations from it can't be found.
I don't see errors in code before compiling and I didn't have this error while I was using Android Studio 3 RC1.
Here are my gradle scripts:
Project level:
// 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.0.0-rc2'
// 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
}
App module level:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.mk.forum"
minSdkVersion 25
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
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: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 project (':util')
compile project (':forum_core')
compileOnly 'org.projectlombok:lombok:1.16.18'
annotationProcessor 'org.projectlombok:lombok:1.16.18'
compile group: 'com.github.javafaker', name: 'javafaker', version: '0.13'
}
I've got modules too, but I think it isn't important.
I hope it is because of compileOnly annotation. Here is the doc:
blog.gradle.org/introducing-compile-only-dependencies
Dependencies required at compile time but never required at runtime, such as source-only annotations or annotation processors;
Dependencies required at compile time but required at runtime only when using certain features, a.k.a. optional dependencies;
Dependencies whose API is required at compile time but whose implementation is to be provided by a consuming library, application
or runtime environment.
It might be related to jdk9. I know that the combination of IntelliJ, lombok 1.16.18 and jdk9 currently doesn't work. But that does not explain your error message. We expect that we can release 1.16.20 within a few days (maybe tonight) that addresses this problem.
Disclosure: I am a lombok developer.