Android上的排毒构建失败:解密时出错

问题描述 投票:1回答:1

我无法通过全新的Expokit项目获得detox build。在这些任务上构建失败:

> Transform full.jar (project :unimodules-core) with DexingTransform
AGPBI: {"kind":"error","text":"Default interface methods are only supported starting with Android N (--min-api 24): java.util.List org.unimodules.core.interfaces.Package.createExportedModules(android.content.Context)","sources":[{}],"tool":"D8"}

> Task :expo-font:mergeLibDexDebugAndroidTest FAILED
AGPBI: {"kind":"error","text":"Default interface methods are only supported starting with Android N (--min-api 24): java.util.List org.unimodules.core.interfaces.Package.createExportedModules(android.content.Context)","sources":[{}],"tool":"D8"}

> Task :expo-linear-gradient:mergeLibDexDebugAndroidTest FAILED
AGPBI: {"kind":"error","text":"Default interface methods are only supported starting with Android N (--min-api 24): java.util.List org.unimodules.core.interfaces.Package.createExportedModules(android.content.Context)","sources":[{}],"tool":"D8"}

> Task :expo-app-loader-provider:mergeLibDexDebugAndroidTest FAILED
AGPBI: {"kind":"error","text":"Default interface methods are only supported starting with Android N (--min-api 24): java.util.List org.unimodules.core.interfaces.Package.createExportedModules(android.content.Context)","sources":[{}],"tool":"D8"}

> Task :expo-constants:mergeLibDexDebugAndroidTest FAILED
AGPBI: {"kind":"error","text":"Default interface methods are only supported starting with Android N (--min-api 24): java.util.List org.unimodules.core.interfaces.Package.createExportedModules(android.content.Context)","sources":[{}],"tool":"D8"}

FAILURE: Build completed with 4 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Could not resolve all files for configuration ':expo-font:debugAndroidTestRuntimeClasspath'.
> Failed to transform file 'full.jar' to match attributes {artifactType=android-dex, dexing-is-debuggable=true, dexing-min-sdk=21} using transform DexingTransform
   > Error while dexing.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Could not resolve all files for configuration ':expo-linear-gradient:debugAndroidTestRuntimeClasspath'.
> Failed to transform file 'full.jar' to match attributes {artifactType=android-dex, dexing-is-debuggable=true, dexing-min-sdk=21} using transform DexingTransform
   > Error while dexing.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

3: Task failed with an exception.
-----------
* What went wrong:
Could not resolve all files for configuration ':expo-app-loader-provider:debugAndroidTestRuntimeClasspath'.
> Failed to transform file 'full.jar' to match attributes {artifactType=android-dex, dexing-is-debuggable=true, dexing-min-sdk=21} using transform DexingTransform
   > Error while dexing.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

4: Task failed with an exception.
-----------
* What went wrong:
Could not resolve all files for configuration ':expo-constants:debugAndroidTestRuntimeClasspath'.
> Failed to transform file 'full.jar' to match attributes {artifactType=android-dex, dexing-is-debuggable=true, dexing-min-sdk=21} using transform DexingTransform
   > Error while dexing.

这是我的配置(在iOS上运行正常:]

"detox": {
  "configurations": {
    "ios.sim.debug": {
      "binaryPath": "/Users/clementdebellefroid/Library/Developer/Xcode/DerivedData/detox-test-bdznjcaewoobdcfdwtdisdwidhjo/Build/Products/Debug-iphonesimulator/detox-test.app",
      "build": "xcodebuild -workspace ios/detox-test.xcworkspace -scheme detox-test -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
      "type": "ios.simulator",
      "name": "iPhone SE"
    },
    "android.device.debug": {
      "binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
      "build": "cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..",
      "type": "android.attached",
      "name": "HYF0219402003939"
    }
  },
  "test-runner": "jest"
},

再现

  1. 运行expo init创建一个新项目
  2. 运行expo eject使其成为expokit项目
  3. cd进入您的项目,运行yarn && cd ios && pod install
  4. Follow the steps to configure detox
  5. 添加android.device.debug配置
  6. 运行detox build -c android.device.debug

这里是一个可帮助重现此问题的存储库:https://github.com/clems36/detox-test

环境:

  • 排毒:14.0.3
  • React Native:0.59.8
  • 节点:v12.9.0
  • macOS:Mojave 10.14.6

这可能与排毒没有直接关系,但我认为它会影响创建expokit项目的任何人。

android react-native expo detox
1个回答
0
投票

我遇到了同样的问题,并且可以通过将gradlew任务限制在应用程序项目中来解决。

package.json:

  ...
  "detox": {
    "configurations": {
      ...
      "android": {
        "binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
        "build": "cd android && ./gradlew app:assembleDebug app:assembleAndroidTest -DtestBuildType=debug && cd ..",
        "type": "android.emulator",
        "name": "Nexus_5X_API_26"
      }
    },
    ...
  }
© www.soinside.com 2019 - 2024. All rights reserved.