Невозможно собрать android с помощью app: assemblyAndroidTest - найдено несколько файлов с независимым от ОС путем 'targetInvocationEspresso. json' - PullRequest
0 голосов
/ 06 августа 2020

Я следую и настраиваю точно так же, как это руководство для Android: https://github.com/wix/Detox/blob/master/docs/Introduction.Android.md, это моя конфигурация детоксикации в package.json:

"detox": {
    "configurations": {
      "android": {
        "binaryPath": "android/app/build/outputs/apk/release/app-release.apk",
        "build": "cd android && ./gradlew app:assembleRelease app:assembleAndroidTest -DtestBuildType=release && cd ..",
        "type": "android.emulator",
        "name": "Pixel_3a_XL_API_30"
      }
    },
    "test-runner": "jest",
    "behavior": {
      "init": {
        "launchApp": false
      },
      "cleanup": {
        "shutdownDevice": false
      }
    }
  }

, и я используя эту командную строку для сборки android:

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/ && rm -rf android/app/src/main/res/raw/* && detox build -c android

После сборки Android генерирует это исключение:

react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/  && rm -rf android/app/src/main/res/raw/* && detox build -c android
warn The following packages use deprecated "rnpm" config that will stop working from next release:
  - react-native-orientation: https://github.com/yamill/react-native-orientation#readme
  - react-native-wheel-datepicker: https://github.com/pinguinjkeke/react-native-wheel-datepicker#readme
Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide.
Loading dependency graph...warn The following packages use deprecated "rnpm" config that will stop working from next release:
  - react-native-orientation: https://github.com/yamill/react-native-orientation#readme
  - react-native-wheel-datepicker: https://github.com/pinguinjkeke/react-native-wheel-datepicker#readme
Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide.
Loading dependency graph, done.
Loading dependency graph...info Writing bundle output to:, android/app/src/main/assets/index.android.bundle
info Done writing bundle output
info Copying 618 asset files
info Done copying assets
zsh: sure you want to delete all 16 files in /Users/baopn/Documents/bitbucket/academy-mobile/android/app/src/main/res/raw [yn]? y
detox[31002] INFO:  [build.js] cd android && ./gradlew app:assembleRelease app:assembleAndroidTest -DtestBuildType=release && cd ..
Configuration on demand is an incubating feature.

> Configure project :app
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

> Configure project :react-native-wheel-datepicker
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :react-native-orientation
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

> Configure project :react-native-firebase
react-native-firebase: using React Native prebuilt binary from /Users/baopn/Documents/bitbucket/academy-mobile/node_modules/react-native/android

> Task :app:processReleaseGoogleServices
Parsing json file: /Users/baopn/Documents/bitbucket/academy-mobile/android/app/google-services.json

> Task :app:processReleaseManifest
/Users/baopn/Documents/bitbucket/academy-mobile/android/app/src/main/AndroidManifest.xml:15:9-25:20 Warning:
        provider#cl.json.RNShareFileProvider@android:authorities was tagged at AndroidManifest.xml:15 to replace other declarations but no other declaration present
/Users/baopn/Documents/bitbucket/academy-mobile/android/app/src/main/AndroidManifest.xml Warning:
        meta-data#android.support.FILE_PROVIDER_PATHS@android:resource was tagged at AndroidManifest.xml:0 to replace other declarations but no other declaration present
/Users/baopn/Documents/bitbucket/academy-mobile/android/app/src/main/AndroidManifest.xml:24:9-31:50 Warning:
        activity#com.google.firebase.auth.internal.FederatedSignInActivity@android:launchMode was tagged at AndroidManifest.xml:24 to replace other declarations but no other declaration present

> Task :app:transformResourcesWithMergeJavaResForReleaseAndroidTest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformResourcesWithMergeJavaResForReleaseAndroidTest'.
> More than one file was found with OS independent path 'targetInvocationEspresso.json'

* 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.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 17s
541 actionable tasks: 10 executed, 531 up-to-date
detox[31002] ERROR: [cli.js] Error: Command failed: cd android && ./gradlew app:assembleRelease app:assembleAndroidTest -DtestBuildType=release && cd ..
...