标签: apk-expansion-files

如何使用React-Native的APK扩展文件

即时通过使用大尺寸的声音文件构建应用程序.所以我的apk文件比100Mb限制大得多的问题,我需要使用APK扩展文件.我试着在互联网上搜索如何处理这个问题,但一无所获.也许你们中的一些人已经面临这个问题,现在如何解决它.

谢谢.

android apk-expansion-files react-native react-native-android

8
推荐指数
0
解决办法
499
查看次数

如何从主APK中排除资源或aar文件

由于我需要减小APK文件的大小,我已经按照Apk扩展指南将APK分成块.

下载库定义的方式来下载expansion file,但我需要知道的排除方法resource files,并aar 从APK文件.

我发现以下,但这些既不删除resource-drawable files任何arr文件,也不删除任何文件,并且apk的大小保持不变.

出于测试目的,我添加drawables了大约4 MB几个arr文件3 MB.我是apkBuild->Build APK选项创建的.我不知道以下是否会影响已签名的APK.

sourceSets {
    main {
        resources {
            exclude '**/drawable/*'

        }
    }
}



android {
    packagingOptions {
        exclude 'lib/armeabi/a.so'
    }
}
Run Code Online (Sandbox Code Playgroud)

android android-install-apk apk-expansion-files

8
推荐指数
2
解决办法
963
查看次数

已下载扩展文件但不存在

所以我复制了Android的扩展包示例,并根据谷歌提供的指南运行.我已成功通过存储本地.obb文件使其工作,但我无法让它与下载.obb文件一起工作.状态已更改为IDownloaderClient.STATE_COMPLETED但未找到任何文件.

我经历过的步骤:

  1. 使样品运行(更新了BASE64_PUBLIC_KEY,new package name,version number)
  2. 使用本地.obb文件成功测试.
  3. 制作apk并上传到与扩展文件一起播放.
  4. 安装签名的apk并运行应用程序.< - 这里说下载很成功,但在下载过程中没有给出任何进度更新.

请帮助获取下载的扩展文件.

编辑:在第4步,我现在得到下载失败,因为无法找到资源.

编辑2:所以在调试之后,我看到状态变为无需下载,但无法验证文件,因为它丢失了.因此,出于某种原因,它认为该文件已被下载.

编辑3:所以在DownloaderService.class中我们有一个run()方法,它使得getExpansionURLCount()返回0.文档说:this will return zero if there has been no LVL fetch in the current session.经过多次挖掘后,我发现我从Google获得processServerResponse()的响应中包含响应代码256并且没有密钥FILE_URL.那么原因是什么?

android apk-expansion-files

7
推荐指数
1
解决办法
2001
查看次数

Google Play - 当用户从市场安装APP时,如何防止下载大型APK扩展文件

由于缺乏内部存储器,我的许多用户都无法从Play商店安装我的应用程序.应用程序的大小是:APK 37MB +扩展1,3 GB.

我知道很多用户不希望在系统内存中有如此大的数据,并且实现了许可和下载 - 库的示例,并且将扩展文件直接下载的代码更改为物理SD卡.但用户只能从选项菜单运行我的下载过程的应用.

.

问题:

谷歌在此声明:

"......如果Google Play无法下载扩展文件,则只下载APK."

但这似乎是错误的.许多用户抱怨安装问题和"挂起/挂起"下载.他们说,当他们从市场上安装App,谷歌播放尝试下载摆在首位的OBB-扩展文件,(是什么使事情变得更糟)到内部存储器.因此用户无法启动应用程序并使用我的下载实现.

由于我想利用谷歌授权机制的安全功能,我有以下想法:

  1. 将我的应用程序上传到开发者控制台而不进行扩展
  2. 使用1,3GB扩展上传另一个dummy-apk,不要发布它
  3. 尝试从我的原始应用程序的选项菜单下载扩展,并使用虚拟apk中的许可证密钥.

有人可以证实这可行吗?

有没有办法让Google Play直接将大型扩展下载到外部存储器?也许如果我修改了Manifest:

android:installLocation="auto"
Run Code Online (Sandbox Code Playgroud)

任何想法都很感激!

android download apk google-play apk-expansion-files

7
推荐指数
1
解决办法
1258
查看次数

对于使用Gradle进行APK扩展,play_licensing会使用downloader_library抛出AIDL错误

我尝试使用APK Expansion libs zip_file和downloader_library(需要play_licensing).zip_file工作正常,因为它没有依赖项,但是当我尝试Gradle同步时,play_licensing会引发错误.

Android Studio吐出此错误日志:

Information:Gradle tasks [:app:generateGoogleDebugSources, :app:libs:downloader_library:generateDebugSources, :app:libs:play_licensing:generateDebugSources, :app:libs:zip_file:generateDebugSources]
Information:/Users/faiz/Projects/Android/TogetherTime/app/libs/play_licensing/aidl/ILicenseResultListener.aidl:21 interface ILicenseResultListener should be declared in a file called com/android/vending/licensing/ILicenseResultListener.aidl.
Information:2 errors
Information:0 warnings
Information:See complete output in console
/Users/faiz/Projects/Android/TogetherTime/app/libs/play_licensing/aidl/ILicensingService.aidl
Error:(19) couldn't find import for class com.android.vending.licensing.ILicenseResultListener
Error:(19) Execution failed for task ':app:libs:play_licensing:compileReleaseAidl'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/Users/faiz/Projects/Android/android-sdk-macosx/build-tools/19.0.3/aidl -p/Users/faiz/Projects/Android/android-sdk-macosx/platforms/android-19/framework.aidl -o/Users/faiz/Projects/Android/TogetherTime/app/libs/play_licensing/build/source/aidl/release -I/Users/faiz/Projects/Android/TogetherTime/app/libs/play_licensing/aidl -I/Users/faiz/Projects/Android/TogetherTime/app/libs/play_licensing/src/release/aidl -d/var/folders/y6/g0d5m3f94rxdvq5myp53d9k80000gn/T/aidl662748145109587430.d /Users/faiz/Projects/Android/TogetherTime/app/libs/play_licensing/aidl/ILicensingService.aidl

Error Code:
  1

Output:
/Users/faiz/Projects/Android/TogetherTime/app/libs/play_licensing/aidl/ILicensingService.aidl:19: couldn't find import for class com.android.vending.licensing.ILicenseResultListener
Run Code Online (Sandbox Code Playgroud)

我没有修改任何库,但由于它们不是为Gradle构建的,我从另一个项目复制了build.gradle并相应地修改它们.

downloader_library /的build.gradle

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies …
Run Code Online (Sandbox Code Playgroud)

android gradle android-studio apk-expansion-files

7
推荐指数
1
解决办法
1229
查看次数

无法在魅族m3笔记上安装.obb文件(state = 21)

我遇到了另一个与APK Expansion文件(.obb文件)有关的奇怪问题.我的扩展文件在我的所有测试设备上都正常安装:

  • Sony Xperia Z1 Compact(API 22)
  • 索尼Xperia Z1 Ultra(API 22)
  • LG Nexus 5X(API 23)
  • LG Nexus 4(API 17)

我用jobb -utilite 创建了加密的.obb文件:

jobb -o obb-filename -d files -dir -k password -pn applicationId -pv versionCode

在我的应用程序中,我使用以下代码读取.obb文件:

public void initialize(final Context context) {
    final StorageManager storageManager = (StorageManager) context.getSystemService(Context.STORAGE_SERVICE);
    final File mainObbFile = getMainObbFile();

    final OnObbStateChangeListener listener = new OnObbStateChangeListener() {
        @Override
        public void onObbStateChange(String path, int state) {
            super.onObbStateChange(path, state);
            if (state == OnObbStateChangeListener.MOUNTED) {
                // work with obb file …
Run Code Online (Sandbox Code Playgroud)

android apk-expansion-files

7
推荐指数
1
解决办法
592
查看次数

无法挂载用JOBB创建的obb文件

我正在尝试使用mountExpansion()此问题中找到的方法安装我使用JOBB工具创建的加密或非加密的obb文件:在Android中安装加密的obb apk扩展文件.有趣的是,当我尝试使用加密文件时,我得到状态21,根据https://developer.android.com/reference/android/os/storage/OnObbStateChangeListener.html表示

系统无法安装OBB.从通过StorageManager进行的调用返回状态消息

当我尝试一个非加密文件时,我得到状态20,这意味着:

尝试安装OBB时遇到内部系统错误.从通过StorageManager进行的调用返回状态消息

这些解释都没有对可能导致各州发生的事情有所帮助.有什么建议吗?

我对类似问题的回答中的评论也可能是相关的:https://stackoverflow.com/a/37957811/1489990作为我能够以jobb开始创建obb文件的唯一方法是强制FAT32用来代替FAT16.

android apk-expansion-files

6
推荐指数
1
解决办法
646
查看次数

如何挂载加密的APK扩展文件?

我尝试以这种方式挂载扩展文件:

    final StorageManager storageManager = (StorageManager) getSystemService(STORAGE_SERVICE);
    String obbPath = Environment.getExternalStorageDirectory() + "/Android/obb";
    final String obbFilePath = obbPath + "/com.example/main.1.com.example.obb";
    storageManager.mountObb(obbFilePath, "SecretKey", new OnObbStateChangeListener() {
        @Override
        public void onObbStateChange(String path, int state) {
            super.onObbStateChange(path, state);
            if (state == OnObbStateChangeListener.MOUNTED) {
                onObbMounted();
            } else {
                Log.d("##", "Path: " + path + "; state: " + state);
            }
        }
    });
Run Code Online (Sandbox Code Playgroud)

但是在运行时我得到状态21:ERROR_COULD_NOT_MOUNT:

Path: /storage/sdcard0/Android/obb/com.example/main.1.com.example.obb; state: 21
Run Code Online (Sandbox Code Playgroud)

我添加了这个:

    File f = new File(obbFilePath);
    if (!f.exists()) {
        Log.e("OBB", "FILE NOT FOUND!!!");
    }
Run Code Online (Sandbox Code Playgroud)

而logcat说该文件存在.我不知道,为什么我能得到这个状态21?

android apk-expansion-files

5
推荐指数
1
解决办法
3174
查看次数

Android apk 扩展文件 - 可选

我可以使用主扩展文件作为应用程序中的可选下载选项吗?所以我不需要用 APK 文件下载它,但稍后用户会这样做。

android android-download-manager apk-expansion-files

5
推荐指数
1
解决办法
209
查看次数

如何在库项目中导入包和类文件

APK 大小已达到105 MB,我需要创建APK Expansion Files.

我正在关注用于创建扩展文件的Android 文档

我已经下载Google Play APK Expansion LibraryGoogle Play Licencing Library

现在我需要将这些库添加到我的应用程序中。

我遵循了文档。它指出以下

  1. 选择文件 > 新建 > 新模块。
  2. 在 Create New Module 窗口中,选择 Android Library,然后选择 Next。
  3. 指定应用程序/库名称,例如“Google Play License Library”和“Google Play Downloader Library”,选择“最低 SDK 级别”,然后选择“完成”。
  4. 选择文件 > 项目结构。
  5. 选择 Properties 选项卡,然后在 Library Repository 中,从 /extras/google/ 目录(play_licensing/ 用于许可验证库或 play_apk_expansion/downloader_library/ 用于下载器库)输入库。

现在的问题是,在步骤-5:当我添加路径遵循Library Repository它运行了一段时间摇篮构建,然后什么也不做,当我重新打开Project structure有什么的Library Repository field

C:\Users\DELL\AppData\Local\Android\Sdk\extras\google\market_licensing\library

我无法理解如何将此项目导入我的应用程序。另一种方法是单独复制每个文件并将其添加到库模块中,但我不想尝试这种方法。

项目结构:

在此处输入图片说明

performance android android-layout apk-expansion-files

5
推荐指数
1
解决办法
295
查看次数