• 11
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

I'm trying to create an AVD with Android on Linux. When I run android create avd in my Cordova project folder, I get this message:

  -k --package : Package path of the system image for this AVD (e.g.
                 'system-images;android-19;google_apis;x86'). [required]

My problem is that I have no idea what to add for this option and can't find any good references online. Apparently I have system images installed:

enter image description here

But how do I reference these? I took a stab at it based on the example and I get this error:

david@david-Virtual-Machine:~/projects/test-test$ android create avd --package "system-images;android-25;google-apis;x86" --name "foo"
*************************************************************************
The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
*************************************************************************
Running //home/david/Android/Sdk/tools/bin/avdmanager create avd --package system-images;android-25;google-apis;x86 --name foo

Error: Package path is not valid. Valid system image paths are:

(In my platforms folder the only platform listed is android-25)

Any suggestions?

Pay attention that android is deprecated. Use avdmanager.

First, you need to download the necessary packages. Example of downloading API 23 packages for x86 emulators:

 ./sdkmanager "system-images;android-23;google_apis;x86"

Then accept the license agreement

 ./sdkmanager --licenses

and then create your emulator

./avdmanager create avd -n test -k "system-images;android-23;google_apis;x86" -b x86 -c 100M -d 7 -f
  • 110
Reply Report
      • 1
    • @jabu.hlong Not necessary if you set the correct PATH in the environment variables (at least on Windows). And if one works a lot with CLI tools like a normal person, one should definitely add that to the path list.

The message

Error: Package path is not valid. Valid system image paths are:

indicates that the package could not be found - I bet the platform wasn't correctly installed .. In order to fix that problem, You can try installing it using the following commands:

android update sdk -u --filter platform-tools,android-25
sdkmanager --verbose "system-images;android-25;google_apis;x86"

and then create the avd using: avdmanager -v create avd -n x86 -k "system-images;android-25;google_apis;x86" -g "google_apis".

I hope this helps.

  • 17
Reply Report

You can also list your installed and available packages using:

$ sdkmanager --list

To install a system image use this:

$ sdkmanager  "system-images;android-25;google_apis;x86_64"

Then as stated above create the avd:

$ ./avdmanager create avd -n test -k "system-images;android-25;google_apis;x86_64" -b x86 -c 100M -d 7 -f
  • 9
Reply Report

You have to put package path with semicolons.

an example of a valid path would be

avdmanager create avd -k "system-images;android-16;google_apis;x86"

and put all other options that you require.

  • 1
Reply Report

As the advice properly says, the android command is deprecated. You need to use avdmanager and also specify the exact string that appears on your available packages as the package argument. In your case:

avdmanager create avd --package "android-25" --name "foo"

  • 0
Reply Report