简体   繁体   English

无法使用cordova-plugin-facebook4和phonegap-plugin-barcodescanner构建Cordova应用

[英]can't build cordova app using cordova-plugin-facebook4 and phonegap-plugin-barcodescanner

i've got a problem building my cordova app when using cordova-plugin-facebook@2.4.0 and phonegap-plugin-barcodescanner@8.0.0 simultaneously. 同时使用cordova-plugin-facebook@2.4.0和phonegap-plugin-barcodescanner@8.0.0时,构建我的cordova应用程序时出现问题。

  • cordova-cli@8.0.0 cordova-cli@8.0.0
  • cordova-android@7.1.1 cordova-android@7.1.1
  • cordova-plugin-facebook@2.4.0 cordova-plugin-facebook@2.4.0
  • phonegap-plugin-barcodescanner@8.0.0 phonegap-plugin-barcodescanner@8.0.0
  • no other plugin is used 没有使用其他插件
  • no problems when using cordova-plugin-facebook@1.7.4 使用cordova-plugin-facebook@1.7.4时没有问题
  • also tried using cordova-android-support-gradle-release without success 还尝试使用cordova-android-support-gradle-release失败

config.xml config.xml中

<platform name="android">
    <hook src="hooks/__myapp/android_plugins_plugman.js" type="after_platform_add" />
    <preference name="android-minSdkVersion" value="19" />
    <preference name="android-targetSdkVersion" value="26" />
    <preference name="AndroidPersistentFileLocation" value="Internal" />
    <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
    ...
    <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
    ...
    <config-file parent="/resources" target="./res/values/strings.xml">
        <string name="fb_app_id">some app id</string>
        <string name="fb_app_name">app name</string>
    </config-file>
</platform>
...
<plugin name="cordova-plugin-facebook4" spec="file:cordova_plugins/cordova-plugin-facebook4-2.4.0">
    <variable name="APP_ID" value="some app id" />
    <variable name="APP_NAME" value="app name" />
    <variable name="ANDROID_SDK_VERSION" value="4.+" />
</plugin>
<plugin name="phonegap-plugin-barcodescanner" spec="file:cordova_plugins/phonegap-plugin-barcodescanner-8.0.0">
    <variable name="CAMERA_USAGE_DESCRIPTION" value="some description" />
    <variable name="ANDROID_SUPPORT_V4_VERSION" value="27.1.1" />
</plugin>
...
<engine name="ios" spec="^4.5.5" />
<engine name="android" spec="^7.0.2" />

Error Log 错误记录

Android Studio project detected


config file res/values/facebookconnect.xml requested for changes not found at /Users/SOME_USER_NAME/projects/SOME_PROJECT/platforms/android/res/values/facebookconnect.xml, ignoring

config file res/values/facebookconnect.xml requested for changes not found at /Users/SOME_USER_NAME/projects/SOME_PROJECT/platforms/android/res/values/facebookconnect.xml, ignoring


Running command: /Users/SOME_USER_NAME/projects/SOME_PROJECT/hooks/after_prepare/010_add_platform_class.js /Users/SOME_USER_NAME/projects/SOME_PROJECT


Running command: /Users/SOME_USER_NAME/projects/SOME_PROJECT/hooks/after_prepare/020_remove_sass_from_platforms.js /Users/SOME_USER_NAME/projects/SOME_PROJECT


ANDROID_HOME=/Users/SOME_USER_NAME/Library/Android/sdk

JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home

studio

:wrapper




BUILD SUCCESSFUL




Total time: 2.882 secs




This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.org/2.14/userguide/gradle_daemon.html


Subproject Path: CordovaLib


Subproject Path: app


publishNonDefault is deprecated and has no effect anymore. All variants are now published.


Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.


The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.

  at build_3woh5i5cs7vu80u1tavsoqgsd.run(/Users/SOME_USER_NAME/projects/SOME_PROJECT/platforms/android/app/build.gradle:144)


:CordovaLib:preBuild
 UP-TO-DATE


:CordovaLib:preDebugBuild
 UP-TO-DATE


:CordovaLib:compileDebugAidl


:CordovaLib:compileDebugRenderscript


:CordovaLib:checkDebugManifest


:CordovaLib:generateDebugBuildConfig


:CordovaLib:prepareLintJar


:CordovaLib:generateDebugResValues


:CordovaLib:generateDebugResources


:CordovaLib:packageDebugResources


:CordovaLib:platformAttrExtractor


:CordovaLib:processDebugManifest


:CordovaLib:javaPreCompileDebug


:CordovaLib:processDebugJavaRes

NO-SOURCE

:app:preBuild

UP-TO-DATE

:app:preDebugBuild


Download https://maven.google.com/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.pom


Download https://maven.google.com/com/android/support/customtabs/27.0.2/customtabs-27.0.2.pom


Download https://maven.google.com/com/android/support/cardview-v7/27.0.2/cardview-v7-27.0.2.pom


Download https://maven.google.com/com/android/support/animated-vector-drawable/27.0.2/animated-vector-drawable-27.0.2.pom

Download https://maven.google.com/com/android/support/support-vector-drawable/27.0.2/support-vector-drawable-27.0.2.pom

Download https://maven.google.com/com/android/support/customtabs/27.0.2/customtabs-27.0.2.aar

Download https://maven.google.com/com/android/support/animated-vector-drawable/27.0.2/animated-vector-drawable-27.0.2.aar


Download https://maven.google.com/com/android/support/support-vector-drawable/27.0.2/support-vector-drawable-27.0.2.aar


Download https://maven.google.com/com/android/support/appcompat-v7/27.0.2/appcompat-v7-27.0.2.aar


Download https://maven.google.com/com/android/support/cardview-v7/27.0.2/cardview-v7-27.0.2.aar


:app:compileDebugAidl


:CordovaLib:packageDebugRenderscript

NO-SOURCE

:app:compileDebugRenderscript


:app:checkDebugManifest


:app:generateDebugBuildConfig


:app:prepareLintJar


:app:generateDebugResValues


:app:generateDebugResources


:app:mergeDebugResources


:app:createDebugCompatibleScreenManifests


:CordovaLib:processDebugResources


:CordovaLib:generateDebugSources


:CordovaLib:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.




:CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug


:app:processDebugManifest


:app:splitsDiscoveryTaskDebug


:app:processDebugResources


:app:generateDebugSources


:app:javaPreCompileDebug


:app:compileDebugJavaWithJavac
Note: /Users/SOME_USER_NAME/projects/SOME_PROJECT/platforms/android/app/src/main/java/org/apache/cordova/facebook/ConnectPlugin.java uses or overrides a deprecated API.


Note: Recompile with -Xlint:deprecation for details.




:app:compileDebugNdk
 NO-SOURCE

:app:compileDebugSources


:CordovaLib:mergeDebugShaders


:CordovaLib:compileDebugShaders


:CordovaLib:generateDebugAssets


:CordovaLib:mergeDebugAssets


:app:mergeDebugShaders


:app:compileDebugShaders


:app:generateDebugAssets


:app:mergeDebugAssets


:app:transformClassesWithStackFramesFixerForDebug


:app:transformClassesWithDesugarForDebug


:app:transformClassesWithDexBuilderForDebug


:app:transformDexArchiveWithExternalLibsDexMergerForDebug

FAILED



FAILURE: Build failed with an exception.



* What went wrong:


Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.


>
java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex


* Try:

Run with
--stacktrace option to get the stack trace. Run with --info
 or --debug option to get more log output.



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




BUILD FAILED
 in 25s

37 actionable tasks: 37 executed


(node:16024) UnhandledPromiseRejectionWarning: Error: /Users/SOME_USER_NAME/projects/SOME_PROJECT/platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/SOME_USER_NAME/projects/SOME_PROJECT/platforms/android/app/src/main/java/org/apache/cordova/facebook/ConnectPlugin.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

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

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

BUILD FAILED in 25s
    at ChildProcess.whenDone (/Users/SOME_USER_NAME/projects/SOME_PROJECT/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)
    at Socket.stream.socket.on (internal/child_process.js:381:11)
    at Socket.emit (events.js:182:13)
    at Pipe._handle.close (net.js:606:12)

(node:16024) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

(node:16024) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Discussion started at https://github.com/jeduan/cordova-plugin-facebook4/issues/705 . 讨论始于https://github.com/jeduan/cordova-plugin-facebook4/issues/705 Maybe someone out here has some more ideas. 也许有人在这里有更多的想法。 Thx! 谢谢!

尝试使用此插件

<plugin spec="https://github.com/Telerik-Verified-Plugins/BarcodeScanner.git" source="git" > </plugin>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Cordova-plugin-facebook4-无法构建离子应用程序 - Cordova-plugin-facebook4 - can't build ionic application 添加phonegap-plugin-barcodescanner后无法构建cordova android projet - Not able to build cordova android projet after adding phonegap-plugin-barcodescanner Facebook应用程序使用Cordova-plugin-facebook4邀请 - Facebook App Invite with Cordova-plugin-facebook4 离子3,安装cordova-plugin-facebook4后无法构建android - Ionic 3, Cannot build android after install cordova-plugin-facebook4 使用cordova-plugin-facebook4从Facebook检索名称 - Retrieve name from Facebook using cordova-plugin-facebook4 Ionic cordova-plugin-facebook4在应用启动时崩溃 - Ionic cordova-plugin-facebook4 Crash on app startup 如何在Android上修复phonegap-plugin-barcodescanner - How to fix phonegap-plugin-barcodescanner on android phonegap-plugin-barcodescanner 在 Android 上崩溃 - phonegap-plugin-barcodescanner crashes on Android cordova-plugin-barcodescanner 扫描选项在 phonegap 移动应用程序中工作,并在构建后停止工作 - cordova-plugin-barcodescanner scan options work in phonegap mobile app and stop working after build Android上的PhoneGap / Cordova 2.4 BarcodeScanner插件无结果 - PhoneGap / Cordova 2.4 BarcodeScanner Plugin on Android no results
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM