capacitor-firebase-auth icon indicating copy to clipboard operation
capacitor-firebase-auth copied to clipboard

Trying to update from 0.3 to 2.0.1 (latest) and I get weird errors

Open sabahang opened this issue 5 years ago • 6 comments

When I look at the documentation and install instructions everything I have should be correct (and same as 0.3 actually) but still Android studio throws the following: image ERROR: Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve project :capacitor-firebase-auth

I tried everything from Stackoverflow but but the problem seems to be very specific to this project: What am I doing wrong?

PS: I'm only using phone authentication:

  "plugins": {
    "CapacitorFirebaseAuth": {
      "providers": [
        "phone"
      ],
      "languageCode": "en",
      "nativeAuth": false
    }
  }

Also my build.gradle file for app looks like this:

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
    signingConfigs {
        release {
              //app signing details
        }
    }
    defaultConfig {
        applicationId "xxx"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 17
        versionName "1.0.17"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

repositories {
    flatDir{
        dirs '../capacitor-cordova-android-plugins/src/main/libs', 'libs'
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
    implementation project(':capacitor-android')
    testImplementation "junit:junit:$junitVersion"
    androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
    androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
    implementation project(':capacitor-cordova-android-plugins')
}

apply from: 'capacitor.build.gradle'
apply plugin: 'com.google.gms.google-services'

sabahang avatar Jun 30 '20 07:06 sabahang

I was getting the same error. I went back from scratch and when Android Studio offered to upgrade Gradle I refused, I think? that solved my problem. (At the same time I had done several other things so not 100% certain.) I'm now using Android Gradle Plugin 3.6.3 and Gradle 5.6.4.

BetterAutomations avatar Jun 30 '20 12:06 BetterAutomations

Also happening on "^2.2.0" :(

sabahang avatar Jul 02 '20 11:07 sabahang

I tried downgrading gradle and gradle plugin but same issue. interestingly once I also managed to make it work but a new gradle sync and/or messing with plugins or npx cap sync messes up the whole thing again :( basically capacitor-firebase-auth dependency doesn't even appear in the list of packages for some reason

sabahang avatar Jul 02 '20 12:07 sabahang

Hello @sabahang ,

I face the same issue when move to version 2.x.x of Capacitor Framework. My workaround was the same as @BetterAutomations , restart the project from scratch and copy and paste the web part.

Please, give this a try, start an entire new project (this way), install version 2.2.0 (tagged as future), add android and just run.

If every thing works, copy and paste your web project and try again.

Good look,

Best regards, Bernardo Baumblatt.

baumblatt avatar Jul 04 '20 00:07 baumblatt

by copy past you mean run npx cap copy? this is not ideal at all because I have custom code in my android project and I cant remove it every time and create a new project from scratch every time only so that I can build! if you are sure that this is related to Capacitor, could you please open a ticket on their project so that someone can investigate this? this is extremely annoying and is worth tracking down in my opinion

sabahang avatar Jul 06 '20 06:07 sabahang

@baumblatt Im getting another one after a clean install. Do you happen to have a remedy for this? constructor Config in class Config cannot be applied to given types; required: no arguments found: AssetManager, reason: actual and formal argument lists differ in length PS: also it seems that Config is deprecated !

image

sabahang avatar Jul 13 '20 09:07 sabahang