You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

PlatformException求助:UCropActivity未在AndroidManifest.xml中声明

解决AndroidManifest未声明UCropActivity导致的ActivityNotFoundException

报错信息

PlatformException(error, Unable to find explicit activity class {com.arcdevelopment.thepack/com.yalantis.ucrop.UCropActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared <intent-filter>?, null, android.content.ActivityNotFoundException: Unable to find explicit activity class {com.arcdevelopment.thepack/com.yalantis.ucrop.UCropActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared <intent-filter>?

问题原因

你使用的UCrop图片裁剪库需要在AndroidManifest中声明对应的UCropActivity,但当前配置里缺少这个声明,导致系统无法找到该页面。

解决方案

  1. 打开你的AndroidManifest.xml文件
  2. 在<application>标签内部,添加UCropActivity的声明代码:
<activity
    android:name="com.yalantis.ucrop.UCropActivity"
    android:screenOrientation="portrait"
    android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>

修改后的完整AndroidManifest代码

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.arcdevelopment.thepack">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <queries>
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="https" />
        </intent>

        <!-- 如果你的应用需要检测SMS支持 -->
        <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="sms" />
        </intent>

         <intent>
            <action android:name="android.intent.action.VIEW" />
            <data android:scheme="tel" />
        </intent>
    </queries>

   <application
        android:label="The Pack"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher">
       <!-- 配置Apple登录回调页面,支持浏览器跳转调用 -->
       <activity
               android:name="com.aboutyou.dart_packages.sign_in_with_apple.SignInWithAppleCallback"
               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="signinwithapple" />
               <data android:path="callback" />
           </intent-filter>
       </activity>
       <activity android:name=".myActivity"></activity>

        <!-- 添加UCropActivity声明 -->
        <activity
            android:name="com.yalantis.ucrop.UCropActivity"
            android:screenOrientation="portrait"
            android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>

        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:screenOrientation="portrait"
            android:windowSoftInputMode="adjustResize">
            <!-- 指定Android进程启动后立即应用的主题,Flutter UI初始化时用户会看到这个主题,之后该主题继续决定Flutter UI背后的窗口背景 -->
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <!-- 不要删除下面的meta-data,Flutter工具会用它生成GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>

内容的提问来源于stack exchange,提问作者Arisbor

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.03 17:05:45