작성
·
382
·
수정됨
0
안녕하세요! 강의 수강하고 있는 학생입니다. 무조건 arctic fox 버전을 사용해야지 auth import가 가능한걸까요?
dolphin 버전 사용하고 있는데
package com.example.fapplication
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.ktx.Firebase
class JoinActivity : AppCompatActivity() {
private lateinit var auth: FirebaseAuth
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_join)
auth = Firebase.auth
}
}
마지막 firebase.auth의 auth가 import가 안되서 질문드립니다
plugins {
id 'com.android.application' version '7.3.0' apply false
id 'com.android.library' version '7.3.0' apply false
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
id("com.google.gms.google-services") version "4.4.0" apply false
}
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id("com.google.gms.google-services")
}
android {
namespace 'com.example.fapplication'
compileSdk 32
viewBinding{
enabled true
}
defaultConfig {
applicationId "com.example.fapplication"
minSdk 24
targetSdk 32
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'
}
dataBinding {
enabled true
}
}
dependencies {
implementation("com.google.firebase:firebase-analytics-ktx")
implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation("com.google.firebase:firebase-auth-ktx")
}
답변 4
0
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.auth.ktx.auth
import com.google.firebase.ktx.Firebase
class JoinActivity : AppCompatActivity() {
private lateinit var auth: FirebaseAuth
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_join)
auth = Firebase.auth
}
}
동일한 코드로
이렇게 잘 되는 것 같은데 위의 import부분을 수동으로 해보시겠어요?
0
0
혹은 최신 안드로이드 스튜디오를 다운받으셔도 좋습니다.