当前位置: 首页 > 知识库问答 >
问题:

Expo-分析Android 12-S10e包时出现问题

商昂然
2023-03-14

我一直在探索StackOverflow、Medium和一些Google,但还没有找到解决方案。

我目前正在使用弹出的Expo应用程序。我需要将compileSdkVersion和targetSdkVersion升级到31,因为对讲机当前需要它。

虽然其他一切都保持不变,但一旦我将compileSdkVersionTarget etSdkVersion更改为上述值并下载编译后的. apkeas build--profile Development--Platform android我在S10e(Android 12)中遇到解析包时出现问题。

我尝试在Android 9模拟器上运行它,但也失败了。尽管如此,配备Android 11的三星Galaxy S10运行良好。

如果我将版本降级到30,项目将恢复,并再次运行良好。

我研究了所有这些链接(以及更多链接)

  • 无法从PlayStore安装适用于Android 12 targetSDK 31的应用程序
  • 在android 12上安装apk失败
  • https://medium.com/@lewwybogus/fixing-there-was-a-problem-while-parsing-the-package-on-android-12-d6235d5a8b
  • 在BroadcastReceiver中使用android:exported=“true”有什么用
  • Android Studio错误:“清单合并失败:针对Android 12的应用程序”
  • Android 12(API级别31)无法从该服务启动ExoPlayer
  • 分析错误:在marshmallow中分析包时出现问题

根据我收集的信息,我需要更新<代码>

我做到了,但是。apk仍可在我的设备上卸载。

这是AndroidManifest。xml来自src/main

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="app.omitted">
  <uses-permission android:name="android.permission.CAMERA"/>
  <uses-permission android:name="android.permission.INTERNET"/>
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
  <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
  <uses-permission android:name="android.permission.RECORD_AUDIO"/>
  <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
  <uses-permission android:name="android.permission.USE_BIOMETRIC"/>
  <uses-permission android:name="android.permission.USE_FINGERPRINT"/>
  <uses-permission android:name="android.permission.VIBRATE"/>
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
  <queries>
    <intent>
      <action android:name="android.intent.action.VIEW"/>
      <category android:name="android.intent.category.BROWSABLE"/>
      <data android:scheme="https"/>
    </intent>
  </queries>
  <application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="true" android:theme="@style/AppTheme" android:usesCleartextTraffic="true">
    <meta-data android:name="expo.modules.updates.ENABLED" android:value="true"/>
    <meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="44.0.0"/>
    <meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
    <meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
    <meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://exp.host/omitted"/>
    <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:screenOrientation="portrait" android:exported="true">
      <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="app.pana"/>
        <data android:scheme="exp+pana"/>
      </intent-filter>
    </activity>
    <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="true"/>
    <activity android:name="com.theartofdev.edmodo.cropper.CropImageActivity" android:theme="@style/Base.Theme.AppCompat" android:exported="true"/>
  </application>
</manifest>

eas。json

{
    "cli": {
        "version": ">= 0.47.0"
    },
    "build": {
        "development": {
            "developmentClient": true,
            "distribution": "internal",
            "android": {
                "image": "ubuntu-18.04-jdk-11-ndk-r19c"
            }
        },
        "preview": {
            "distribution": "internal"
        },
        "production": {}
    },
    "submit": {
        "production": {}
    }
}

这是构建的一部分。格拉德尔:


buildscript {
    ext {
        buildToolsVersion = "31.0.0"
        minSdkVersion = 21
        compileSdkVersion = 31
        targetSdkVersion = 31
    }
    repositories {
        google()
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:4.1.0")

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url(new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), "../android"))
        }
        maven {
            // Android JSC is installed from npm
            url(new File(["node", "--print", "require.resolve('jsc-android/package.json')"].execute(null, rootDir).text.trim(), "../dist"))
        }

        google()
        mavenCentral()
        jcenter()
        maven { url 'https://www.jitpack.io' }
    }
}

我不知道还能做什么。有什么想法吗?

共有1个答案

缑嘉玉
2023-03-14

问题出现在合并的AndroidManifest中。位于生成的中的xml。apk有几个

罪魁祸首之一是世博会开发服务器。

您需要在android/app/src/main/AndroidManifest中包含一个覆盖。xml(老实说,我不知道如何将其包含在android/app/src/debug文件夹中):

这里有一个关于如何做到这一点的例子

  <application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="true" android:theme="@style/AppTheme" android:usesCleartextTraffic="true">
    <meta-data android:name="expo.modules.updates.ENABLED" android:value="true"/>
    <meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="44.0.0"/>
    <meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
    <meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
    <meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="/>
    <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" android:theme="@style/Theme.App.SplashScreen" android:screenOrientation="portrait">
      <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
        <category android:name="android.intent.category.LAUNCHER"/>
      </intent-filter>
      <intent-filter>
        <! -- omitted just for reference -->
      </intent-filter>
    </activity>

<!-- These are the culprits -->
<!-- Include these -->
    <activity android:name="expo.modules.devlauncher.launcher.DevLauncherActivity" android:exported="true"/>
    <activity android:name="expo.modules.devlauncher.launcher.errors.DevLauncherErrorActivity" android:exported="true"/>
    <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false"/>
    <activity android:name="com.theartofdev.edmodo.cropper.CropImageActivity" android:exported="false"/>
<!-- Intercom is a specific package that I'm using -->
    <activity android:name="io.intercom.android.sdk.helpcenter.collections.IntercomHelpCenterActivity" android:exported="false"/>
    <activity android:name="com.intercom.input.gallery.GalleryInputFullScreenActivity" android:exported="false"/>
    <activity android:name="com.intercom.input.gallery.GalleryLightBoxActivity" android:exported="false"/>
  </application>

此外,如果您的应用程序不安装,是因为可能还有其他标记需要进一步更新。要进行检查,请执行以下操作:

  1. 下载Android Studio
  2. 创建空项目或打开现有项目
  3. 转到“生成”选项卡-

如果您看到其中任何一个未包含在内,则需要在AndroidManifest中重写它们。xml在src/main中(如果您想将其应用于所有构建,例如开发、暂存、生产)。

前任:

 <activity android:name="expo.modules.devlauncher.launcher.DevLauncherActivity" android:exported="true"/>

忽略所有其他属性和/或子级,它们将不会被删除。

 类似资料:
  • 我正试图通过使用wsimport从此处https://gpcs.3m.com/gpcs/claimprocessingservice?WSDL解析WSDL文件来生成java客户机,但不起作用。 我在Windows中使用JDK8。具体情况如下。我正在使用一个JVM参数来解决类似JDK8的WebService客户端生成错误的问题 我还在本地下载了WSDL文件,并通过删除一些引用对其进行了修改,因为错误

  • 问题内容: 我正在用Python阅读JSON文件,其中包含许多字段和值(约8000条记录)。Env:Windows 10,Python 3.6.4;码: 这样我得到一个错误。下面是堆栈跟踪: 伴随着我,我尝试了 与此相关,我的程序运行了很长时间,然后挂起,没有任何输出。 我搜索了几乎与此相关的所有主题,但找不到解决方案。 注意:JSON数据是有效的,因为当我在Postman /任何REST客户端上

  • 我的ThymileAF模板中有一个AngularJS属性,看起来像这样: 当Thymeleaf尝试处理此模板时,我得到以下异常: Thymeleaf只是不能很好地处理

  • 问题内容: 在PostgreSQL中,我有一个名为的表。 如您所见,列为。 在Go中,我想通过请求在该表中创建新条目。我像这样发送JSON对象: 不幸的是,它引发了奇怪的 错误 : 我在哪里犯错误以及如何解决我的问题? models / surveys.go: 控制器/surveys.go: 问题答案: 该错误已说明出了什么问题: 将时间“” 2019-01-01 00:00:00“”解析为“”

  • 问题内容: 我是使用AngularJS的新手,但在解析json响应时遇到问题。这是我正在使用的HTML代码: 这是使用AngularJS的Javascript代码: HTML使用服务器返回的JSON显示变量$ scope.response,但顶部列表中未显示任何内容。JSON的格式完美,但是$ scope.cars变量似乎始终为空。 我究竟做错了什么? 非常感谢, GA 问题答案: $ http.

  • 我想获取存储在JWT中的角色声明。我使用以下代码来做到这一点: 但这最终给出了目标代码: 我调试了代码,发现了这样的声明: 如何提取“ROLE_ADMIN”?