2016-12-22 8 views
0

Я пытаюсь настроить свой первый Hello World на Android Studio с помощью AVD Emulator с android Nexus 5 API 22 Эмулятор запускается, и я считаю, что мое приложение под названием «дизайн» должно быть в списке приложений, но isn ' т. Сообщение об ошибке от Gradle является:Настройка первого Android Hello World

Error:A problem occurred configuring project ':app'. 
> Could not resolve all dependencies for configuration ':app:_debugUnitTestApkCopy'. 
    > Could not resolve junit:junit:4.12. 
    Required by: 
     Design:app:unspecified 
     > No cached version of junit:junit:4.12 available for offline mode. 

Information:BUILD FAILED 

Журнал событий Gradle читает:

5:38:03 PM Gradle sync started 
5:38:15 PM Gradle sync completed 
5:50:59 PM Executing tasks: [:app:clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:assembleDebug] 
5:52:03 PM Gradle build finished with 1 error(s) in 1m 9s 632ms 
5:52:03 PM Unresolved Dependencies 
      Unresolved dependencies detected while building project in offline mode. Please disable offline mode and try again. 
      Disable offline mode 
5:52:37 PM Executing tasks: [:app:clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:assembleDebug] 
5:52:39 PM Gradle build finished with 1 error(s) in 2s 99ms 
5:52:39 PM Unresolved Dependencies 
      Unresolved dependencies detected while building project in offline mode. Please disable offline mode and try again. 
      Disable offline mode 

Run Log Читает:

Hax is enabled 
Hax ram_size 0x40000000 
HAX is working and emulator runs in fast virt mode. 
Warning: requested ram_size 1536M too big, reduced to 1024M 
emulator: Listening for console connections on port: 5554 
emulator: Serial number of this emulator (for ADB): emulator-5554 
emulator: emulator window was out of view and was recentered 
+1

Посмотрите журнал событий Gradle: отключите автономный режим. Для этого: http://stackoverflow.com/questions/28712025/how-to-disable-gradle-offline-mode-in-android-studio –

ответ

2

Файлы, необходимые отсутствуют и в соответствии с бревнами, вы используют Gradle в автономном режиме.
Перейти к File -> Settings. Выберите Gradle под Build, Execution, Deployment и снимите отметку Offline work. Он загрузит недостающие файлы.

Смежные вопросы