Cleartext HTTP traffic to www. crazyit. org not allowed, 잘못된 임시 해결

1338 단어 Android
이 강의 '미 친 안 드 로 이 드 - 자바 버 전' 은 2020 년 1 월 까지 고치 지 못 한 작은 실수 가 많 았 다.그 중 많은 오 류 는 당신 의 프로그램 운행 을 직접적 으로 막 습 니 다.
예 를 들 어 그 책의 예: 3.6. 네가 실행 하면 다음 과 같이 보고 할 것 이다.
Cleartext HTTP traffic to www. crazyit. org 에 서 는 오 류 를 허용 하지 않 습 니 다.
시간 이 촉박 하기 때문에 가장 간단 한 수정 방법 은 build. gradle 파일 을 다음 과 같이 수정 하 는 것 입 니 다.
apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "org.crazyit.event"
        minSdkVersion 26
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

그리고 실행 할 수 있 습 니 다.

좋은 웹페이지 즐겨찾기