-
카테고리
-
세부 분야
모바일 앱 개발
-
해결 여부
미해결
회원가입을 하면 no로 나옵니다
23.05.07 19:26 작성 조회수 169
0
gradle - project
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.google.gms:google-services:4.3.15'
}
}
plugins {
id 'com.android.application' version '8.0.1' apply false
id 'com.android.library' version '8.0.1' apply false
id 'org.jetbrains.kotlin.android' version '1.8.20' apply false
}
gradle - app
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'com.google.gms.google-services'
}
android {
namespace 'com.example.myapplication'
compileSdk 33
defaultConfig {
applicationId "com.example.myapplication"
minSdk 24
targetSdk 33
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'
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation platform('com.google.firebase:firebase-bom:32.0.0')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-auth-ktx'
}
MainActivity
package com.example.myapplication
import android.content.ContentValues.TAG
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.widget.Button
import android.widget.Toast
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.auth.ktx.auth
import com.google.firebase.ktx.Firebase
class MainActivity : AppCompatActivity() {
private lateinit var auth: FirebaseAuth
override fun onCreate(savedInstanceState: Bundle?) {
auth = Firebase.auth
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val joinBtnClicked=findViewById<Button>(R.id.joinBtn)
joinBtnClicked.setOnClickListener {
auth.createUserWithEmailAndPassword("asd@asd.com", "12341234")
.addOnCompleteListener(this) { task ->
if (task.isSuccessful) {
Toast.makeText(this,"ok",Toast.LENGTH_SHORT).show()
} else {
Toast.makeText(this,"no",Toast.LENGTH_SHORT).show()
Log.e(TAG, "createUserWithEmail:failure", task.exception)
}
}
}
}
}
답변을 작성해보세요.
0
개복치개발자
지식공유자2023.05.07
잘 하셨네요
이 로그에서
Log.e(TAG, "createUserWithEmail:failure", task.exception)
createUserWithEmail
이제 위의 부분으로 시작하는 로그 에러메세지가 나올겁니다.
로그창에서 뭐라고 나오나오는지 알려주세요~
이와는 별개로 현재 [초급편]의 경우 안드로이드 개발을 처음하시는 분들 대상이 아니기 때문에
설명이 생략된 부분이 있습니다. 아래 강의를 선 수강 후 들으시는 것을 권장드리는 편입니다~
답변 1