capacitor-firebase-auth
capacitor-firebase-auth copied to clipboard
'getConfig()' in 'com.baumblatt.capacitor.firebase.auth.CapacitorFirebaseAuth' clashes with 'getConfig()' in 'com.getcapacitor.Plugin'; attempting to use incompatible return type
I followed the instructions, the only difference is at my MainActivity.java, since I cannot use add() method, I changed it to registerPlugin() method.
I also tried to change com.getcapacitor.Config to com.getcapacitor.CapConfig until it produces another complicated error which I cannot solve straightforwardly.
Here is my package.json:
{
"name": "bookeat",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/common": "~10.0.0",
"@angular/core": "~10.0.0",
"@angular/forms": "~10.0.0",
"@angular/platform-browser": "~10.0.0",
"@angular/platform-browser-dynamic": "~10.0.0",
"@angular/router": "~10.0.0",
"@capacitor-community/admob": "^3.0.1",
"@capacitor-community/contacts": "^0.1.1",
"@capacitor-community/sqlite": "^2.9.16",
"@capacitor/android": "3.0.1",
"@capacitor/app": "1.0.1",
"@capacitor/core": "^3.0.0-rc.4",
"@capacitor/filesystem": "^1.0.1",
"@capacitor/network": "^1.0.1",
"@capacitor/storage": "^1.0.1",
"@fortawesome/angular-fontawesome": "^0.8.1",
"@fortawesome/fontawesome-svg-core": "^1.2.34",
"@fortawesome/free-solid-svg-icons": "^5.15.2",
"@ionic-native/core": "^5.0.0",
"@ionic-native/deeplinks": "^5.32.0",
"@ionic-native/local-notifications": "^5.31.1",
"@ionic-native/native-audio": "^5.32.1",
"@ionic-native/splash-screen": "^5.0.0",
"@ionic-native/sqlite": "^5.33.0",
"@ionic-native/status-bar": "^5.0.0",
"@ionic/angular": "^5.0.0",
"capacitor-firebase-auth": "^2.4.0",
"cordova-play-services-version-adapter": "^1.1.0",
"cordova-plugin-badge": "^0.8.8",
"cordova-plugin-device": "^2.0.3",
"cordova-plugin-local-notification": "^0.9.0-beta.2",
"cordova-plugin-nativeaudio": "^3.0.9",
"cordova-sqlite-storage": "^6.0.0",
"firebase": "^8.0.0",
"ionic-plugin-deeplinks": "^1.0.22",
"jetifier": "^1.6.8",
"ngx-mask-ionic": "^1.1.2",
"phonegap-plugin-multidex": "^1.0.0",
"rxjs": "~6.5.5",
"tslib": "^2.0.0",
"zone.js": "~0.10.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1000.0",
"@angular/cli": "~10.0.5",
"@angular/compiler": "~10.0.0",
"@angular/compiler-cli": "~10.0.0",
"@angular/language-service": "~10.0.0",
"@capacitor/cli": "^3.0.0-rc.4",
"@ionic/angular-toolkit": "^2.3.0",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~3.3.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~3.9.5"
},
"description": "An Ionic project"
}
build.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:4.2.1'
classpath 'com.google.gms:google-services:4.3.8'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
apply from: "variables.gradle"
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
another build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "com.example.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
// Default: https://android.googlesource.com/platform/frameworks/base/+/282e181b58cf72b6ca770dc7ca5f91f135444502/tools/aapt/AaptAssets.cpp#61
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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')
implementation platform('com.google.firebase:firebase-bom:28.1.0')
implementation 'com.google.firebase:firebase-analytics'
}
apply from: 'capacitor.build.gradle'
try {
def servicesJSON = file('google-services.json')
if (servicesJSON.text) {
apply plugin: 'com.google.gms.google-services'
}
} catch(Exception e) {
logger.warn("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
}
tsconfig.json:
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"module": "esnext",
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"lib": [
"es2018",
"dom"
],
"esModuleInterop": true
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true
}
}
capacitor.config.json:
{
"appId": "com.example.app",
"appName": "bookeat",
"bundledWebRuntime": false,
"npmClient": "npm",
"webDir": "www",
"plugins": {
"SplashScreen": {
"launchShowDuration": 0
},
"CapacitorFirebaseAuth": {
"providers": [
"google.com",
"twitter.com",
"facebook.com",
"phone"
],
"languageCode": "en",
"nativeAuth": false,
"properties": {
"google": {}
},
"permissions": {
"google": [
"profile",
"https://www.googleapis.com/auth/drive"
]
}
}
},
"cordova": {}
}
Where you able to fix this?
@Esteban-V So far no, because of this project's deadline and other projects that I have to work on, I decided to drop this feature, but looking forward to the fix!
These are the same issues I am experiencing after upgrading to capacitor 3.0. I've tried upgrading to capacitor 3.0 several times now, and continue running into this error. Any idea on how I can resolve this?

Edit: I resolved my own issue by upgrading to 3.0.0-rc.0
Try putting this code in your MainActivity.java file
import android.os.Bundle;
import com.getcapacitor.BridgeActivity;
import com.baumblatt.capacitor.firebase.auth.CapacitorFirebaseAuth;
public class MainActivity extends BridgeActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Initializes the Bridge
registerPlugin(CapacitorFirebaseAuth.class);
}
}
Thanks @PerezCodeT