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

최신폰에서 튕김현상이 발생합니다.

0 추천

안녕하세요.

앱이 최신폰에서 실행이 안됩니다.

단순하게 웹뷰로 홈페이지를 보여주고 푸시정도만 발송하는 앱입니다.

ssl 인증서가 적용되지 않은 사이트여서 AndroidManifest.xml 에

android:networkSecurityConfig="@xml/network_security_config"
android:usesCleartextTraffic="true"

위 내용을 추가하고 res/xml 폴더에 network_security_config.xml 파일을 생성하여

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config cleartextTrafficPermitted="true"/>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">my.domain.com</domain>
    </domain-config>
</network-security-config>

이렇게 추가했는데 안되네요....

앱을 실행하면 바로 중단됩니다.

갤럭시노트8까지는 잘 실행되는걸 확인했습니다.

어느 기종부터 안되는지는 모든 기종을 테스트하지 못하고......갤럭시S20 에서 실행하니 안되네요.

사이트를 ssl 적용된 주소로 바꿔봐도 마찬가지입니다. 

sdk 버전이 문제일까요?

build.gradle 는 아래와같이 되어있습니다.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 30
    buildToolsVersion '30.0.2'

    defaultConfig {
        applicationId "com.ofgod.eunwoo"
        minSdkVersion 14
        targetSdkVersion 30
        multiDexEnabled true
        versionCode 5
        versionName "1.0.5"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dexOptions {
        jumboMode true
        javaMaxHeapSize "4g"
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }
}

repositories {
    maven { url "https://jitpack.io" }
    google()
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    testImplementation 'junit:junit:4.12'
    //noinspection GradleCompatible
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation ('com.github.ParkSangGwon:TedPermission:v1.0.12') {
        exclude group: 'com.android.support'
        exclude module: 'appcompat-v7'
        exclude module: 'support-v4'
    }

    //noinspection GradleCompatible
    implementation ('com.google.firebase:firebase-messaging:9.4.0') {
        exclude group: 'com.android.support'
        exclude module: 'appcompat-v7'
        exclude module: 'support-v4'
    }

    implementation 'com.google.firebase:firebase-messaging:17.4.0'

    //서버로 데이터를 보낼때 okhttp를 사용한다면 추가
    implementation 'com.squareup.okhttp3:okhttp:3.10.0'
    implementation files('libs/jsoup-1.10.3.jar')
    //noinspection GradleCompatible
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:multidex:1.0.3'
}

apply plugin: 'com.google.gms.google-services'

어디가 문제일까요?

도움 부탁드립니다.

감사합니다.

mirae (220 포인트) 님이 2021년 6월 11일 질문

1개의 답변

0 추천
크래쉬 생기면 로그정도는 찍어주세요 인간적으로
익명사용자 님이 2021년 6월 11일 답변
죄송합니다. 제가 개발 초보라서요.....
안드로이드스튜디오에 연결된 폰은 갤럭시S7 인 제폰인데 오류없이 잘됩니다. apk 파일로 빌드한 파일을 다른사람이 소유한 최신폰으로 보낸후 발생하는 에러라서 로그를 어떻게 확인할수 있나요?
앱을 배포하실 때는 Firebase Crashlytics나  Analytics같은 세팅을 해서 내보내는 게 좋아요. 그렇지 않으면, 프로덕션 앱의 에러를 확인할 방법이 없어요.
만약 프로덕션이 아닌 디버깅 버전이라면, 다른 방법으로는 Playstore에서 로그를 저장하고 보낼 수 있는 앱을 설치해보라고 하세요.

다른 이야기이지만
com.android.support:multidex:1.0.3
아직도 multidex 라이브러리를 쓰고 계신 분이 계시네요. ^^
...