Q:

The import com.google.android.vending cannot be resolved in an imported android project

I have just imported an android project and when I am trying to run it it is giving me error on the following imports
import com.google.android.vending.licensing.AESObfuscator;
import com.google.android.vending.licensing.LicenseChecker;
import com.google.android.vending.licensing.LicenseCheckerCallback;
import com.google.android.vending.licensing.ServerManagedPolicy;

Any help resolving this would be greatly appreciated.

A:

You’re getting those errors because you didn’t import the licensing library. 
Go into the folder where u downloaded the android-sdks stuff.
So there are 2 things: I) a Licensing Library and II) the Sample Licensing App
I) The licensing library is located in:
UserName/android-sdks/extras/google/play_licensing/library
II) The Sample Licensing App is located in:
UserName/android-sdks/extras/google/play_licensing/sample
OR
In Eclipse, File-> New -> Other… -> Android Sample Project -> (Choose a Target and hit next) -> Google Play Licensing Library
Step 1: 
In Eclipse, Go to File-> New -> Other… -> Android Project from Existing Code -> (Locate the library, ie= UserName/android-sdks/extras/google/play_licensing/library)
Step 2:
Once you have the library imported to Eclipse, right click on the package and go to Properties -> Android. Make sure the “Is Library” option is checked. 
Step 3:
In Eclipse, File-> New -> Other… -> Android Sample Project -> (Choose a Target and hit next) -> Google Play Licensing Library. My package was named “play_licensing_sample” by default. 
Step 4:
Right click on “play_licensing_sample” and go to Properties-> Android -> Add… -> (Choose the Licensing Library u made in Step 2)-> Apply
You’re done!

A:

I ran into this issue when trying to set up my Android project for an APK expansion file.
The following steps resolved it for me:

Add downloader_library to eclipse as a "project from existing source" (it has errors)
Add licensing library to eclipse as a "project from existing source"
Add licensing library to downloader_library project

A:

In android studio 2.2.3 I was able to fix the "package com.google.android.vending.licensing does not exist"
error by:

Right click the downloader_library module from your project view
Select "Open Module Settings"
Select "Dependencies" Tab
Press plus sign + then select "3 Module Dependency"
Select "market_licensing" and press OK.

Original writeup of fix at https://kitefaster.com/2017/02/15/expansion-apk-files-android-studio/

