Ошибка при создании очень очень простого приложения с использованием response-native-camera - PullRequest
0 голосов
/ 21 мая 2018

Я недавно хотел создать приложение react-native с камерой и начал работать с react-native-camera, поэтому я просто сделал это:

$ react-native init testApp2
$ npm install --save react-native-camera
$ react-native link react-native-camera
$ react-native run-android

После последней строки я получаю странные результаты (ниже)(У меня установлена ​​Android-студия на моем компьютере, и точные ошибки создаются Android-студией, когда я собираюсь создать apk)

Scanning folders for symlinks in C:\Users\seyye_000\Documents\testApp2\node_modules (31ms)
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details
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
WARNING: The specified Android SDK Build Tools version (26.0.2) is ignored, as it is below the minimum supported version (27.0.3) for Android Gradle Plugin 3.1.2.
Android SDK Build Tools 27.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
:app:preBuild UP-TO-DATE
:react-native-camera:preBuild UP-TO-DATE
:react-native-camera:preDebugBuild UP-TO-DATE
:react-native-camera:checkDebugManifest UP-TO-DATE
:react-native-camera:processDebugManifest UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:react-native-camera:compileDebugAidl UP-TO-DATE
:app:compileDebugAidl UP-TO-DATE
:react-native-camera:packageDebugRenderscript NO-SOURCE
:app:compileDebugRenderscript UP-TO-DATE
:app:checkDebugManifest UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:prepareLintJar UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:react-native-camera:mergeDebugShaders UP-TO-DATE
:react-native-camera:compileDebugShaders UP-TO-DATE
:react-native-camera:generateDebugAssets UP-TO-DATE
:react-native-camera:packageDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:react-native-camera:compileDebugRenderscript UP-TO-DATE
:react-native-camera:generateDebugResValues UP-TO-DATE
:react-native-camera:generateDebugResources UP-TO-DATE
:react-native-camera:packageDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:bundleDebugJsAndAssets SKIPPED
:app:mainApkListPersistenceDebug UP-TO-DATE
:app:createDebugCompatibleScreenManifests UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:splitsDiscoveryTaskDebug UP-TO-DATE
:react-native-camera:platformAttrExtractor UP-TO-DATE
:react-native-camera:generateDebugRFile UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:react-native-camera:generateDebugBuildConfig UP-TO-DATE
:react-native-camera:prepareLintJar UP-TO-DATE
:react-native-camera:generateDebugSources UP-TO-DATE
:react-native-camera:javaPreCompileDebug UP-TO-DATE
:react-native-camera:compileDebugJavaWithJavac UP-TO-DATE
:react-native-camera:processDebugJavaRes NO-SOURCE
:react-native-camera:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug UP-TO-DATE
:app:javaPreCompileDebug UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk NO-SOURCE
:app:compileDebugSources UP-TO-DATE
:app:transformClassesWithDexBuilderForDebug UP-TO-DATE
:app:transformDexArchiveWithExternalLibsDexMergerForDebugD8: Program type already present: com.facebook.infer.annotation.FalseOnNull

FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task 
':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\6.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\7.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\8.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\54.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\55.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\56.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\57.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\58.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\60.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\61.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\62.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\63.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\76.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\77.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\78.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\79.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\80.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\84.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\98.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\99.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\100.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\101.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\102.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\103.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\104.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\105.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\106.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\107.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\108.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\109.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\110.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\111.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\112.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\113.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\114.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\115.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\116.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\117.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\118.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\119.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\120.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\121.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\122.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\123.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\124.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\125.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\126.jar, C:\Users\seyye_000\Documents\testApp2\android\app\build\intermediates\transforms\dexBuilder\debug\127.jar

* 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

BUILD FAILED in 21s
36 actionable tasks: 1 executed, 35 up-to-date
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

Я пытался всеми возможными способами поиграть с Android Studio, чтобы получить эту ошибкуисправлено, но я очень устала и не знаю, что делать дальше.: \

Вот мой package.json:

{
  "name": "testApp2",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "test": "jest"
  },
  "dependencies": {
    "react": "16.3.1",
    "react-native": "0.55.4",
    "react-native-camera": "^1.1.3"
  },
  "devDependencies": {
    "babel-jest": "22.4.4",
    "babel-preset-react-native": "4.0.0",
    "jest": "22.4.4",
    "react-test-renderer": "16.3.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

если вы знаете, что не так с этим заявлением, скажите мне, я начинаю сходить с ума ...

Поскольку я не знаю, как разместить весь свой код здесь, я только что загрузил его на GitHub, ЗДЕСЬ - ссылка на него.

1 Ответ

0 голосов
/ 21 мая 2018

Попробуйте включить multiDex

In app / build.gradle:

android {
    defaultConfig {
       multiDexEnabled true
    }
}
...