Blog

* 개발자 모드 활성화 하기

 1. 먼저 "설정 - 휴대전화 정보"로 들어갑니다.

 2. "MIUI 버전"을 7번 눌러 주면, 개발자 모드가 활성화 됩니다.



* USB 디버깅 및 설치 활성화 하기

 1. "설정 - 추가 설정-개발자 옵션"으로 들어갑니다.

 2. 상단에 있는 "개발자 옵션"은 활성화가 되어 있어야 합니다.

 3. "USB 디버깅", "USB로 설치", "USB 디버깅(보안 설정)"을 차례로 활성화 시켜줍니다.

4. "MIUI 최적화 켜기"를 끄고 재부팅을 하면 됩니다.

- 이를 끄지 않을 경우 아래 오류와 같이 USB로 앱 설치가 되지 않는 문제가 생깁니다.

- 아래 오류는 react native 에서 빌드한 오류이며, Android Studio에서도 동일한 오류가 발생합니다.


Execution failed for task ':app:installDebug'.

> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to establish session




신고

'Programing > Android' 카테고리의 다른 글

샤오미 개발자 모드 활성화 하기  (1) 2017.06.26

Comment +1

한동안 손을 안 댄 프로젝트를 수정할 일이 생겼다.

수정을 다하고 빌드를 해서 실행을 할려고 하니 아래와 같은 에러가 발생 하였다.


JS server already running.

Running /Users/asata/Library/Android/sdk/platform-tools/adb -s LGF460L17e67912 reverse tcp:8081 tcp:8081

Building and installing the app on the device (cd android && ./gradlew installDebug...

google-services plugin could not detect any version for com.google.android.gms or com.google.firebase, default version: 9.0.0 will be used.

please apply google-services plugin at the bottom of the build file.


FAILURE: Build failed with an exception.


* What went wrong:

A problem occurred configuring project ':app'.

> A problem occurred configuring project ':react-native-picker'.

   > Could not resolve all dependencies for configuration ':react-native-picker:_debugCompile'.

      > Could not find com.android.support:appcompat-v7:25.3.1.

        Searched in the following locations:

            file:/Users/asata/.m2/repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.pom

            file:/Users/asata/.m2/repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.jar

            https://jcenter.bintray.com/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.pom

            https://jcenter.bintray.com/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.jar

            file:/Users/asata/Project/ReactNative/MyGumiMap/node_modules/react-native/android/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.pom

            file:/Users/asata/Project/ReactNative/MyGumiMap/node_modules/react-native/android/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.jar

            file:/Users/asata/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.pom

            file:/Users/asata/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.jar

            file:/Users/asata/Library/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.pom

            file:/Users/asata/Library/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.jar

        Required by:

            MyGumiMap:react-native-picker:unspecified > com.facebook.react:react-native:0.42.3-atlassian-1

      > Could not find com.android.support:recyclerview-v7:25.3.1.

        Searched in the following locations:

            file:/Users/asata/.m2/repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.pom

            file:/Users/asata/.m2/repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.jar

            https://jcenter.bintray.com/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.pom

            https://jcenter.bintray.com/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.jar

            file:/Users/asata/Project/ReactNative/MyGumiMap/node_modules/react-native/android/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.pom

            file:/Users/asata/Project/ReactNative/MyGumiMap/node_modules/react-native/android/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.jar

            file:/Users/asata/Library/Android/sdk/extras/android/m2repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.pom

            file:/Users/asata/Library/Android/sdk/extras/android/m2repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.jar

            file:/Users/asata/Library/Android/sdk/extras/google/m2repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.pom

            file:/Users/asata/Library/Android/sdk/extras/google/m2repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.jar

        Required by:

            MyGumiMap:react-native-picker:unspecified > com.facebook.react:react-native:0.42.3-atlassian-1

      > Could not find com.atlassian.mobile.video:okhttp-ws-compat:3.7.0-atlassian1.

        Searched in the following locations:

            file:/Users/asata/.m2/repository/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.pom

            file:/Users/asata/.m2/repository/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.jar

            https://jcenter.bintray.com/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.pom

            https://jcenter.bintray.com/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.jar

            file:/Users/asata/Project/ReactNative/MyGumiMap/node_modules/react-native/android/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.pom

            file:/Users/asata/Project/ReactNative/MyGumiMap/node_modules/react-native/android/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.jar

            file:/Users/asata/Library/Android/sdk/extras/android/m2repository/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.pom

            file:/Users/asata/Library/Android/sdk/extras/android/m2repository/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.jar

            file:/Users/asata/Library/Android/sdk/extras/google/m2repository/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.pom

            file:/Users/asata/Library/Android/sdk/extras/google/m2repository/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.jar

        Required by:

            MyGumiMap:react-native-picker:unspecified > com.facebook.react:react-native:0.42.3-atlassian-1


* Try:

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


BUILD FAILED


Total time: 11.786 secs

Could not install the app on the device, read the error above for details.

Make sure you have an Android emulator running or a device connected and have

set up your Android development environment:

https://facebook.github.io/react-native/docs/android-setup.html


오류가 났다는 노드 모듈에도 별 문제가 없는데도 이런 에러가 발생한다.

react native 버전을 올려도 별 차이가 없었고,

찾다찾다보니 android/build.gradle  파일을 수정을 하면 된다고 한다.


allprojects {

    configurations.all {

        resolutionStrategy {

            eachDependency { DependencyResolveDetails details ->

                if (details.requested.group == 'com.facebook.react' && details.requested.name == 'react-native') {

                    details.useVersion "0.36.0" // Your real React Native version here

                }

            }

        }

    }

}


굵게 표시한 부분에 현재 react native 버전을 기재를 해 주고

다시 빌드를 진행을 하면 정상적으로 설치되는 것을 확인 할 수 있다.

신고

Comment +0