简体   繁体   English

android:exported 需要明确指定<activity></activity>

[英]android:exported needs to be explicitly specified for <activity>

I get the error:我收到错误:

* What went wrong:
Execution failed for task ':app:processEmbedNoRecordReleaseMainManifest'.
> 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.

While I mentioned android:exported for each activity, I don't understand why I'm getting this error.虽然我为每个活动提到了android:exported ,但我不明白为什么会出现此错误。 Here is the manifest:这是清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest
    package="org.love2d.android.executable"
    xmlns:android="http://schemas.android.com/apk/res/android" >
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.VIBRATE" />
  <uses-permission android:name="android.permission.BLUETOOTH" />
  <uses-permission android:name="android.permission.RECORD_AUDIO" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18" />

  <!-- OpenGL ES 2.0 -->
  <uses-feature android:glEsVersion="0x00020000" />
  <!-- Touchscreen support -->
  <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
  <!-- Game controller support -->
  <uses-feature android:name="android.hardware.bluetooth" android:required="false" />
  <uses-feature android:name="android.hardware.gamepad" android:required="false" />
  <uses-feature android:name="android.hardware.usb.host" android:required="false" />
  <!-- External mouse input events -->
  <uses-feature android:name="android.hardware.type.pc" android:required="false" />
  <!-- Low latency audio -->
  <uses-feature android:name="android.hardware.audio.low_latency" android:required="false" />
  <uses-feature android:name="android.hardware.audio.pro" android:required="false" />

  <application
      android:allowBackup="true"
      android:icon="@drawable/love"
      android:label="Game Test"
      android:usesCleartextTraffic="true" >
    <activity
        android:name="org.love2d.android.GameActivity"
        android:exported="true"
        android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout|keyboard|keyboardHidden|navigation"
        android:label="Game Test"
        android:launchMode="singleTask"
        android:screenOrientation="landscape"
        android:resizeableActivity="false"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
        <intent-filter>
          <action android:name="android.intent.action.MAIN" />
          <category android:name="android.intent.category.LAUNCHER" />
          <category android:name="tv.ouya.intent.category.GAME" />
        </intent-filter>
        <intent-filter>
          <action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
        </intent-filter>
      </activity>

      <!--Needed by AdMob-->
      <activity
        android:name="com.google.android.gms.ads.AdActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
        android:exported="false">
      </activity>
    </application>
</manifest>

I read that adding an intent filter could solve the problem but where is why?我读到添加 intent 过滤器可以解决问题,但为什么? Apart from AdMob I don't see why and if so what should be added?除了 AdMob,我不明白为什么,如果是的话应该添加什么?

It maybe you have a dependency that needs to have android:exported也许你有一个依赖需要有 android:exported

暂无
暂无

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

相关问题 清单合并失败:需要明确指定 android:exported<activity> - Manifest merger failed : android:exported needs to be explicitly specified for <activity> android:exported 需要明确指定<activity> . 针对 Android 12 及更高版本的应用需要指定</activity> - android:exported needs to be explicitly specified for <activity>. Apps targeting Android 12 and higher are required to specify android:exported 需要明确指定<service> . 针对 Android 12 的应用程序</service> - android:exported needs to be explicitly specified for <service>. Apps targeting Android 12 Manifest合并失败:android:exported needs to be explicitly specified for<receiver></receiver> - Manifest merger failed : android:exported needs to be explicitly specified for <receiver> "我设置了 android:exported 但我仍然收到错误:android:exported 需要明确指定<receiver>" - I set android:exported but I am still getting error: android:exported needs to be explicitly specified for <receiver> android:exported 需要明确指定<receiver> . 在 Flutter 中面向 Android 12 及更高版本的应用 - android:exported needs to be explicitly specified for <receiver>. Apps targeting Android 12 and higher In Flutter Android:exported 需要明确指定<service> .针对 Android 12 及更高版本的应用程序</service> - Android:exported needs to be explicitly specified for <service>.Apps targeting Android 12 and higher 清单合并失败:需要为元素显式指定 android:exported <service#com.marianhello.bgloc.sync.authenticatorservice></service#com.marianhello.bgloc.sync.authenticatorservice> - Manifest merger failed : android:exported needs to be explicitly specified for element <service#com.marianhello.bgloc.sync.AuthenticatorService> Android应用程序活动中的导出属性 - Exported attribute in activity of android apps Android清单上指定的活动的RuntimeError - RuntimeError for activity specified on Android Manifest
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM