简体   繁体   English

如何解决:错误:处理清单失败

[英]How to resolve: error: failed processing manifest

I am new to Ionic , Android and Moodle , I have several errors when trying to generate a custom Moodle apk , I come here for help for this error that is generated with the application ID.我是IonicAndroidMoodle 的新手,我在尝试生成自定义Moodle apk时遇到了几个错误,我来这里寻求帮助以解决使用应用程序 ID 生成的错误。

Well, what I did was the following, I changed the original Moodle ID to my application, I was fixing errors with Grandle, I configured the SDK well, I linked the JDK, I built, compiled and transpiled very many times and that's why now I only fit the command directly.好吧,我做了以下事情,我将原始 Moodle ID 更改为我的应用程序,我正在使用 Grandle 修复错误,我很好地配置了 SDK,我链接了 JDK,我构建、编译和转译了很多次,这就是为什么现在我只适合直接使用命令。

I suspect that it may be an error in the config.xml, I don't know, or the folders created by changing the name of the id_app with the packages.我怀疑它可能是config.xml中的错误,我不知道,或者通过使用包更改id_app的名称创建的文件夹。

These errors appear in the console after executing cordova.cmd build android --release执行cordova.cmd build android --release后控制台出现这些错误

[...]
> Task :app:processDebugResources
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
  C:\..\moodleapp\platforms\android\app\build\intermediates\merged_manifests\debug\AndroidManifest.xml:76: AAPT: error: resource xml/provider_paths (aka com.mycustom.app:xml/provider_paths) not found.

  C:\..\moodleapp\platforms\android\app\build\intermediates\merged_manifests\debug\AndroidManifest.xml:85: AAPT: error: resource xml/camera_provider_paths (aka com.mycustom.app:xml/camera_provider_paths) not found.

  C:\..\moodleapp\platforms\android\app\build\intermediates\merged_manifests\debug\AndroidManifest.xml:99: AAPT: error: resource xml/opener_paths (aka com.mycustom.app:xml/opener_paths) not found.

  error: failed processing manifest.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 10s
 FAILED
23 actionable tasks: 1 executed, 22 up-to-date
C:\..\moodleapp\platforms\android\gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
  C:\..\moodleapp\platforms\android\app\build\intermediates\merged_manifests\debug\AndroidManifest.xml:76: AAPT: error: resource xml/provider_paths (aka com.mycustom.app:xml/provider_paths) not found.

  C:\..\moodleapp\platforms\android\app\build\intermediates\merged_manifests\debug\AndroidManifest.xml:85: AAPT: error: resource xml/camera_provider_paths (aka com.mycustom.app:xml/camera_provider_paths) not found.

  C:\..\moodleapp\platforms\android\app\build\intermediates\merged_manifests\debug\AndroidManifest.xml:99: AAPT: error: resource xml/opener_paths (aka com.mycustom.app:xml/opener_paths) not found.

  error: failed processing manifest.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 10s
[ERROR] An error occurred while running subprocess cordova.

        cordova.cmd build android --buildFlag=-UseModernBuildSystem=0 exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.

C:\..\moodleapp>_

My Moodle AndroidManifest.xml我的 Moodle AndroidManifest.xml

<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true" 
        android:versionCode="10000" 
        android:versionName="1.0" 
        package="com.mycustom.app" 
        xmlns:android="http://schemas.android.com/apk/res/android">
            [...more code...]
        <provider android:authorities="${applicationId}.darryncampbell.cordova.plugin.intent.fileprovider" 
        android:exported="false" 
        android:grantUriPermissions="true" 
        android:name="com.darryncampbell.cordova.plugin.intent.CordovaPluginIntentFileProvider">
            <meta-data android:name="android.support.FILE_PROVIDER_PATHS" 
            android:resource="@xml/provider_paths" />
        </provider>
        <provider android:authorities="${applicationId}.provider"
            android:exported="false" 
            android:grantUriPermissions="true" 
            android:name="org.apache.cordova.camera.FileProvider">
                <meta-data android:name="android.support.FILE_PROVIDER_PATHS" 
                android:resource="@xml/camera_provider_paths" />
        </provider>
            <meta-data android:name="firebase_analytics_collection_deactivated" 
            android:value="true" />
        <provider android:authorities="${applicationId}.opener.provider" 
            android:exported="false" 
            android:grantUriPermissions="true" 
            android:name="io.github.pwlin.cordova.plugins.fileopener2.FileProvider">
            <meta-data android:name="android.support.FILE_PROVIDER_PATHS" 
            android:resource="@xml/opener_paths" />
        </provider>
    </application>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>

I just want to generate the apk and the steps of the moodle documentation has nt been useful to me.我只想生成 apk,moodle 文档的步骤对我没有用。

link Moodle App https://github.com/moodlehq/moodleapp链接 Moodle App https://github.com/moodlehq/moodleapp

My Proyect https://github.com/sauta/moodleapp我的项目https://github.com/sauta/moodleapp

Doc Moodle APP https://docs.moodle.org/dev/Setting_up_your_development_environment_for_Moodle_Mobile_2#Building_for_Android_and_iOS Doc Moodle APP https://docs.moodle.org/dev/Setting_up_your_development_environment_for_Moodle_Mobile_2#Building_for_Android_and_iOS

looks like you miss some files.看起来你错过了一些文件。

you need to add this ressources into your config.xml, but first find the files in the explorer and write to real path instead of res/xml/ .您需要将此资源添加到您的 config.xml 中,但首先在资源管理器中找到文件并写入实际路径而不是 res/xml/ 。

Source :来源 :

https://cordova.apache.org/docs/en/latest/plugin_ref/spec.html#resource-file https://cordova.apache.org/docs/en/latest/plugin_ref/spec.html#resource-file

<platform name="android">
  <resource-file src="res/xml/opener_paths.xml" target="res/xml/opener_paths.xml" />
  <resource-file src="res/xml/camera_provider_paths.xml" target="res/xml/camera_provider_paths.xml" />
  <resource-file src="res/xml/provider_paths.xml" target="res/xml/provider_paths.xml" />
</platform>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM