Development record of developer who study hard everyday.

레이블이 안드로이드빌드에러인 게시물을 표시합니다. 모든 게시물 표시
레이블이 안드로이드빌드에러인 게시물을 표시합니다. 모든 게시물 표시
, , ,

android:exported needs to be explicitly specified for 빌드에러 해결방법

android:exported needs to be explicitly specified for <activity> 빌드에러 해결방법

안드로이드 개발 블로그

안드로이드 프로젝트 그래들 업데이트를 하다가 아래와 같은 에러를 만났다.

> Manifest merger failed with multiple errors, see logs

android:exported needs to be explicitly specified for <activity>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

해석하면 안드로이드 12를 타겟하는 순간부터 manifest.xml 파일에 activity 태그에 exported 속성을 정의해주어야한다.

(단, activity가 intent-filter 태그를 품고있는 경우에만 해당된다.)

하지만, 난 아무리 activity 태그에 다 exported 속성을 정의해주어도 같은 에러가 발생한다.

아직도 명확한 이유를 모르겠지만, 베이스 코드(모듈)의 naver login을 위한 activity에 exported가 명시되지 않아서 그렇더라;;

쨌든 해결방법은!!

manifest 파일에서 


<activity android:name="com.nhn.android.naverlogin.ui.OAuthCustomTabActivity"
android:exported="false"/>

위 코드를 <application>태그 안에 추가해주면된다.


Share:
Read More
,

Some problems were found with the configuration of task ':app:processDebugGoogleServices' (type 'GoogleServicesTask') 빌드 에러 해결방법

Some problems were found with the configuration of task ':app:processDebugGoogleServices' (type 'GoogleServicesTask') 빌드 에러 해결방법

안드로이드 개발 블로그


Some problems were found with the configuration of task ':app:processDebugGoogleServices' (type 'GoogleServicesTask').

  - Type 'com.google.gms.googleservices.GoogleServicesTask' field 'intermediateDir' without corresponding getter has been annotated with @OutputDirectory.

    Reason: Annotations on fields are only used if there's a corresponding getter for the field.

    Possible solutions:

      1. Add a getter for field 'intermediateDir'.

      2. Remove the annotations on 'intermediateDir'.


위와 같은 에러가 발생했다.

방법은 간단하다. 

프로젝트 수준의 build.gradle에 들어가서 google play service 버전을 4.3.8로 올려준다


buildscript {
ext.kotlin_version = '1.6.10'
ext.objectboxVersion = '2.1.0'
repositories {
// maven { url "http://1.201.142.80:8014/artifactory/list/ark/" }
google()
jcenter()
// maven { url "https://nexus.uzuki.live/repository/ark/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.objectbox:objectbox-gradle-plugin:$objectboxVersion"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.3.8'    //요기닷!
}
}
Share:
Read More
,

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/R$string 빌드 에러 해결방법

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/R$string 빌드 에러 해결방법


안드로이드 개발 블로그


회사에서 옛날 프로젝트의 그래들을 업그레이드하다가 에러가 났다.

에러내용은 아래와 같다.

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/R$string

아래처럼 objectboxVersion을 2.5.1로 변경해주면 해결된다.
buildscript {
ext.kotlin_version = '1.6.10'
ext.objectboxVersion = '2.5.1'    //objectbox 버전
repositories {
// maven { url "http://1.201.142.80:8014/artifactory/list/ark/" }
google()
jcenter()
// maven { url "https://nexus.uzuki.live/repository/ark/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.objectbox:objectbox-gradle-plugin:$objectboxVersion"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.3.8'
}
}


Share:
Read More
, ,

안드로이드 unsupported or unrecognized ssl message 빌드 에러 해결방법

 unsupported or unrecognized ssl message 빌드 에러 해결방법

안드로이드 개발 블로그

회사에서 옛날 프로젝트의 그래들과 sdk를 업데이트하다가 

unsupported or unrecognized ssl message

에러를 맞이했다.

문제는 Maven 스토리지 url이 잘못되어서 그렇다.


우리 회사는 에이전시회사라서 앱을 최대한 빨리 찍어내야한다.

그래서 자주쓰이는 기능들을 abstract 클래스와 라이브러리로 세팅을 해놓는다.

그 중에 sns로그인을 위해서 카카오 maven 저장소 url을 추가해놓았다.

근데 이게 예전 프로젝트라서 http url로 적혀있었다.

http://devrepo.kakao.com:8088/nexus/content/groups/public/

👇

https://devrepo.kakao.com/nexus/content/groups/public/

위에서 아래로 바꿔주면 된다.


그리고 unsupported or unrecognized ssl message 에러가 발생하기 이전에 maven 저장소의 url을 http에서 https로 변경하라는 에러가 뜰 것이다.

그때 기존 http://devrepo.kakao.com:8088/nexus/content/groups/public/에서 https로만 바꿔주면 안된다.

https://devrepo.kakao.com/nexus/content/groups/public/로 완전히 바꿔주면 unsupported or unrecognized ssl message 에러는 뜰 일이 없다.



Share:
Read More
, ,

Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.16 에러 해결



안드로이드 앱을 빌드하다가

Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.16 

에러가 발생했다.

코틀린 버전을 1.4.32로 변경하니까 해결되었다.

빌드시 사용하는 코틀린 버전을 좀 올려보길 바란다.

Share:
Read More
, , , ,

cvc-complex-type.2.4.a: Invalid content was found starting with element 'base-extension'. One of '{layoutlib}' is expected 에러 해결 방법

 cvc-complex-type.2.4.a: Invalid content was found starting with element 'base-extension'. One of '{layoutlib}' is expected 해결방법


회사에서 가끔 옛날 프로젝트 소스를 전달해주면서 약간의 수정을 해달라고 요구할 때가 있다.

그래서 소스를 받아서 압축을 풀고 실행해보면 

안드로이드 빌드 에러

이런 에러가 발생한다.

구글링해보면 정확히는

cvc-complex-type.2.4.a: Invalid content was found starting with element 'base-extension'. One of '{layoutlib}' is expected

인가보다.

해결방법은 간단하다.

그래들 버전을 올려보면 된다!





Share:
Read More