这是indexloc提供的服务,不要输入任何密码
Skip to content

TestDPC fails to open on Android 14 with mobile-install #243

@eariassoto

Description

@eariassoto

I was able to build, install and run TestDPC using build.sh on an Android 14 emulator.

However, deploying the app from Android Studio Ladybug with mobile-install results in a security crash:

2  samples.testdpc         com.afwsamples.testdpc               E  Attempt to load writable dex file: /data/local/tmp/incrementaldeployment/com.afwsamples.testdpc/dex/incremental_classes2.dex

I searched for similar issues and they point to some security changes in Android 14: https://developer.android.com/about/versions/14/behavior-changes-14#safer-dynamic-code-loading.

There is a bug in Bazel regarding incremental build support for Android 14 (bazelbuild/bazel#20456). Following the last comment, I set my environment to use Bazel 8. However, Bazel 8 does not build this project because WORKSPACE are disabled by default and suggest to migrate to Bzlmod.

Are there plans to update this repo to use Bzlmod?


My dev environment:
OS: MacOS Sequoia 15.3

TestDPC repo:

⟩ git remote get-url origin; git rev-parse master; git rev-parse HEAD
git@github.com:googlesamples/android-testdpc.git
305c86d36e9b7c85e41e9e01fbf2d648fa4970fb
305c86d36e9b7c85e41e9e01fbf2d648fa4970fb

Android Studio:

Android Studio Ladybug Feature Drop | 2024.2.2 Patch 1
Build #AI-242.23726.103.2422.13016713, built on February 5, 2025
Runtime version: 21.0.5+-12932927-b750.29 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.lwawt.macosx.LWCToolkit
macOS 15.3
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 3072M
Cores: 12
Metal Rendering is ON
Registry:
  ide.experimental.ui=true
  i18n.locale=
Non-Bundled Plugins:
  com.google.idea.bazel.aswb (12816248-api-version-242)

Bazel version:

⟩ bazel version
Bazelisk version: 1.25.0
Build label: 8.1.0
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Thu Feb 13 20:24:04 2025 (1739478244)
Build timestamp: 1739478244
Build timestamp as int: 1739478244

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions