• 카테고리

    질문 & 답변
  • 세부 분야

    모바일 앱 개발

  • 해결 여부

    미해결

파이어베이스 sdk질문입니다.

23.03.09 06:53 작성 조회수 196

0

파이어베이스 질문있습니다.

제가 사용하고 있는 안드로이드는 2022-12 이후버전이고 https://gainful-topaz-82f.notion.site/Firebase-8aa3137487b84fd3afe60d90e0702986 이 링크에서 나오는 2번째 방법으로 따라했는데요. 링크대로 하면 작동되는데 구글에서 나오는 allprojects까지 입력하면 에러가 나옵니다.

구글에서는 allprojects까지 입력하라고 나와있어서 입력했는데 build.gradle': 22: only buildscript {} and other plugins {} script blocks are allowed before plugins {} blocks, no other statements are allowed 이런 에러가 나왔습니다. 왜나오는지 알수있을까요?

Firebase SDK에서 google-services.json 구성 값에 액세스할 수 있도록 하려면 Google 서비스 Gradle 플러그인이 필요합니다.

프로젝트 수준 build.gradle 파일에 플러그인을 buildscript 종속 항목으로 추가합니다.

루트 수준(프로젝트 수준) Gradle 파일(<project>/build.gradle):

buildscript {
  repositories {
    // Make sure that you have the following two repositories
    google()  // Google's Maven repositorycontent_copy
    mavenCentral()  // Maven Central repositorycontent_copy
  }
  dependencies {
    ...
    // Add the dependency for the Google services Gradle plugin
    classpath 'com.google.gms:google-services:4.3.15'content_copy
  }
}

allprojects {
  ...
  repositories {
    // Make sure that you have the following two repositories
    google()  // Google's Maven repositorycontent_copy
    mavenCentral()  // Maven Central repositorycontent_copy
  }
}

답변 1

답변을 작성해보세요.

0

안녕하세요

잘 하신 것 같은데

build.gradle (Project)

build.gradle (Module)

이 부분 전체 코드와 스크린샷을 공유해주시겠어요?

 

어려우시면 전체 코드를 깃허브에 올리시고 알려주세요.