【问题标题】:Using com.google.android.vending (Android APK expansion files) in Android Studio在 Android Studio 中使用 com.google.android.vending(Android APK 扩展文件)
【发布时间】:2016-01-02 14:11:09
【问题描述】:

我正在尝试在我的 Android Studio 项目中使用 Android APK 扩展文件。我已按照官方网站上的说明进行操作:http://developer.android.com/google/play/expansion-files.html#Preparing

在 Android Studio 中,我有这两个模块:

Picture

其中一个模块的build.gradle文件(另一个类似):

apply plugin: 'com.android.library'
android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
}

repositories {
    "/Users/andro/Library/Android/sdk/extras/play_licensing"
}

在主项目的 build.gradle 文件中,我有这个依赖项:

dependencies {
compile project(':viewpagerindicator')
compile 'com.android.support:appcompat-v7:19.1.0'
compile files('libs/libGoogleAnalyticsServices.jar')
compile project(':googleplaylicenselibrary')
compile project(':playdownloaderlibrary')
}

但在尝试使用下载器服务中的任何内容时,我仍然收到此错误:

Error:(35, 55) error: package com.google.android.vending.expansion.downloader does not exist
Error:(36, 55) error: package com.google.android.vending.expansion.downloader does not exist
Error:(48, 10) error: cannot find symbol class IDownloaderService
Error:(49, 10) error: cannot find symbol class IStub

我该如何解决这个问题?

【问题讨论】:

  • aidl 文件是否在正确的位置? (这在移动到 gradle 时发生了变化)。旁注:将所有模块中的appcompat-v7 设为相同版本以进行整理
  • @Blundell 这个aidl 文件是什么?我在官方文档中找不到任何提及此文件的内容,请您指出正确的位置吗?
  • 也许不是aidl 在看演示,尽管 logcat 暗示了它。 / 哦,等一下,如果您在没有 google 配置的模拟器或设备上运行,您知道您会收到该错误吗? 我认为

标签: android android-studio android-studio-import


【解决方案1】:

Android 接口定义语言 (AIDL) 文件在查看您的错误消息时可能位于错误的位置。您需要浏览Gradle Plugin User Guide 以找出您的问题所在。当您阅读时,您将能够通过检查所需设置和您的设置之间的差异来确定我的猜测是否准确。即使我说的不对,即使在这种情况下,阅读指南也会帮助您开始。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-03-06
    • 2012-08-12
    • 1970-01-01
    • 1970-01-01
    • 2018-05-21
    • 2021-12-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多