解析react native中的软件包问题

rlcwz9us  于 2022-11-25  发布在  React
关注(0)|答案(1)|浏览(137)

我得到了有一个问题,解析软件包问题在React Native消息后,更新targetSdkVersion到31应用程序是工作正常的30也在android 12。但更新到31后,它停止工作的android 12。

我更新了,因为Google Play控制台需要min 31
我也在AndroidMainifest中尝试了android:exported="true,但没有幸运。

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools" // added this 5 min ago
  package="com.robo.border">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
    <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />

    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/icon"
      android:roundIcon="@mipmap/icon"
      android:allowBackup="false"
      android:theme="@style/AppTheme"
      android:usesCleartextTraffic="true"
      android:requestLegacyExternalStorage="true">
      <activity
        android:name=".MainActivity"
        android:exported="true"
        android:label="@string/app_name"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
        android:launchMode="singleTask"
        android:windowSoftInputMode="adjustResize">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter android:autoVerify="true">
                <action android:name="android.intent.action.VIEW"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <category android:name="android.intent.category.BROWSABLE"/>
                <data android:host="roborewards.page.link" android:scheme="http"/>
                <data android:host="roborewards.page.link" android:scheme="https"/>
                <data android:host="beta.roborewards.net" android:scheme="http"/>
                <data android:host="beta.roborewards.net" android:scheme="https"/>
            </intent-filter>
      </activity>
      <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" />
        <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>

        <!-- <service android:name="com.roborewards.bordertown.backgroundService"
         android:exported="false">
            <intent-filter>
                <action android:name="com.roborewards.bordertown.START_BACKGROUND" />
            </intent-filter>
        </service> -->
 
        <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />

        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="AIzaSyB8gYNp6OgMfspmHEp5dfjAbsWS9mdQHh8" />
        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/facebook_app_id" />

        <activity android:name="com.facebook.FacebookActivity"
        android:configChanges=
                "keyboard|keyboardHidden|screenLayout|screenSize|orientation"
        android:label="@string/app_name" />
    <activity
        android:name="com.facebook.CustomTabActivity"
        android:exported="true">
        <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="@string/fb_login_protocol_scheme" />
        </intent-filter>
    </activity>

        <!-- <provider
            android:name="com.facebook.FacebookContentProvider"
            android:authorities="com.facebook.app.FacebookContentProvider{1062151634294103}"
            android:exported="true" /> -->

        <!-- You will also only need to add this uses-libray tag -->
        <uses-library
            android:name="org.apache.http.legacy"
            android:required="false" />
    </application>
</manifest>

这是我的身材。

buildscript {
    ext {
        buildToolsVersion = "29.0.3"
        minSdkVersion = 21
        compileSdkVersion = 29 // also tried with 31
        targetSdkVersion = 31 //updated old is 30
        ndkVersion = "20.1.5948944"
        googlePlayServicesVersion = "+"
    }
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:4.1.0")
        classpath('com.google.gms:google-services:4.3.3'
    }
}

谢谢,如果有人有困惑,我会更好地解释一遍。

hgqdbh6s

hgqdbh6s1#

已解决:请使用USB运行并正确设置android:导出“true”或“false”,以便在android studio中进行检查,点击并向下滚动

相关问题