안드로이드2020. 7. 23. 15:05
728x90

안드로이드 sdk ver.28 부터는 텍스트로 url을 접근하는 것이 막혔다고 합니다.

AVD 시뮬레이터로 실행하니 다음과 같은 에러가 발생했습니다.

net::ERR_CLEARTEXT_NOT_PERMITTED

 

[config.xml]

<platform name="android">
        <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
            <application android:networkSecurityConfig="@xml/network_security_config" />
            <!-- cleartextTraffic 허용 -->
            <application android:usesCleartextTraffic="true" />
        </edit-config>

<application android:usesCleartextTraffic="true" /> 부분을 추가했습니다.

 

 

[network_security_config.xml]

(resources/android/xml/network_secutiry_config.xml)

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <!-- 이부분 추가 -->
        <trust-anchors>
           <certificates src="system" />
        </trust-anchors>
        <domain includeSubdomains="true">localhost</domain>
        <!-- 허용할 사이트 추가 -->
        <domain includeSubdomains="true">google.com</domain>
        <domain includeSubdomains="true">youtube.com</domain>
    </domain-config>
</network-security-config>

 

다음의 코드들을 추가했습니다.

<trust-anchors> 
           <certificates src="system" /> 
 </trust-anchors>

 

허용할 사이트를 추가했습니다.(구글, 유튜브)

이 때 http를 뺀 주소로 적습니다.

<domain includeSubdomains="true">google.com</domain>

<domain includeSubdomains="true">youtube.com</domain>

반응형
Posted by mminky
깃 & 깃허브 입문2020. 5. 19. 22:07
728x90

깃에 repository를 생성한 후

안드로이드 스튜디오와 연동해보겠습니다!

 

1. 안드로이드 스튜디오 세팅

 

File -> Settings

 

Version Control -> Git -> Test버튼

만약 깃이 잘 설치되어있다면 Git Version is ~라는 창이 뜰 것이다.

 

Add account를 클릭한 후

Login에 깃허브 계정을, Password에 비밀번호를 입력한 후 Log In을 클릭한다

(기존계정은 초록 박스 안의 +와 -를 이용해서 추가/ 제거가 가능하다.)

 

2. 안드로이드 - 깃허브 연결

 

vcs -> Enable Version Control Integration

Git을 선택한다.

 

Import Into Version Control -> Share Project on GitHub 클릭

 

여기서 생성할 저장소 이름을 적는다.

필요하면 Description에 설명을 적는다.

(3명 이하에서는 private를 무료로 제공한다.)

 

'Share'버튼을 클릭하면 다음과 같은 창이 뜬다.

어떤 파일들을 커밋할지에 대한 창이다.

나는 다 선택했다!

 

하단에 Commit Message에는 원하는 메시지를 적으면 된다.

 

깃허브에 들어가서 확인해보면 커밋이 잘 되어있는 것을 확인 할 수 있다.

반응형
Posted by mminky