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

jax$ react-native run-android Starting JS server... Building and installing the app on the device (cd android && ./gradlew installDebug... Could not install the app on the device, read the ...

Hello,
Im getting same error message.

C:ProjectsMobAppProject1sample1>react-native run-android
Scanning folders for symlinks in C:ProjectsMobAppProject1sample1node_modules (249ms)
Starting JS server…
Building and installing the app on the device (cd android && gradlew.bat installDebug)…
Downloading https://services.gradle.org/distributions/gradle-2.14.1-all.zip

Exception in thread «main» java.net.UnknownHostException: services.gradle.org
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install$1.call(Install.java:59)
at org.gradle.wrapper.Install$1.call(Install.java:46)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:46)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:126)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
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/getting-started.html

Where do i run this commend ? chmod 755 android/gradlew
if i run this in terminal i get this error message : ‘chmod’ is not recognized as an internal or external command,
operable program or batch file.

I am developing a react-native app. I work on it everyday, but today, I launch the command «react-native run-android» and I get this message:

Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat installDebug...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> A problem occurred configuring project ':react-native-billing'.
   > Could not resolve all dependencies for configuration ':react-native-billing:_debugCompile'.
      > Could not find com.android.support:appcompat-v7:25.3.1.
        Searched in the following locations:
            file:/C:/Users/xrobot/.m2/repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.pom
            file:/C:/Users/xrobot/.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:/C:/Users/xrobot/Desktop/React Native/AwesomeProject/node_modules/react-native/android/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.pom
            file:/C:/Users/xrobot/Desktop/React Native/AwesomeProject/node_modules/react-native/android/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.jar
            file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.pom
            file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.jar
            file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.pom
            file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/25.3.1/appcompat-v7-25.3.1.jar
        Required by:
            AwesomeProject:react-native-billing: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:/C:/Users/xrobot/.m2/repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.pom
            file:/C:/Users/xrobot/.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:/C:/Users/xrobot/Desktop/React Native/AwesomeProject/node_modules/react-native/android/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.pom
            file:/C:/Users/xrobot/Desktop/React Native/AwesomeProject/node_modules/react-native/android/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.jar
            file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.pom
            file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/android/m2repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.jar
            file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.pom
            file:/C:/Users/xrobot/AppData/Local/Android/sdk/extras/google/m2repository/com/android/support/recyclerview-v7/25.3.1/recyclerview-v7-25.3.1.jar
        Required by:
            AwesomeProject:react-native-billing: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:/C:/Users/xrobot/.m2/repository/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.pom
            file:/C:/Users/xrobot/.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:/C:/Users/xrobot/Desktop/React Native/AwesomeProject/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:/C:/Users/xrobot/Desktop/React Native/AwesomeProject/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:/C:/Users/xrobot/AppData/Local/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:/C:/Users/xrobot/AppData/Local/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:/C:/Users/xrobot/AppData/Local/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:/C:/Users/xrobot/AppData/Local/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:
            AwesomeProject:react-native-billing: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: 35.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

Why ?

#javascript #android #react-native

#javascript #Android #реагирует на собственный

Вопрос:

Я получаю эту ошибку при попытке создать приложение с использованием react native с использованием Google Maps. ошибка возникла после редактирования манифеста Android для включения ключа API. Это ошибка

 C:Usersx0zonDocumentsCPTR405carbooking>react-native run-android
info Starting JS server...
info Building and installing the app on the device (cd android amp;amp; gradlew.bat app:installDebug)...
> Task :app:processDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
  C:Usersx0zonDocumentsCPTR405carbookingandroidappbuildintermediatesmerged_manifestsdebugAndroidManifest.xml:34: AAPT: error: attribute android:configchanges not found.

  C:Usersx0zonDocumentsCPTR405carbookingandroidappbuildintermediatesmerged_manifestsdebugAndroidManifest.xml:34: AAPT: error: attribute android:windowsoftinputmode not found.

  error: failed processing manifest.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 6s
23 actionable tasks: 1 executed, 22 up-to-date
error 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/getting-started.html
error Command failed: gradlew.bat app:installDebug. Run CLI with --verbose flag for more details.
 

это манифест Android

 <manifest xmlns:android="http://schemas.android.com/apk/res/android" 
  package="com.carbooking">

    <uses-permission android:name="android.permission.INTERNET" />

    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:allowBackup="false"
      android:theme="@style/AppTheme">
      <meta-data 
        android:name="com.google.android.geo.API_KEY" 
        android:value="API key intentionally removed />
      <activity 
        android:name=".MainActivity" 
        android:label="@string/app_name" 
        android:configchanges="keyboard|keyboardHidden|orientation|screenSize" 
        android:windowsoftinputmode="adjustResize">
        <intent-filter>
          <action android:name="android.intent.action.MAIN" />
          <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
      </activity>
      <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
    </application>

</manifest>
 

Я новичок в react и android studio, и я попробовал некоторые решения, связанные с внесением изменений в версию gradle в build.gradle, и у меня есть одноклассники, использующие тот же файл манифеста Android без проблем. Я потерян и сбит с толку.

Комментарии:

1. Попробуйте очистить проект, используя следующую команду cn android amp;amp; ./ gradlew clean

Troubleshooting

Не стартует билд react-native run-android


A problem occurred configuring project ‘:app’.

> failed to find Build Tools revision 23.0.1

Устанавливаем недостающий пакет

Или пробуем запускать команду через sudo

SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

Создаем в папке проекта/adroid файл local.properties с содержанием:

sdk.dir = /Users/USERNAME/Library/Android/sdk

Еще одна возможная ошибка:

ERROR watch {ProjectDir}/android/app/build/generated/source/r/debug/com EACCES

Устанавливаем соответствуещие права на директорию, или удаляем ее)))

Еще вариант ошибки:

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

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

Ставим права на директорию:

$ chmod 755 android/gradlew

Не отображаются шрифтовые иконки

Если после установки пакета, который включает шрифтовые иконки, наприер «Native Base» не отобращаются шрифтовые иконки, не забываем запустить

$ react-native link

Далее, удаляем приложение с эмулятора и снова запускаем билд

Не работает fetch с localhost («Network Request Failed»)

Смотрим свой IP-адрес в локальной сети, и пишем вместо localhost

Не стартует билд:

* What went wrong:
Execution failed for task ‘:app:installDebug’.
> com.android.builder.testing.api.DeviceException: Could not create ADB Bridge. ADB location: /Users/admin/Library/Android/sdk/platform-tools/adb

Такая ошибка у меня возникала при использовании Genymotion.

Settings → ADB → Use custom Android SDK tools должно решить проблему.

В частном случае, мне это помогло только после переустановки Genymotion и Android Studio.

На моем MAC это не помогло, но заметил, что ошибки нет при подключении к определенным Wi-Fi сетям. Почему так — не ясно…

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ‘:react-native-vector-icons:prepareComAndroidSupportRecyclerviewV72340Library’.
> Could not expand ZIP ‘C:Androidsdkextrasandroidm2repositorycomandroidsupportrecyclerview-v723.4.0recyclerview-v7-23.4.0.aar’.

Решение:

cd android
gradlew clean

Понравилась статья? Поделить с друзьями:
  • Could not connect to server socket error 10060 не получается соединиться
  • Could not handshake error in the pull function
  • Could not configure port 5 input output error
  • Could not get response error socket hang up
  • Could not complete your request because of a program error фотошоп при открытии файла