uni-app Activity class {com.android.UniPlugin/io.dcloud.PandoraEntry} does not exist

uni-app Activity class {com.android.UniPlugin/io.dcloud.PandoraEntry} does not exist

操作步骤:

  • 怀疑是UniPlugin-Hello-AS 插件工程 有问题

预期结果:

  • 不要报错

实际结果:

  • UniPlugin-Hello-AS 插件工程 报错

bug描述:

2024年04月02日发布——HBuilderX(4.08.2024040127) 这个版本的 UniPlugin-Hello-AS 插件工程报错
【报Bug】Activity class {com.android.UniPlugin/io.dcloud.PandoraEntry} does not exist


| 信息类别         | 信息内容           |
|------------------|--------------------|
| 产品分类         | uniapp/App         |
| PC开发环境       | Mac                |
| HBuilderX类型    | 正式               |
| HBuilderX版本号  | 4.08               |
| 手机系统         | Android            |
| 手机系统版本号    | Android 11         |
| 手机厂商         | 小米               |
| 手机机型         | 红米               |
| 页面类型         | vue                |
| vue版本          | vue2               |
| 打包方式         | 云端               |
| 项目创建方式     | HBuilderX          |

更多关于uni-app Activity class {com.android.UniPlugin/io.dcloud.PandoraEntry} does not exist的实战教程也可以访问 https://www.itying.com/category-93-b0.html

3 回复

同样问题

更多关于uni-app Activity class {com.android.UniPlugin/io.dcloud.PandoraEntry} does not exist的实战教程也可以访问 https://www.itying.com/category-93-b0.html


也是一样的, 有办法解决吗?

The error message you’re encountering, uni-app Activity class {com.android.UniPlugin/io.dcloud.PandoraEntry} does not exist, typically indicates that the specified activity class cannot be found in your Android project. This issue often arises when there is a mismatch or misconfiguration in the Android manifest file or when the required dependencies are not properly included in your project.

Here are some steps to troubleshoot and resolve this issue:


1. Check the AndroidManifest.xml File

  • Ensure that the AndroidManifest.xml file in your project correctly declares the PandoraEntry activity.
  • The entry should look something like this:
    <activity
        android:name="io.dcloud.PandoraEntry"
        android:launchMode="singleTask"
        android:configChanges="orientation|keyboardHidden|screenSize"
        android:theme="@style/TranslucentTheme">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    
  • If the PandoraEntry activity is missing or incorrectly configured, add or correct it.

2. Verify Dependencies

  • Ensure that the uni-app SDK and related dependencies are properly included in your project.
  • If you’re using Gradle, check your build.gradle file for the required dependencies. For example:
    dependencies {
        implementation 'io.dcloud:uniplugin:latest-version'
        // Add other dependencies as needed
    }
    
  • If the dependencies are missing, add them and sync your project.

3. Rebuild the Project

  • Clean and rebuild your project to ensure that all resources and configurations are correctly applied.
    • In Android Studio, go to Build > Clean Project and then Build > Rebuild Project.

4. Check for ProGuard/R8 Issues

  • If you’re using ProGuard or R8 for code shrinking and obfuscation, ensure that the PandoraEntry class is not being removed.
  • Add a rule to your proguard-rules.pro file to keep the class:
    -keep class io.dcloud.PandoraEntry { *; }
    

5. Update uni-app SDK

  • If you’re using an older version of the uni-app SDK, there might be compatibility issues. Update to the latest version of the SDK.

6. Check for Custom Configurations

  • If you’ve made custom configurations to your project, ensure they don’t interfere with the PandoraEntry activity.
  • For example, if you’re using custom build flavors or product flavors, ensure they are correctly configured.

7. Reinstall the Project

  • If the issue persists, try deleting the build folder and reinstalling the project:
    rm -rf build
    ./gradlew clean
    ./gradlew build
回到顶部