标签: android-app-bundle

在Android App Bundle中添加SwitchCompat后,找不到资源错误错误res / drawable / abc_switch_thumb_material.xml

我知道这个问题已经被问过好几次了,我已经阅读了所有这些问题,并且都匹配了所有依赖关系,因此它们具有相同的版本,但是此错误仅在添加Switch Compat之后才开始发生,您也可以通过按结构查看崩溃报告来看到。此错误不是在所有设备上都显示,而是在崩溃报告中显示给某些设备,也没有针对此崩溃的特定Android。由于Android应用程序捆绑包,我正在使用beta版本的android,这件事在非捆绑包(Apk)中不会发生。

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.App/com.App}: android.view.InflateException: Binary XML file line #100: Error inflating class android.support.design.widget.NavigationView
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3190)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3300)
       at android.app.ActivityThread.access$1000(ActivityThread.java:211)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1705)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:145)
       at android.app.ActivityThread.main(ActivityThread.java:6946)
       at java.lang.reflect.Method.invoke(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:372)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

Caused by android.view.InflateException: Binary XML file line #100: Error inflating class android.support.design.widget.NavigationView
       at android.view.LayoutInflater.createView(LayoutInflater.java:640)
       at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:750)
       at android.view.LayoutInflater.rInflate(LayoutInflater.java:813)
       at android.view.LayoutInflater.inflate(LayoutInflater.java:511)
       at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
       at android.view.LayoutInflater.inflate(LayoutInflater.java:366)
       at android.support.v7.app.l.b(Unknown Source)
       at android.support.v7.app.e.setContentView(Unknown Source)
       at com.App.onCreate(Unknown Source)
       at android.app.Activity.performCreate(Activity.java:6575)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1134)
       at …
Run Code Online (Sandbox Code Playgroud)

android android-studio navigation-drawer switchcompat android-app-bundle

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

无法在Android Studio中使用bundtool生成APK

Bundletool文档中所述

我在Android Studio终端上发出以下命令:

bundletool build-apks --bundle=/MyApp/my_app.aab --output=/MyApp/my_app.apks
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

'bundletool' is not recognized as an internal or external command,
operable program or batch file.
Run Code Online (Sandbox Code Playgroud)

我已经下载了bundletool 0.6.0 jar

bundletool github上,没有给出在Windows上安装它的步骤.

android apk android-studio android-app-bundle

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

应用程序捆绑包,在动态功能模块中,安装前可用的模块

我尝试在我的应用程序中实现动态功能模块。我在活动中有按钮。当用户单击我检查模块是否已安装。如果没有,我使用startInstall(request)开始安装。但是我总是去别的状态。

    if (manager.installedModules.contains("sample")) {
-----> Always go to this block 
                Toast.makeText(this, "Already Downloaded", Toast.LENGTH_SHORT).show()
                Intent().setClassName(packageName, "com.example.sample.SampleActivity")
                        .also {
                            startActivity(it)
                        }
            } else {
               // Never came to this state
                // Create request to install a feature module by name.
                val request = SplitInstallRequest.newBuilder()
                        .addModule("sample")
                        .build()
                // Load and install the requested feature module.
                manager.startInstall(request)
            }
Run Code Online (Sandbox Code Playgroud)

在动态功能模块中,我设置了 onDemand="true"

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
package="com.example.sample">

<dist:module
    dist:onDemand="true"
    dist:title="@string/title_sample">
    <dist:fusing dist:include="true" />
</dist:module>

<application>
    <activity android:name="com.example.sample.SampleActivity">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
        </intent-filter>
    </activity>
</application>
Run Code Online (Sandbox Code Playgroud)

android android-app-bundle

5
推荐指数
2
解决办法
444
查看次数

Android ABI 拆分迁移到 App Bundle

我计划从 ABI 拆分迁移到 App Bundle 功能。目前我正在使用此代码:

def versionCodesAbi = ['x86': 1, 'x86_64': 2, 'armeabi-v7a': 3, 'arm64-v8a': 4]

    splits {
        abi {
            enable true
            reset()
            include "x86", "x86_64", "armeabi-v7a", "arm64-v8a"
            // "armeabi", "mips", "mips64" last three not needed and not supported currently
            universalApk true
        }
    }

    android.applicationVariants.all { variant ->
        variant.outputs.each { output ->
            def abi = versionCodesAbi.get(output.getFilter(OutputFile.ABI))
            if (abi != null) {
                output.versionCodeOverride =
                        abi * 1000 + variant.versionCode
            }
        }
    }
Run Code Online (Sandbox Code Playgroud)

每个 ABI 提供 4 个 APK(+ 通用一个)。使用此代码的原因是为了减少应用程序的大小,因为PanoWidget …

android abi renderscript android-app-bundle

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

给定一个APK文件,是否可以知道它是拆分的APK文件的一部分还是独立文件?

背景

有时,当您备份某个应用程序的某些APK文件时,您会注意到它们由多个APK文件组成,这意味着拆分的APK文件(又称为应用程序捆绑包)。

问题

我想知道,当有人向用户发送APK文件时,它的确是独立文件还是拆分APK文件的一部分。原因是不同的过程,甚至是这样的警告,因为拆分的APK文件并不是真的要像正常文件一样安装。

我尝试过的

给定PackageManager类(在此处),我找不到getPackageArchiveInfo获取此类信息的方法。

splitNamessplitRevisionCodes,但都为空。

我的问题

给定一个APK文件,是否可以检查它是否属于多个拆分APK文件的一部分?


编辑:因此,由于这里,我已经找到了如何对拆分的APK文件(“ base.APK”)的主要APK进行操作:

    val packageInfo = pm.getPackageArchiveInfo(apkPath, PackageManager.GET_META_DATA)
    val isSplit = packageInfo.applicationInfo.metaData.getBoolean("com.android.vending.splits.required", false)
Run Code Online (Sandbox Code Playgroud)

但是,至于其余的拆分apk文件,getPackageArchiveInfo在其上使用将仅返回null。我找不到如何解析它们的清单以找到“ split”属性。

所以我的问题是:

给定其余的拆分APK文件,我如何解析它们以检查它们是否确实是属于base.APK文件的拆分APK文件?

android apk android-app-bundle

5
推荐指数
0
解决办法
322
查看次数

生成具有所有动态功能的APK

我已在项目中添加了动态功能模块,在模拟器上尝试运行或直接在设备上运行时(使用运行按钮),一切正常,但是当我尝试使用命令行(:app:assembleRelease)生成APK时,动态功能模块将不包含在内在最终的APK中丢失了。我知道我可以创建一个Android App Bundle,然后从.aab所有模块中创建一个APK 。但问题是:

有没有一种方法可以直接从表单源创建完整的apk(包括所有模块,例如:动态功能)?

android android-gradle-plugin android-app-bundle dynamic-feature

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

Unity aab不符合Google Play 64位要求

我有一个Unity项目,我正在从APK切换到AAB(应用程序捆绑包)。以前,当我将其构建为APK时,Google Play控制台告诉我该APK是64位兼容的。

现在,我正在建立一个aab,我得到警告:

此版本不符合Google Play 64位要求。以下APK或应用捆绑包可用于64位设备,但它们只有32位本机代码

  1. 我同时设置了ARM7和ARM64体系结构。
  2. 我不包括x86。
  3. 当我在档案查看器中打开.aab时,lib文件夹包含arm64-v8a和armabi-v7a的所有.so。
  4. 我正在使用IL2CPP,.NET 4.x
  5. 我正在使用Unity 2018.3.7f1
  6. 我的ndk版本是16b
  7. 我的Android Studio最高为3.4.2,gradle为3.2

这里有许多类似的话题都在谈论如何遵循“学习更多”链接。在切换到应用程序捆绑包之前,我已经完成了所有工作以使我的应用程序符合64位标准。

其他线程讨论了Android Studio解决方案,我无法使用它,因为我的自动构建过程涉及从命令行使用Unity进行构建,因此它必须是Unity配置或崩溃。

我的期望是,应用程序捆绑应该是让Google为您构建更好的APK的热门新方法,但是似乎对aabs是否实际上符合64位标准感到困惑,这似乎使整个目标无法实现。

这是Unity问题吗?Google在应用程序捆绑方面是否存在系统错误,还是我缺少其他步骤?

64-bit unity-game-engine android-gradle-plugin google-play-console android-app-bundle

5
推荐指数
2
解决办法
3168
查看次数

具有动态功能的即时应用程序始终显示带有1个选项的消歧对话框

我正在尝试动态功能和Instant Apps。为了在各种功能之间导航,我使用了深层链接。

每次导航到另一个“活动”时,都会看到消歧对话框少于1秒,其中列出了1个应用程序。请注意,“ Once”和“ Always”(在荷兰语中)的选项是如何变灰的。

示例Github项目

我创建了一个简约的示例,该示例与我在Github上的当前结构相匹配。需要Android Studio 3.5-RC2

消歧对话框简短显示

一些上下文:

我非常有信心,深层链接配置正确。但是由于你们还是想检查一下,因此配置如下:

1-清单:

<activity
            android:name=".ProfileActivity">

        <intent-filter
                android:autoVerify="true"
                android:priority="100">

            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data
                    android:host="giddy.entreco.nl"
                    android:pathPrefix="/profile"
                    android:scheme="http" />
            <data android:scheme="https" />

        </intent-filter>

    </activity>
Run Code Online (Sandbox Code Playgroud)

2-Assetlinks 我的域包含一个可公开访问的assetlinks.json

3-Sha's正确 我使用的sha's正确

Executing tasks: [signingReport] in project

SHA1: 3A:52:19:77:C1:AD:18:F4:98:21:77:74:37:DC:9B:89:02:64:6E:C6
SHA-256: 25:DD:C3:7B:8E:35:D3:39:D5:D4:6C:B5:EA:7D:14:AF:82:EC:9C:56:A6:F5:76:A3:E1:D7:69:B3:EC:58:72:E8
Valid until: Saturday, March 21, 2048
Run Code Online (Sandbox Code Playgroud)

4-确认的数字资产链接文件 所有检查均通过 https://digitalassetlinks.googleapis.com/v1/statements:list?source.web.site=https://giddy.entreco.nl&relation=delegate_permission/common.handle_all_urls

5-测试URL意图 也可以!唯一的问题是我在短时间内看到了消歧对话框。

附加信息

  • apply plugin: 'com.android.dynamic-feature'在所有模块中使用(app当然课程除外)

  • Android Studio:3.5 RC2;Android-gradle-plugin:3.5.0-rc02

  • 我的设备是OnePlus6-配备氧气9.0.7和Android 9

  • 谷歌官方样片 …

android android-manifest android-instant-apps android-app-bundle android-app-links

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

带有 appbundle 和 PROGUARD 的动态功能不起作用

概述:
由于 proguard,我在从基本模块访问按需动态功能模块的活动时遇到问题。(很可能我猜)

描述:
我已经实现了一个带有应用程序包的按需动态功能模块并上传到 Play 商店。
使用自定义规则实现了 proguard。
从 Play 商店下载应用程序并在运行时访问该模块后,该模块将被下载。刚下载后,我就收到了从我的基本模块到该动态模块访问活动的调用。
我收到如下错误

...
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{xxx.yyyyyy.zzzzzz.stage/xxx.yyyyyy.zzzzzz.apphub.appview.view.AppHubActivity}:
java.lang.ClassNotFoundException: Didn't find class "xxx.yyyyyy.zzzzzz.apphub.appview.view.AppHubActivity"
on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file 
...
...
Run Code Online (Sandbox Code Playgroud)

仅供参考:
xxx.yyyyyy.zzzzzz 是我为了隐私而更改的包名称。

讽刺:
这整个代码在调试中运行良好,同时从本地的应用程序包访问它而没有 proguard

我已经尝试了下面的所有链接来克服这个问题,但不能。
1)https://issuetracker.google.com/issues/120517460
2)https://github.com/android/plaid/issues/764
3)java.lang.NoClassDefFoundError:解析失败:Lorg/apache/http/协议版本
4) https://issuetracker.google.com/issues/79478779
5) https://github.com/android/app-bundle-samples/issues/17

我也尝试了我们可以使用的所有类型的 proguard 文件,但仍然无能为力。
还保留了 proguard 中的两个类:基本和动态模块活动类,但没有成功。
希望在这里寻找解决方案。

更新:
不适用于 android OS 8,9,但适用于 android 10 的文件。

android runtime-error proguard android-app-bundle dynamic-feature-module

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

与 Firebase 安装服务器 API 通信时出错 - 403 Forbidden

A 有一个包含大量依赖项的大项目,包括 Firebase。

现在com.google.firebase:firebase-messaging版本为17.3.3。我想将其更新为20.2.1

应用程序启动后出现下一个错误:

Firebase-Installations: Error when communicating with the Firebase Installations server API. HTTP response: [403 Forbidden: {
  "error": {
    "code": 403,
    "message": "Requests from this Android client application com.example are blocked.",
    "status": "PERMISSION_DENIED",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.Help",
        "links": [
          {
            "description": "Google developer console API key",
            "url": "https://console.developers.google.com/project/61947752567/apiui/credential"
          }
        ]
      }
    ]
  }
}
]
Firebase Installations can not communicate with Firebase server APIs due to invalid configuration. Please update …
Run Code Online (Sandbox Code Playgroud)

android firebase firebase-cloud-messaging android-app-bundle

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