簡體   English   中英

android:出口: <receive com.dieam.reactnativepushnotification.modules.rnpushnotificationbooteventreceive< div><div id="text_translate"><p> 任務“:app:processReleaseMainManifest”執行失敗。</p><blockquote><p> 清單合並失敗: <strong>android:</strong>需要為元素 <receiver#com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver> 明確指定導出。 針對 Android 12 及更高版本的應用需要為android:exported指定一個明確的值,當相應的組件定義了一個 Intent 過濾器時。</p></blockquote><p> <strong>AndroidManifesr.xml</strong></p><pre> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.projectrn"> <uses-permission android:name="android.permission.INTE.NET" /> <uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" android:theme="@style/AppTheme"> <activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <:-- Change the value to true to enable pop-up for in foreground on receiving remote notifications (for prevent duplicating while showing local notifications set this to false) --> <meta-data android.name="com.dieam.reactnativepushnotification:notification_foreground" android:value="false"/> <.-- Change the resource name to your App's accent color - or any other color you want --> <meta-data android.name="com.dieam:reactnativepushnotification:notification_color" android:resource="@color/white"/> <.-- or @android.color/{name} to use a standard color --> <receiver android.name="com.dieam:reactnativepushnotification:modules.RNPushNotificationActions" android.exported="false"/> <receiver android.name="com.dieam:reactnativepushnotification.modules.RNPushNotificationPublisher" /> <receiver android.name="com.dieam:reactnativepushnotification.modules.RNPushNotificationBootEventReceiver"> <intent-filter> <action android.name="android:intent.action.BOOT_COMPLETED" /> <action android.name="android:intent.action.QUICKBOOT_POWERON" /> <action android.name="com.htc:intent.action.QUICKBOOT_POWERON"/> </intent-filter> </receiver> <service android.name="com.dieam:reactnativepushnotification:modules.RNPushNotificationListenerService" android.exported="false" > <intent-filter> <action android.name="com.google.firebase.MESSAGING_EVENT" /> </intent-filter> </service></pre></div></receive>

[英]android:exported : <receive com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceive

任務“:app:processReleaseMainManifest”執行失敗。

清單合並失敗: android:需要為元素 <receiver#com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver> 明確指定導出。 針對 Android 12 及更高版本的應用需要為android:exported指定一個明確的值,當相應的組件定義了一個 Intent 過濾器時。

AndroidManifesr.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.projectrn">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>


<application
  android:name=".MainApplication"
  android:label="@string/app_name"
  android:icon="@mipmap/ic_launcher"
  android:roundIcon="@mipmap/ic_launcher_round"
  android:allowBackup="false"
  android:theme="@style/AppTheme">
  <activity
    android:name=".MainActivity"
    android:label="@string/app_name"
    android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
    android:launchMode="singleTask"
    android:windowSoftInputMode="adjustResize"
    android:exported="true">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
  </activity>
   <!-- Change the value to true to enable pop-up for in foreground on receiving remote notifications (for prevent duplicating while showing local notifications set this to false) -->
    <meta-data  android:name="com.dieam.reactnativepushnotification.notification_foreground"
                android:value="false"/>
    <!-- Change the resource name to your App's accent color - or any other color you want -->
    <meta-data  android:name="com.dieam.reactnativepushnotification.notification_color"
                android:resource="@color/white"/> <!-- or @android:color/{name} to use a standard color -->

    <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationActions" android:exported="false"/>
    <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" />
    <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver">
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
            <action android:name="android.intent.action.QUICKBOOT_POWERON" />
            <action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/>
        </intent-filter>
    </receiver>

    <service
        android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"
        android:exported="false" >
        <intent-filter>
            <action android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
    </service>

您需要在<receiver>標簽com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver中添加android:exported = true 或 false。 根據Android 文檔

如果activityservicebroadcast receiver使用 intent 過濾器並且沒有明確聲明的android:exported值,則您的應用無法安裝在運行 Android 12 或更高版本的設備上。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM