【问题标题】:Expo EAS build fails on AndroidExpo EAS 构建在 Android 上失败
【发布时间】:2022-06-28 18:21:59
【问题描述】:

我将我的 expo 项目从 expo 41.0.0 升级到 expo 45.0.0

使用命令eas build -p android 构建项目时,它失败并出现以下错误。但是,ios 版本很好。

错误输出:

FAILED
Execution optimizations have been disabled for task ':app:processReleaseMainManifest' to ensure correctness due to the following reasons:
  - Gradle detected a problem with the following location: '/home/expo/workingdir/build/android/app/build/intermediates/navigation_json/release/navigation.json'. Reason: Task ':app:processReleaseMainManifest' uses this output of task ':app:copyReleaseBundledJs' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
[stderr] /home/expo/workingdir/build/android/app/src/main/AndroidManifest.xml Error:
[stderr]    android:exported needs to be explicitly specified for <activity>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
[stderr] FAILURE: Build failed with an exception.
[stderr] * What went wrong:
[stderr] Execution failed for task ':app:processReleaseMainManifest'.
[stderr] > Manifest merger failed : android:exported needs to be explicitly specified for <activity>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
[stderr] * Try:
[stderr] > Run with --stacktrace option to get the stack trace.
[stderr] > Run with --info or --debug option to get more log output.
[stderr] > Run with --scan to get full insights.
[stderr] * Get more help at https://help.gradle.org
[stderr] BUILD FAILED in 7m 58s

有关该问题的更多详细信息,您可以访问:

https://github.com/expo/eas-cli/issues/1101

【问题讨论】:

    标签: react-native expo


    【解决方案1】:

    我确定您现在已经解决了这个问题...,但对于其他任何人:您需要将 android:exported="true" 添加到任何包含 &lt;intent-filter&gt;&lt;activity&gt;。但是,我建议使用较新版本的 expo 创建一个新项目,然后将相关代码移植过来,这通常不会那么痛苦...

     <activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:exported="true" android:screenOrientation="portrait">
          <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
          </intent-filter>
          <intent-filter>
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>
            <data android:scheme="myapp"/>
            <data android:scheme="com.leewannacott.libriaudire"/>
          </intent-filter>
        </activity>
    

    【讨论】:

      猜你喜欢
      • 2022-06-23
      • 2022-12-22
      • 2021-11-08
      • 2022-12-04
      • 2023-02-25
      • 2022-07-03
      • 2022-10-17
      • 2023-01-05
      • 2023-01-17
      相关资源
      最近更新 更多