任务执行失败':processDebugResources'在离子上

时间:2016-11-15 09:28:10

标签: android cordova ionic-framework salesforce

Ionic命令存在问题: Ionic build android

Here Salesforce i跟随创建连接到Salesforce API的应用程序的教程。 (联系等)。

现在,当我构建android时,我遇到了这个问题:

:processDebugResources
/home/r.**/Workspace/IonicApp/platforms/android/build/intermediates/manifests/full/debug/AndroidManifest.xml:32: error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/sf__icon').

 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processDebugResources'.

> 
com.android.ide.common.internal.LoggedErrorException: Failed to run command:

    /usr/local/android-sdk-linux/build-tools/25.0.0/aapt package -f --no-crunch -I /usr/local/android-sdk-linux/platforms/android-23/android.jar -M /home/r.**/Workspace/IonicApp/platforms/android/build/intermediates/manifests/full/debug/AndroidManifest.xml -S /home/r.**/Workspace/IonicApp/platforms/android/build/intermediates/res/debug -A /home/r.**/Workspace/IonicApp/platforms/android/build/intermediates/assets/debug -m -J /home/r.**/Workspace/IonicApp/platforms/android/build/generated/source/r/debug -F /home/r.**/Workspace/IonicApp/platforms/android/build/intermediates/res/resources-debug.ap_ --debug-mode --custom-package com.ionicframework.ionicapp508454 -0 apk --output-text-symbols /home/r.**/Workspace/IonicApp/platforms/android/build/intermediates/symbols/debug

  Error Code:

    1

  Output:

    /home/r.**/Workspace/IonicApp/platforms/android/build/intermediates/manifests/full/debug/AndroidManifest.xml:32: error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/sf__icon').

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

BUILD FAILED

Total time: 3.305 secs

Error: /home/r.**/Workspace/IonicApp/platforms/android/gradlew: Command failed with exit code 1

我重启教程2次,但仍然有这个错误。也许是因为我做了一个Android应用程序,而不是像教程那样的IOS。

这个文件丢失了什么,它应该在哪里?

如果您需要XML:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.ionicframework.ionicapp508454"
    android:hardwareAccelerated="true"
    android:versionCode="18"
    android:versionName="0.0.1" >

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="23" />

    <supports-screens
        android:anyDensity="true"
        android:largeScreens="true"
        android:normalScreens="true"
        android:resizeable="true"
        android:smallScreens="true"
        android:xlargeScreens="true" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

    <permission
        android:name="com.ionicframework.ionicapp508454.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.ionicframework.ionicapp508454.permission.C2D_MESSAGE" />

    <application
        android:name="com.salesforce.androidsdk.phonegap.app.HybridApp"
        android:hardwareAccelerated="true"
    android:icon="@drawable/sf__icon"
        android:label="@string/app_name"
        android:manageSpaceActivity="com.salesforce.androidsdk.ui.ManageSpaceActivity" >
        <activity
            android:name="com.adobe.phonegap.push.PushHandlerActivity"
            android:exported="true" />

        <receiver
            android:name="com.google.android.gms.gcm.GcmReceiver"
            android:exported="true"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />

                <category android:name="com.ionicframework.ionicapp508454" />
            </intent-filter>
        </receiver>

        <service
            android:name="com.adobe.phonegap.push.GCMIntentService"
            android:exported="false" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            </intent-filter>
        </service>
        <service
            android:name="com.adobe.phonegap.push.PushInstanceIDListenerService"
            android:exported="false" >
            <intent-filter>
                <action android:name="com.google.android.gms.iid.InstanceID" />
            </intent-filter>
        </service>
        <service
            android:name="com.adobe.phonegap.push.RegistrationIntentService"
            android:exported="false" />

        <activity
            android:name="com.salesforce.androidsdk.phonegap.ui.SalesforceDroidGapActivity"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Black.NoTitleBar" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name="com.google.android.gms.common.api.GoogleApiActivity"
            android:exported="false"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
    </application>

</manifest>

一些信息:

  • 我创建了一个Android应用程序。

  • Cordova-android是5.0.0版本,因为6.0.0与api salesforce存在不匹配问题。

  • 我是Ionic / Cordova和移动设备的初学者。也许解决方案是不可能的。

1 个答案:

答案 0 :(得分:1)

错误输出表明构建仅因缺少图标资源而失败:找不到与给定名称匹配的资源(在&#39;图标&#39;有值&#39; @ drawable / sf__icon&#39; )。

SalesforceSDK虽然包含这些文件,但它们似乎没有正确添加到Android项目中:

https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin/tree/master/src/android/libs/SalesforceSDK/res

复制粘贴可能会解决问题,但仍然想知道为什么插件不会在res / drawable文件夹中按预期添加drawables!