마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

compilation error. See log for more details 에러 부탁드립니다!

0 추천

 

선배님들 안녕하세요 이렇게 에러가 나오게 되어 문의드립니다

소스 에서 나타나고 있는 에러는 ovrride, object, post.postId = newRef.key ( 이부분은 사진을 못 올렸네요)

이렇게 3개가 에러가 잡히는데 앱수준의 의존성 추가에서 appcompat 라이브러리에 빨간 밑줄이 그어진게 신경쓰이긴합니다.. 혹시 알고계신 선배님 계신다면 도움좀 부탁드립니다

왕초보안드 (180 포인트) 님이 2019년 4월 8일 질문
안보이는데요 ?           .
선배님! 안보이신단 말씀이 코드를 쭉 보셨을때 문제가 없다는 말씀이신건가요?
아니요 글자가 너무 작아서 내용이 보이지 않습니다.
오류 내용을 봐야되는데 해당 부분이 보지지 않네요
선배님! 죄송합니다 보이지도 않는 사진을 올렸네요...

제가 직접 적어봤습니다!

▼ ! Kotlin compiler: (17 errors)
  ▼C:/Users/win7/AndroidStudioProjects/Jotes01 (17 errors)
    ▼app/src/main/java (17 errors )
      ▼com/example/jotest01/DetailActivity.kt ( 9 errors )
         ! object Is not abstract and does not implement abstract member public abstract fun onCancelled(@NonNull p0: DatabaseError): Unit defined in com.google.firebase.database.ValueEventListener
         ! 'onCancelled' overrides nothing
         ! 'onDataChange' overrides nothing
         ! Object is not abstract and does not implement abstract member public abstract fun onCancelled(@NonNull p0: DatabaseError): Unit defined in com.google.firebase.database.ChildEventListener
         ! 'onCancelled' overrides nothing
         ! 'onChildMoved' overrides nothing
         ! 'onChildChanged' overrides nothing
         ! 'onchiAdded' overrides nothing
         ! 'onChildRemoved' overrides nothing
       ▼com/example/jotest01/MainActivity.kt ( 6 errors )
         ! object is not abstract and does not implement abstract member public abstract fun onChildAdded(@NonNull p0: DataSnapshot, @Nullable p1: String?): Unit defined in com.google.firebase.database.Child
         ! 'onChildAdded' overrides nothing
         ! 'onChildChanged' overrides nothing
         ! 'onChildMoved' overrides nothing
         ! 'onChildRemoved' overrides nothing
         ! 'onCancelled' overrides nothing
       ▼com/example/jotest01/WriteActivity.kt ( 2 errors )
         ! Type misMatch: inferred type is String? but String was expected
         ! Type mismatch: inferred type is String? but String was expected> Task:app:bulldInfoGeneratorDebug

1개의 답변

+1 추천
 
채택된 답변
compat-v7 의 경우 마우스를 해당 위치에 가져다 놓으면 노랑색 배경의 문구가 뜹니다.

아래의 부분을 28.0.0 버전으로 추가하면 해결되구요 (다른쪽 라이브러가 참조하는 support 라이브러리의 버전이 달라 발생되는 문제 입니다. )
implementation "com.android.support:support-v4:$support_lib"
implementation "com.android.support:support-media-compat:$support_lib"

firebase 쪽은 firebase 의 버전이 바뀌면서 인자 형태가 변경된거 같습니다.
onChildAdded(@NonNull p0: DataSnapshot, @Nullable p1: String?)

로그상으로는 DataSnapshot 이 NonNull 이고 String 은 Nullable 인데
구현된 코드상으로 DataSnapshot 에 ? 이 붙어 있으므로 Nullable 형태로 구현되어 있네요

제일 쉬운 처리 방법은 해당 코드를 백업한 뒤에 event listener 구현부를 지우고 다시 생성한뒤 method 내 내용만 복사하세요
aucd29 (218,390 포인트) 님이 2019년 4월 10일 답변
왕초보안드님이 2019년 4월 10일 채택됨
선배님 해결했습니다! 너무 감사합니다..
...