首页 > 解决方案 > 找不到元素的声明(Android Studio 3.3.2)

问题描述

我在不同的机器上多次全新安装了 AS v3.3.2,并创建了“hello world”,然后构建并创建了一个 APK!当我分析 APK(调试和发布)时,它会突出显示 manifest.xml 中的错误。

我已经搜索并尝试了许多可能的解决方案(包括此论坛上的解决方案),但没有任何改变,我无法解决错误。这发生在几个不同复杂的项目中。Developer.Android 网站上有一张图片,但没有解决方案!链接:https ://developer.android.com/studio/build/apk-analyzer 我错过了一些明显的东西吗?一位同事认为编码有问题。

<?xml version="1.0" encoding="UTF-8"?>
<manifest 
    xmlns:android="http://schemas.android.com/apk/res/android"
    platformBuildVersionName="9" 
    platformBuildVersionCode="28" 
    package="com.example.myapp" 
    android:compileSdkVersionCodename="9" 
    android:compileSdkVersion="28" 
    android:versionName="1.0" 
    android:versionCode="1" >
<uses-sdk 
    android:targetSdkVersion="28" 
    android:minSdkVersion="24"/>
<application 
    android:appComponentFactory="
    android.support.v4.app.CoreComponentFactory" 
    android:roundIcon="@ref/0x7f0a0001" 
    android:supportsRtl="true" 
    android:allowBackup="true" 
    android:debuggable="true" 
    android:icon="@ref/0x7f0a0000" 
    android:label="@ref/0x7f0b0027" 
    android:theme="@ref/0x7f0c0005">
    <activity 
        android:name="com.example.myapp.MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category 
                android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity>
</application>
</manifest>

我可以在虚拟设备上运行该项目,但我无法将 apk 上传并安装到手机 v7.0,api-24。

标签: androidxmlmanifest

解决方案


推荐阅读