Samuel Muiruri
Samuel Muiruri

Reputation: 522

Setting up first Android Hello World

I'm trying to setup my first Hello World on Android Studio using the AVD Emulator with android Nexus 5 API 22 The emulator runs and I believe my app named 'design' should be on the apps list but isn't. The error message from Gradle is:

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's Event Log Reads:

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

The Run Log Reads:

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

Upvotes: 0

Views: 83

Answers (1)

Prerak Sola
Prerak Sola

Reputation: 10009

The files required are missing and as per the logs, you are using Gradle in offline mode.
Go to File -> Settings. Select Gradle under Build, Execution, Deployment and uncheck Offline work. It will download the missing files.

Upvotes: 2

Related Questions