Skip to content

Commit

Permalink
refactor: migrate out of Firebase KTX (#491)
Browse files Browse the repository at this point in the history
* refactor(appcheck): Remove ktx imports

* refactor(auth): Remove ktx imports

* refactor(config): Remove ktx imports

* refactor(crashlytics): Remove ktx imports

* refactor(database): Remove ktx imports

* refactor(fdl): Remove ktx imports

* refactor(options): Remove ktx imports

* refactor(firestore): Remove ktx imports

* refactor(functions): Remove ktx imports

* refactor(fiam): Remove ktx imports

* refactor(fcm): Remove ktx imports

* refactor(perf): Remove ktx imports

* refactor(storage): Remove ktx imports

* refactor(tasks): Remove ktx imports

* refactor(analytics): Remove ktx imports

* refactor(mlfunctions): Remove ktx imports

* Auto-update dependencies.

* Keep ktlint version for now

* refactor(*): remove ktx dependencies

* refactor(analytics): revert analytics changes

* chore(crashlytics): enable multiDex

---------

Co-authored-by: DPE bot <[email protected]>
  • Loading branch information
thatfiredev and dpebot authored Oct 19, 2023
1 parent 149641e commit fc886ab
Show file tree
Hide file tree
Showing 59 changed files with 180 additions and 184 deletions.
2 changes: 1 addition & 1 deletion admob/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies {
// [END gradle_play_config]

// Import the Firebase BoM (see: https://firebase.google.com/docs/android/learn-more#bom)
implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
implementation(platform("com.google.firebase:firebase-bom:32.4.0"))

// For an optimal experience using AdMob, add the Firebase SDK
// for Google Analytics. This is recommended, but not required.
Expand Down
3 changes: 1 addition & 2 deletions analytics/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ android {
dependencies {
implementation("androidx.legacy:legacy-support-v4:1.0.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("com.google.firebase:firebase-analytics:21.3.0")
implementation("com.google.firebase:firebase-analytics-ktx:21.3.0")
implementation("com.google.firebase:firebase-analytics:21.4.0")
// Ironsource and AppLovin libraries used for ad_impression snippets
implementation("com.applovin:applovin-sdk:11.5.1")
implementation("com.ironsource.sdk:mediationsdk:7.2.4.1")
Expand Down
3 changes: 1 addition & 2 deletions appcheck/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ dependencies {
implementation("androidx.constraintlayout:constraintlayout:2.1.4")

// Import the BoM for the Firebase platform
implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
implementation(platform("com.google.firebase:firebase-bom:32.4.0"))
implementation("com.google.firebase:firebase-appcheck")
implementation("com.google.firebase:firebase-appcheck-playintegrity")
implementation("com.google.firebase:firebase-appcheck-debug")
implementation("com.google.firebase:firebase-appcheck-ktx")

implementation("com.squareup.retrofit2:retrofit:2.9.0")
implementation("androidx.core:core-ktx:1.12.0")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.google.firebase.example.appcheck.kotlin

import com.google.firebase.appcheck.ktx.appCheck
import com.google.firebase.ktx.Firebase
import com.google.firebase.appcheck.appCheck
import com.google.firebase.Firebase
import retrofit2.Call
import retrofit2.Retrofit
import retrofit2.http.GET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import com.google.firebase.FirebaseApp
import com.google.firebase.appcheck.AppCheckProvider
import com.google.firebase.appcheck.AppCheckProviderFactory
import com.google.firebase.appcheck.AppCheckToken
import com.google.firebase.appcheck.ktx.appCheck
import com.google.firebase.ktx.Firebase
import com.google.firebase.ktx.initialize
import com.google.firebase.initialize
import com.google.firebase.Firebase
import com.google.firebase.appcheck.appCheck

class CustomProvider {
// [START appcheck_custom_provider]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package com.google.firebase.example.appcheck.kotlin
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.google.firebase.appcheck.debug.DebugAppCheckProviderFactory
import com.google.firebase.appcheck.ktx.appCheck
import com.google.firebase.appcheck.appCheck
import com.google.firebase.appcheck.playintegrity.PlayIntegrityAppCheckProviderFactory
import com.google.firebase.example.appcheck.R
import com.google.firebase.ktx.Firebase
import com.google.firebase.ktx.initialize
import com.google.firebase.Firebase
import com.google.firebase.initialize

class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
Expand Down
4 changes: 2 additions & 2 deletions auth/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ dependencies {
implementation("androidx.activity:activity-ktx:1.8.0")

// Import the BoM for the Firebase platform
implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
implementation(platform("com.google.firebase:firebase-bom:32.4.0"))

// Add the dependency for the Firebase Authentication library
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation("com.google.firebase:firebase-auth-ktx")
implementation("com.google.firebase:firebase-auth")

// [START gradle_firebase_ui_auth]
implementation("com.firebaseui:firebase-ui-auth:8.0.2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import android.widget.Toast
import com.google.firebase.auth.EmailAuthProvider
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.auth.FirebaseUser
import com.google.firebase.auth.ktx.auth
import com.google.firebase.ktx.Firebase
import com.google.firebase.auth.auth
import com.google.firebase.Firebase

/**
* Activity to demonstrate anonymous login and account linking (with an email/password account).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import android.util.Log
import android.widget.Toast
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.auth.FirebaseUser
import com.google.firebase.auth.ktx.auth
import com.google.firebase.ktx.Firebase
import com.google.firebase.auth.auth
import com.google.firebase.Firebase

/**
* Demonstrate Firebase Authentication using a custom minted token. For more information, see:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import android.util.Log
import android.widget.Toast
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.auth.FirebaseUser
import com.google.firebase.auth.ktx.auth
import com.google.firebase.ktx.Firebase
import com.google.firebase.auth.auth
import com.google.firebase.Firebase

class EmailPasswordActivity : Activity() {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.google.firebase.quickstart.auth.kotlin

import com.google.firebase.auth.ktx.auth
import com.google.firebase.ktx.Firebase
import com.google.firebase.auth.auth
import com.google.firebase.Firebase

class EmulatorSuite {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import com.facebook.login.widget.LoginButton
import com.google.firebase.auth.FacebookAuthProvider
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.auth.FirebaseUser
import com.google.firebase.auth.ktx.auth
import com.google.firebase.ktx.Firebase
import com.google.firebase.auth.auth
import com.google.firebase.Firebase

/**
* Demonstrate Firebase Authentication using a Facebook access token.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package com.google.firebase.quickstart.auth.kotlin
import androidx.appcompat.app.AppCompatActivity
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.auth.OAuthProvider
import com.google.firebase.auth.ktx.auth
import com.google.firebase.auth.ktx.oAuthCredential
import com.google.firebase.ktx.Firebase
import com.google.firebase.auth.auth
import com.google.firebase.auth.oAuthCredential
import com.google.firebase.Firebase

class GenericIdpActivity : AppCompatActivity() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import com.google.android.gms.common.api.ApiException
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.auth.FirebaseUser
import com.google.firebase.auth.GoogleAuthProvider
import com.google.firebase.auth.ktx.auth
import com.google.firebase.ktx.Firebase
import com.google.firebase.auth.auth
import com.google.firebase.Firebase
import com.google.firebase.quickstart.auth.R

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import com.google.firebase.auth.PhoneAuthCredential
import com.google.firebase.auth.PhoneAuthOptions
import com.google.firebase.auth.PhoneAuthProvider
import com.google.firebase.auth.PlayGamesAuthProvider
import com.google.firebase.auth.ktx.actionCodeSettings
import com.google.firebase.auth.ktx.auth
import com.google.firebase.auth.ktx.userProfileChangeRequest
import com.google.firebase.ktx.Firebase
import com.google.firebase.auth.actionCodeSettings
import com.google.firebase.auth.auth
import com.google.firebase.auth.userProfileChangeRequest
import com.google.firebase.Firebase
import com.google.firebase.quickstart.auth.R
import java.util.concurrent.TimeUnit

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import android.app.Activity
import android.os.Bundle
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.auth.FirebaseUser
import com.google.firebase.auth.ktx.auth
import com.google.firebase.ktx.Firebase
import com.google.firebase.auth.auth
import com.google.firebase.Firebase

class MultiFactorActivity : Activity() {
// [START declare_auth]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import com.google.firebase.auth.FirebaseUser
import com.google.firebase.auth.PhoneAuthCredential
import com.google.firebase.auth.PhoneAuthOptions
import com.google.firebase.auth.PhoneAuthProvider
import com.google.firebase.auth.ktx.auth
import com.google.firebase.ktx.Firebase
import com.google.firebase.auth.auth
import com.google.firebase.Firebase
import java.util.concurrent.TimeUnit

class PhoneAuthActivity : Activity() {
Expand Down
6 changes: 3 additions & 3 deletions config/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ dependencies {
implementation("androidx.constraintlayout:constraintlayout:2.1.4")

// Import the BoM for the Firebase platform
implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
implementation(platform("com.google.firebase:firebase-bom:32.4.0"))

// Add the dependencies for the Remote Config and Analytics libraries
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation("com.google.firebase:firebase-config-ktx")
implementation("com.google.firebase:firebase-analytics-ktx")
implementation("com.google.firebase:firebase-config")
implementation("com.google.firebase:firebase-analytics")

testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import android.os.Bundle
import android.util.Log
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import com.google.firebase.ktx.Firebase
import com.google.firebase.Firebase
import com.google.firebase.remoteconfig.ConfigUpdate
import com.google.firebase.remoteconfig.ConfigUpdateListener
import com.google.firebase.remoteconfig.FirebaseRemoteConfig
import com.google.firebase.remoteconfig.FirebaseRemoteConfigException
import com.google.firebase.remoteconfig.ktx.get
import com.google.firebase.remoteconfig.ktx.remoteConfig
import com.google.firebase.remoteconfig.ktx.remoteConfigSettings
import com.google.firebase.remoteconfig.get
import com.google.firebase.remoteconfig.remoteConfig
import com.google.firebase.remoteconfig.remoteConfigSettings

class MainActivity : AppCompatActivity() {

Expand Down
7 changes: 4 additions & 3 deletions crashlytics/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ android {
targetSdk = 34
versionCode = 1
versionName = "1.0"
multiDexEnabled = true
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand All @@ -37,10 +38,10 @@ dependencies {
implementation("androidx.appcompat:appcompat:1.6.1")

// Import the BoM for the Firebase platform
implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
implementation(platform("com.google.firebase:firebase-bom:32.4.0"))

// Add the dependencies for the Crashlytics and Analytics libraries
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation("com.google.firebase:firebase-crashlytics-ktx")
implementation("com.google.firebase:firebase-analytics-ktx")
implementation("com.google.firebase:firebase-crashlytics")
implementation("com.google.firebase:firebase-analytics")
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import android.os.Bundle
import android.view.ViewGroup
import android.widget.Button
import androidx.appcompat.app.AppCompatActivity
import com.google.firebase.crashlytics.ktx.crashlytics
import com.google.firebase.crashlytics.ktx.setCustomKeys
import com.google.firebase.ktx.Firebase
import com.google.firebase.crashlytics.crashlytics
import com.google.firebase.crashlytics.setCustomKeys
import com.google.firebase.Firebase

class MainActivity : AppCompatActivity() {

Expand Down
4 changes: 2 additions & 2 deletions database/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ dependencies {
implementation("androidx.appcompat:appcompat:1.6.1")

// Import the BoM for the Firebase platform
implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
implementation(platform("com.google.firebase:firebase-bom:32.4.0"))

// Add the dependency for the Realtime Database library
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation("com.google.firebase:firebase-database-ktx")
implementation("com.google.firebase:firebase-database")
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.google.firebase.referencecode.database.kotlin

import com.google.firebase.database.FirebaseDatabase
import com.google.firebase.database.ktx.database
import com.google.firebase.ktx.Firebase
import com.google.firebase.database.database
import com.google.firebase.Firebase

class EmulatorSuite {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import androidx.appcompat.app.AppCompatActivity
import com.google.firebase.database.DataSnapshot
import com.google.firebase.database.DatabaseError
import com.google.firebase.database.ValueEventListener
import com.google.firebase.database.ktx.database
import com.google.firebase.database.ktx.getValue
import com.google.firebase.ktx.Firebase
import com.google.firebase.database.database
import com.google.firebase.database.getValue
import com.google.firebase.Firebase
import com.google.firebase.referencecode.database.R

abstract class MainActivity : AppCompatActivity() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import com.google.firebase.database.DataSnapshot
import com.google.firebase.database.DatabaseError
import com.google.firebase.database.ServerValue
import com.google.firebase.database.ValueEventListener
import com.google.firebase.database.ktx.database
import com.google.firebase.database.ktx.getValue
import com.google.firebase.ktx.Firebase
import com.google.firebase.database.database
import com.google.firebase.database.getValue
import com.google.firebase.Firebase

class OfflineActivity : AppCompatActivity() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import com.google.firebase.database.DatabaseError
import com.google.firebase.database.DatabaseReference
import com.google.firebase.database.Query
import com.google.firebase.database.ValueEventListener
import com.google.firebase.database.ktx.database
import com.google.firebase.database.ktx.getValue
import com.google.firebase.ktx.Firebase
import com.google.firebase.database.database
import com.google.firebase.database.getValue
import com.google.firebase.Firebase
import com.google.firebase.referencecode.database.R
import com.google.firebase.referencecode.database.kotlin.models.Comment
import com.google.firebase.referencecode.database.models.Message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import com.google.firebase.database.MutableData
import com.google.firebase.database.ServerValue
import com.google.firebase.database.Transaction
import com.google.firebase.database.ValueEventListener
import com.google.firebase.database.ktx.database
import com.google.firebase.database.ktx.getValue
import com.google.firebase.ktx.Firebase
import com.google.firebase.database.database
import com.google.firebase.database.getValue
import com.google.firebase.Firebase
import com.google.firebase.referencecode.database.kotlin.models.Post
import com.google.firebase.referencecode.database.models.User

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.google.firebase.referencecode.database.kotlin

import androidx.appcompat.app.AppCompatActivity
import com.google.firebase.database.ktx.database
import com.google.firebase.ktx.Firebase
import com.google.firebase.database.database
import com.google.firebase.Firebase

class ShardingActivity : AppCompatActivity() {

Expand Down
6 changes: 3 additions & 3 deletions dl-invites/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ dependencies {
implementation("androidx.legacy:legacy-support-v4:1.0.0")
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.cardview:cardview:1.0.0")
implementation("androidx.recyclerview:recyclerview:1.3.1")
implementation("androidx.recyclerview:recyclerview:1.3.2")
implementation("com.google.android.material:material:1.9.0")
implementation("androidx.constraintlayout:constraintlayout:2.1.4")

// Import the BoM for the Firebase platform
implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
implementation(platform("com.google.firebase:firebase-bom:32.4.0"))

// Add the dependency for the Dynamic Links library
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation("com.google.firebase:firebase-dynamic-links-ktx")
implementation("com.google.firebase:firebase-dynamic-links")
}
10 changes: 5 additions & 5 deletions dynamic-links/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ dependencies {
implementation("androidx.appcompat:appcompat:1.6.1")

// Import the BoM for the Firebase platform
implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
implementation(platform("com.google.firebase:firebase-bom:32.4.0"))

// When using the BoM, you don't specify versions in Firebase library dependencies
implementation("com.google.firebase:firebase-auth-ktx")
implementation("com.google.firebase:firebase-database-ktx")
implementation("com.google.firebase:firebase-dynamic-links-ktx")
implementation("com.google.firebase:firebase-auth")
implementation("com.google.firebase:firebase-database")
implementation("com.google.firebase:firebase-dynamic-links")
implementation("com.google.firebase:firebase-invites:17.0.0")

// For an optimal experience using Dynamic Links, add the Firebase SDK
// for Google Analytics. This is recommended, but not required.
implementation("com.google.firebase:firebase-analytics-ktx")
implementation("com.google.firebase:firebase-analytics")

implementation("androidx.constraintlayout:constraintlayout:2.1.4")
}
Loading

1 comment on commit fc886ab

@adarxhh
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi

Please sign in to comment.