【问题标题】:phonegap build error in ios and android with the facebook-phonegap-plugin使用 facebook-phonegap-plugin 在 ios 和 android 中构建 phonegap 错误
【发布时间】:2016-02-19 01:32:39
【问题描述】:

直到现在我都用这个:

   <gap:plugin name="com.phonegap.plugins.facebookconnect">
        <param name="APP_ID"   value="******" />
        <param name="APP_NAME" value="******" />
    </gap:plugin>

这个插件已被弃用,在这里 (Facebook connect plugin is not working in android but working in ios) 我被告知要改用它:

<gap:plugin name="cordova-plugin-facebookconnect-orlando" source="npm" version="0.11.0">
    <param name="APP_ID"   value="****" />
    <param name="APP_NAME" value="****" />
</gap:plugin>

但是我在 ios 和 android 版本中都有错误,为什么?

这是我的配置文件:

<?xml version='1.0' encoding='utf-8'?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:android = "http://schemas.android.com/apk/res/android" xmlns:gap="http://phonegap.com/ns/1.0" id="blah.blah.com"  version="0.9.1" >
    <name>blah</name>
    <description>
        Best football manager in a long time
    </description>
    <author email="gorgo@gorgo" href="http://www.gorgogorgo.com/">
       gorgo
    </author>

    <content src="index.html" />

    <preference name='phonegap-version' value='cli-5.2.0' />
    <preference name="orientation" value="landscape" />
    <preference name="screen-orientation" value="landscape" />
    <preference name="Orientation" value="landscape" />
    <preference name="fullscreen" value="true" />
    <preference name="permissions" value="none" />
    <preference name="target-device" value="universal" />
    <preference name="webviewbounce" value="false" />
    <preference name="prerendered-icon" value="true" />
    <preference name="stay-in-webview" value="false" />
    <preference name="ios-statusbarstyle" value="black-opaque" />
    <preference name="detect-data-types" value="true" />
    <preference name="exit-on-suspend" value="false" />
    <preference name="show-splash-screen-spinner" value="true" />
    <preference name="auto-hide-splash-screen" value="true" />
    <preference name="disable-cursor" value="false" />
    <preference name="android-minSdkVersion" value="7" />
    <preference name="android-installLocation" value="auto" />
    <preference name="EnableViewportScale" value="false" />
    <preference name="DisallowOverscroll" value="true" />
    <preference name="UIWebViewBounce" value="false" />
    <preference name="AutoHideSplashScreen" value="false" />
    <preference name="SplashScreenDelay" value="10000" />


     <icon src="icon.png" />
    <gap:splash src="splash.png" />

    <!-- iPhone 6 / 6+ -->
    <icon src="icon-60@3x.png" gap:platform="ios" width="180" height="180" />

    <!-- iPhone / iPod Touch  -->
    <icon src="icon-60.png" gap:platform="ios" width="60" height="60" />
    <icon src="icon-60@2x.png" gap:platform="ios" width="120" height="120" />

    <!-- iPad -->
    <icon src="icon-76.png" gap:platform="ios" width="76" height="76" />
    <icon src="icon-76@2x.png" gap:platform="ios" width="152" height="152" />

    <!-- Settings Icon -->
    <icon src="icon-small.png" gap:platform="ios" width="29" height="29" />
    <icon src="icon-small@2x.png" gap:platform="ios" width="58" height="58" />

    <!-- Spotlight Icon -->
    <icon src="icon-40.png" gap:platform="ios" width="40" height="40" />
    <icon src="icon-40@2x.png" gap:platform="ios" width="80" height="80" />

    <!-- iPhone / iPod Touch -->
    <icon src="icon.png" gap:platform="ios" width="57" height="57" />
    <icon src="icon@2x.png" gap:platform="ios" width="114" height="114" />

    <!-- iPad -->
    <icon src="icon-72.png" gap:platform="ios" width="72" height="72" />
    <icon src="icon-72@2x.png" gap:platform="ios" width="144" height="144" />

    <!-- iPhone Spotlight and Settings Icon -->
    <icon src="icon-small.png" gap:platform="ios" width="29" height="29" />
    <icon src="icon-small@2x.png" gap:platform="ios" width="58" height="58" />

    <!-- iPad Spotlight and Settings Icon -->
    <icon src="icon-50.png" gap:platform="ios" width="50" height="50" />
    <icon src="icon-50@2x.png" gap:platform="ios" width="100" height="100" />

    <platform name="android">
        <icon src="icon-36-ldpi.png" density="ldpi" />
        <icon src="icon-48-mdpi.png" density="mdpi" />
        <icon src="icon-72-hdpi.png" density="hdpi" />
        <icon src="icon-96-xhdpi.png" density="xhdpi" />
    </platform>

    <gap:splash src="splash.png" gap:platform="android" gap:qualifier="ldpi" />
    <gap:splash src="splash.png" gap:platform="android" gap:qualifier="mdpi" />
    <gap:splash src="splash.png" gap:platform="android" gap:qualifier="hdpi" />
    <gap:splash src="splash.png" gap:platform="android" gap:qualifier="xhdpi" />
    <gap:splash src="splash.png" gap:platform="android" gap:qualifier="fr-xhdpi" />
    <gap:splash src="splash.png" gap:platform="android" gap:qualifier="port-xxhdpi" />
    <gap:splash src="splash.png" gap:platform="android" gap:qualifier="land-xxhdpi" />


    <gap:splash src="Default.png" gap:platform="ios" width="320" height="480" />
    <gap:splash src="Default@2x.png" gap:platform="ios" width="640" height="960" />

     <!-- iPhone 5 / iPod Touch (5th Generation) -->
    <gap:splash src="Default-568h@2x.png" gap:platform="ios" width="640" height="1136" />

    <!-- iPhone 6 -->
    <gap:splash src="Default-667h@2x.png" gap:platform="ios" width="750" height="1334" />
    <gap:splash src="Default-Landscape-736h@3x.png" gap:platform="ios" width="2208" height="1242" />

    <!-- iPad -->
    <gap:splash src="Default-Landscape.png" gap:platform="ios" width="1024" height="768" />

    <!-- Retina iPad -->
    <gap:splash src="Default-Landscape@2x.png" gap:platform="ios" width="2048" height="1536" />

     <gap:config-file platform="ios" parent="UIViewControllerBasedStatusBarAppearance" overwrite="true">
        <false/>
    </gap:config-file>


    <!-- phonegap build plugins from npm, secured -->
    <gap:plugin name="cordova-plugin-customurlscheme" source="npm">
      <param name="URL_SCHEME" value="footboss" />
    </gap:plugin>

    <gap:plugin name="cordova-plugin-whitelist" source="npm" version="1.0.0" />

    <gap:plugin name="cordova-plugin-inappbrowser" source="npm" />

    <gap:plugin name="org.apache.cordova.device"  version="0.2.12" source="npm" /> <!-- being used in push notifications service -->

    <gap:plugin name="org.apache.cordova.splashscreen" version="0.3.4" source="npm"/> <!-- working good -->


    <gap:plugin name="com.phonegap.plugins.facebookconnect">
        <param name="APP_ID"   value="***" />
        <param name="APP_NAME" value="***" />
    </gap:plugin>

    <gap:plugin name="nl.x-services.plugins.insomnia" version="4.0.1" />

    <gap:plugin name="at.modalogb2.cordova.plugin.cache" version="1.0.0" />

    <gap:plugin name="com.rjfun.cordova.plugin.lowlatencyaudio" version="1.1.3" />

    <gap:plugin name="com.phonegap.plugins.pushplugin" version="2.5.0" />

    <gap:plugin name="net.yoik.cordova.plugins.screenorientation" version="1.3.1" />

    <gap:plugin name="net.bgta.phonegap.plugin.appversion" version="1.1.1" />

    <!--<gap:plugin name="com.adobe.plugins.gaplugin"/>-->
    <gap:plugin name="com.danielcwilson.plugins.googleanalytics" version="0.6.1" />

    <gap:platform name="ios" />
    <gap:platform name="android" />
    <gap:platform name="winphone" />

    <access origin="*" subdomains="true"/>

    <allow-navigation href="*" />

    <allow-intent href="*" />


</widget>

这是 phonegap 构建的构建失败:

** BUILD FAILED **


The following build commands failed:
    CompileC build/Footboss.build/Release-iphoneos/Footboss.build/Objects-normal/armv7/FacebookConnectPlugin.o Footboss/Plugins/cordova-plugin-facebookconnect-orlando/FacebookConnectPlugin.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

是否应该通过在 plist 中添加一些东西来解决这个问题?

【问题讨论】:

    标签: cordova phonegap-plugins phonegap-build


    【解决方案1】:

    首先,您需要从 NPM 获取多个插件

    PhoneGap 5.2.0 Now Available on Build - 2015 年 9 月 23 日

    我引用:

    还要确保您的第三方插件都是最新的,并且您的核心插件来自 NPM,如下所示:

    &lt;gap:plugin name="cordova-plugin-camera" source="npm" /&gt;

    如果您是从 5.1.1 之前的版本更新,请阅读blog post

    例如

    &lt;gap:plugin name="org.apache.cordova.device" version="0.2.12" source="npm" /&gt;

    应该是:

    &lt;gap:plugin name="cordova-plugin-device" source="npm" version="1.0.1" /&gt;

    这个核心插件工作表应该会有所帮助。

    核心插件设置

    https://github.com/jessemonroy650/top-phonegap-mistakes/blob/master/plugins-core-setup.md

    【讨论】:

    • 但问题在于 facebook 登录插件,而不是其他所有人
    • 您的帖子显示您的构建失败。因此,如果您的构建工作正常,您需要更改您的帖子或决定您想要做什么。因为在这一点上,我只是想让你的构建工作。哦。请列出您的目标平台。几乎所有插件都有怪癖。
    • 它还说明了失败的原因,如果使用旧的(现在不是很好)插件,构建是好的,但如果我把新的和需要的 facebook 插件!它在 ios 和 android 上失败了……我什至在标题中也非常具体。
    • 我认为您不想解决此问题。这个论坛上有三个人可以帮助你。 Petra V. at nitobi, jcesarmobile,在两个论坛上都有。我是第三个。你没有制造这种愚蠢的情况,我也没有制造这种愚蠢的情况,我只是想让你摆脱它。做出改变。除非您想尝试 Petra 或 Jcesarmobile,否则我不会去任何地方。如果是后者,请在 nitobi 上等待答案。
    • 我真的很感激你的所作所为,真的,我按照你说的对其他插件进行了更改,正在构建中,希望对您有所帮助...
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-13
    • 1970-01-01
    • 2017-03-08
    • 2016-06-14
    • 1970-01-01
    相关资源
    最近更新 更多