2016-11-15 43 views
1

我有離子命令的問題:離子構建Android執行失敗的任務「:processDebugResources」上的離子

Here教程的Salesforce我追隨的創建連接到Salesforce的API的應用程序。 (聯繫等)。

現在,當我mudt構建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和移動設備的初學者。也許解決方案是oubvious。

+0

錯誤輸出表明由於缺少圖標資源,構建失敗:'沒有找到與給定名稱相匹配的資源('圖標'的值爲'@ drawable/sf__icon')。'也許是一個命名問題,你不小心加了第二個下劃線或圖標是不存在的? ;) – OClyde

+0

確實,但這個文件應該在哪裏?我從來不使用XML,所以我不知道他在哪裏尋找這個文件。我會粘貼另一個隨機圖標,以便能夠運行'Ionic build' – Tellimi

+0

啊好吧 - 所以'@ drawable /'符號在你的Android項目中引用'res/drawable',所以爲了給它一個試試最簡單的方法可能是在這個文件夾中放置了一個虛擬的圖標..但是,只是檢查了Salesforce SDK回購,並且確實在他們的XML文件中引用了該文件,但沒有包含圖標......雖然很奇怪! – OClyde

回答

1

錯誤輸出表明構建失敗,只是因爲缺少一個圖標資源:沒有資源發現在給定的名字相匹配(在「圖標」,值爲「@繪製/ sf__icon」)。

的SalesforceSDK包括這些文件,雖然,但他們似乎並沒有被添加到Android項目正確:

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

的複製粘貼可能,雖然解決了問題,仍然不知道爲什麼插件不按照預期在res/drawable文件夾中添加drawables!

+0

這是解決這個問題的方法。 Thx OClyde – Tellimi

相關問題