【问题标题】:Google licence Verification Library not getting referenced, android-studio 0.8.2谷歌许可证验证库没有被引用,android-studio 0.8.2
【发布时间】:2014-09-27 12:32:00
【问题描述】:

作为 android 和 android studio(0.8.2) 的新手,我正在努力为我的项目实施 Google LVL。 我已经点击了链接:-http://developer.android.com/google/play/licensing/setting-up.html 以及来自网络的更多帮助。 我想将 LVL 添加为 library project 并按照此链接中提到的步骤进行操作:-- How do I add a library project to Android Studio?

1) 为 LVL 创建了一个新模块。 2)将下载的com目录中的代码复制到新创建的modules com目录中。 3)我在主项目上使用依赖选项卡添加了正确的依赖。

以下导入未编译。

导入 com.google.android.vending.licensing.LicenseChecker; 导入 com.google.android.vending.licensing.LicenseCheckerCallback;

如果我验证我的配置文件,一切看起来都是正确的。

以下是我的 android.xml `

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

`

这个 LVL 模块的构建文件是:

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

主应用程序的构建文件显示添加的依赖项:

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

}

settings.gradle 有,看起来也很合适:

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

我的项目如下设置:

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

【问题讨论】:

    标签: android-studio android-gradle-plugin android-library


    【解决方案1】:

    仔细查看您的文件后,我发现可能的原因是 LVL 库模块的 Android.xml 中的包名称。 当您为任何现有库创建新模块时,包名称应与库的包匹配,否则如果您愿意,您需要编辑所有文件包减速。

    你需要单独编译你的库模块,看看是否一切顺利。

    此外,除了 com 文件夹,您还需要将 res 文件夹复制到库模块以避免任何进一步的问题。 希望这会有所帮助。

    【讨论】:

      猜你喜欢
      • 2013-08-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-07
      • 1970-01-01
      相关资源
      最近更新 更多