1

Being new to android and android studio(0.8.2), I am trying hard to implement Google LVL for my project. I have followed the link:- http://developer.android.com/google/play/licensing/setting-up.html and lots more help from web. I want to add LVL as library project and I followed the steps mentioned in this link:-- How do I add a library project to Android Studio?

1) Created a new module for LVL. 2) copied the code from the downloaded com directory to the newly created modules com directory. 3)I have added the proper dependency using dependency tab on main project.

Following imports are not compiling.

import com.google.android.vending.licensing.LicenseChecker; import com.google.android.vending.licensing.LicenseCheckerCallback;

If I verify my configuration files, all looks proper.

Following is my android.xml `

<application android:allowBackup="true"
    android:label="@string/app_name"
    android:icon="@drawable/ic_launcher">
</application>

`

build file of this LVL module is:

dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:19.+' }

build file of the main app shows the added dependency:

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':apkExpansion')

}

settings.gradle has, which also looks proper:

include ':app', ':licensing', ':apkExpansion' project(':licensing').projectDir = new File('library/licensing') project(':apkExpansion').projectDir = new File('library/apkExpansion')

My project as the following setup:

MyProject/ | settings.gradle + app/ | build.gradle + librarary/ + licensing | build.gradle + apkExpansion/ | build.gradle

Community
  • 1
  • 1

1 Answers1

0

After looking your files closely, I see the probable cause is the package name in Android.xml of LVL library module. When you create a new module for any existing library, the package name should match the package of library or else if you wish, you need to edit all files package deceleration.

You need to compile your library module separately to see if everything goes well.

Also, other than com folder you need to copy the res folder to your library module to avoid any further issues. Hope this helps.

Nicks
  • 16,030
  • 8
  • 58
  • 65