0

我正在尝试自己使用 Scringo 聊天项目,但在合并清单文件时遇到了错误。我明白了:

    Description Resource    Path    Location    Type
[/home/mihai/Dropbox/Freelancing/2014-03-10, Man App/workspace_with_adds/ManApp/AndroidManifest.xml:45, /home/mihai/Dropbox/Freelancing/2014-03-10, Man App/workspace_with_adds/Scringo/AndroidManifest.xml:53] Trying to merge incompatible /manifest/application/activity[@name=com.facebook.LoginActivity] element:
  <activity
--    @android:name="com.facebook.LoginActivity"
--    @android:screenOrientation="portrait"
--    @android:windowSoftInputMode="adjustPan">
  <activity
++    @android:configChanges="orientation|keyboardHidden|screenSize"
++    @android:name="com.facebook.LoginActivity">
++</activity>

[/home/mihai/Dropbox/Freelancing/2014-03-10, Man App/workspace_with_adds/ManApp/AndroidManifest.xml:64, /home/mihai/Dropbox/Freelancing/2014-03-10, Man App/workspace_with_adds/Scringo/AndroidManifest.xml:57] Trying to merge incompatible /manifest/application/meta-data[@name=com.facebook.sdk.ApplicationId] element:
  <meta-data
      @android:name="com.facebook.sdk.ApplicationId"
--    @android:value="@string/app_id">
  <meta-data
      @android:name="com.facebook.sdk.ApplicationId"
++    @android:value="@string/replace_this_facebook_app_id">

    ManApp      line 1  Android Manifest Merger Problem

我知道我有两个相同的活动(facebook 一个)和两个相同的元数据,所以我的问题是我应该删除哪一个或者我该如何处理?

我尝试从我的主清单中删除,然后从 Scringo 清单中删除,但在尝试使用 facebook 登录时总是出现此错误:

    05-16 09:14:57.902: E/AndroidRuntime(2588): FATAL EXCEPTION: main
05-16 09:14:57.902: E/AndroidRuntime(2588): Process: com.manapp, PID: 2588
05-16 09:14:57.902: E/AndroidRuntime(2588): java.lang.RuntimeException: Unable to resume activity {com.manapp/com.facebook.LoginActivity}: java.lang.IllegalArgumentException: Argument 'applicationId' cannot be null or empty
05-16 09:14:57.902: E/AndroidRuntime(2588):     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2788)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2817)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2250)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at android.app.ActivityThread.access$800(ActivityThread.java:135)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at android.os.Handler.dispatchMessage(Handler.java:102)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at android.os.Looper.loop(Looper.java:136)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at android.app.ActivityThread.main(ActivityThread.java:5017)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at java.lang.reflect.Method.invokeNative(Native Method)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at java.lang.reflect.Method.invoke(Method.java:515)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at dalvik.system.NativeStart.main(Native Method)
05-16 09:14:57.902: E/AndroidRuntime(2588): Caused by: java.lang.IllegalArgumentException: Argument 'applicationId' cannot be null or empty
05-16 09:14:57.902: E/AndroidRuntime(2588):     at com.facebook.internal.Validate.notNullOrEmpty(Validate.java:67)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at com.facebook.widget.WebDialog$BuilderBase.<init>(WebDialog.java:447)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at com.facebook.widget.WebDialog$Builder.<init>(WebDialog.java:559)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at com.facebook.AuthorizationClient$AuthDialogBuilder.<init>(AuthorizationClient.java:1015)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at com.facebook.AuthorizationClient$WebViewAuthHandler.tryAuthorize(AuthorizationClient.java:632)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at com.facebook.AuthorizationClient.tryCurrentHandler(AuthorizationClient.java:268)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at com.facebook.AuthorizationClient.tryNextHandler(AuthorizationClient.java:234)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at com.facebook.AuthorizationClient.authorize(AuthorizationClient.java:157)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at com.facebook.AuthorizationClient.startOrContinueAuth(AuthorizationClient.java:138)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at com.facebook.LoginActivity.onResume(LoginActivity.java:117)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1192)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at android.app.Activity.performResume(Activity.java:5310)
05-16 09:14:57.902: E/AndroidRuntime(2588):     at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2778)
05-16 09:14:57.902: E/AndroidRuntime(2588):     ... 12 more

我在项目的字符串文件中有一个应用程序 ID,在 scringo 字符串项目中有一个应用程序 ID,我已将值更改为无用。

唯一似乎总是有效的是我已经拥有的 Facebook 图像共享。更奇怪的是,如果我去分享一些东西,然后尝试登录,我就不会再收到错误了,它工作正常。

关于可能是什么问题以及如何解决这个问题的任何想法?

4

1 回答 1

2

在我将以下内容添加到我的 project.properties 文件后,我今天遇到了同样的问题:

manifestmerger.enabled=true

我能够通过从 Scringo AndroidManifest.xml 文件中删除冲突行来解决这些问题。换句话说,如果您删除这些行:

<activity
    @android:configChanges="orientation|keyboardHidden|screenSize"
    @android:name="com.facebook.LoginActivity" />

和,

<meta-data
    @android:name="com.facebook.sdk.ApplicationId"
    @android:value="@string/replace_this_facebook_app_id" />

从您的 Scringo AndroidManifest.xml 中,错误应该会消失。请注意,我在末尾添加了“/”(结束标签),因为这就是我的列出方式;也许您在其他地方有结束标签。此外,我还必须删除一些在我的 Scringo AndroidManifest.xml 中重复的权限。

我发现此页面上有关将 manifestmerger 设置为 true 的部分很有帮助: http ://www.scringo.com/docs/buzztouch/android-integration/

于 2014-11-10T23:47:31.543 回答