Code Monkey home page Code Monkey logo

Comments (18)

gtzinos avatar gtzinos commented on August 10, 2024 1

Here is the solution guys !!! https://stackoverflow.com/questions/36095819/cordova-ios-error-building-images-xcassets/36968113#36968113

from salesforcemobilesdk-cordovaplugin.

xuzongque avatar xuzongque commented on August 10, 2024

Glad to see other friends here.

First please check whether or not you have the right API level installed, according to the AndroidManifest.xml the plugin targets API Level 21. If API Level 21 is already installed, try also install all levels start from 17.

If you are sure that android SDK is installed correctly, there could be a build path issue in the plugin as I also encountered it when I started my app, there is a workaround:
After install the plugin, go to [project path]/plugins/com.salesforce/src/android/libs/, then go inside each of 3 folders under it and hit ant debug, after that cordova project could be built without error.

Hope this message can help.

from salesforcemobilesdk-cordovaplugin.

annoyingmouse avatar annoyingmouse commented on August 10, 2024

Hi Xu,

thanks for the input. I ran ant debug where you suggested and had issues with ANDROID_HOME not being set correctly. It seems as though I am unable to get the SF plugin to clock that ANDROID_HOME is where I put it.

I can echo %ANDROID_HOME% and it knows where it is supposed to be but it isn't reflected in the output as it still looks where it thinks it should be rather than where it actually is. This is helpful though as I think it might explain where everything else is going wrong - except now I'm getting an this error after moving my Android SDK to where the plugin thinks it should be:

BUILD FAILED
C:\Users\<USER>\AppData\Local\Android\android-sdk\tools\ant\build.xml:577: ../../external/cordova/framework resolve to a path with no project.properties file for project D:\wip\SFSDK\inspections\plugins\com.salesforce\src\android\libs\SalesforceSDK

Total time: 0 seconds

from salesforcemobilesdk-cordovaplugin.

xuzongque avatar xuzongque commented on August 10, 2024

Try the following:(assume android tools folder is inside your path, otherwise you may find the "android" executable under [android SDK]/tools)

  1. in command line hit android list target, note the printed out id number for platform API 21.
  2. Go to [app project path]/plugins/com.salesforce/src/android/libs/SalesforceSDK, hit android update project -p . -t <id>, where <id> is the number you noted in last step
  3. Try ant debug now

Do the same steps also for SmartStore and SmartSync.

from salesforcemobilesdk-cordovaplugin.

annoyingmouse avatar annoyingmouse commented on August 10, 2024

Hi again Xu and thanks for your assistance.

I'm afraid that it failed at the first hurdle with this message:

-build-setup:
[getbuildtools] Using latest Build Tools: 21.1.2
     [echo] Resolving Build Target for SalesforceSDK...
[gettarget] Project Target:   Android 5.0.1
[gettarget] API level:        21
     [echo] ----------
     [echo] Creating output directories if needed...
     [echo] ----------
     [echo] Resolving Dependencies for SalesforceSDK...

BUILD FAILED
D:\Android\android-sdk\tools\ant\build.xml:577: ../../external/cordova/framework
 resolve to a path with no project.properties file for project d:\wip\SFSDK\inspections\plugins\com.salesforce\src\android\libs\SalesforceSDK

This was after getting this:

----------
id: 5 or "android-21"
     Name: Android 5.0.1
     Type: Platform
     API level: 21
     Revision: 2
     Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in, AndroidWearRound, AndroidWearSquare, AndroidWearRound, AndroidWearSquare
 Tag/ABIs : android-tv/armeabi-v7a, android-tv/x86, android-wear/armeabi-v7a, android-wear/x86, default/armeabi-v7a, default/x86, default/x86_64

And doing both this:

D:\Android\android-sdk\tools\android.bat update project -p . -t "android-21"

And this:

D:\Android\android-sdk\tools\android.bat update project -p . -t 5

Whatever I set the update to be (either 5 or "android-21") I get the error noted above.

Thanks for your time,

Dom

from salesforcemobilesdk-cordovaplugin.

xuzongque avatar xuzongque commented on August 10, 2024

The idea here is to let ant know where android sdk and where dependent libraries are.
SalesforceSDK depends on Cordova lib.
SmartStore depends on SalesforceSDK.
SmartSync depends on SmartStore.
But for some reason the build paths are not resolved correctly in your pc.
Maybe you could check the output after you do android.bat update project -p . -t <id>, are there any errors?
Here is mine: (my id is 35)
screen shot 2015-03-09 at 13 51 54

Here is my project.properties for SalesforceSDK:(after project update)

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "ant.properties", and override values to adapt the script to your
# project structure.

# Project target.
target=Google Inc.:Google APIs:21
android.library=true
android.library.reference.1=../../../../../../platforms/android/CordovaLib
android.library.reference.2=../../../../../../platforms/android/CordovaLib

It points to the platform directory of the same app project where resides the cordova library.

The local.properties contains the path to android SDK:

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.

# location of the SDK. This is only used by Ant
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=/Users/zongquexu/Tools/adt-bundle-mac-x86_64-20140702/sdk

proguard-project.txt contains nothing but comments.

May be there are differences between Windows and Mac but the idea should be the same.

from salesforcemobilesdk-cordovaplugin.

annoyingmouse avatar annoyingmouse commented on August 10, 2024

Hi Xu,

D:\wip\SFSDK\inspections\plugins\com.salesforce\src\android\libs\SalesforceSDK>D:\Android\android-sdk\tools\android.bat update project -p . -t 5
Updated project.properties
Updated local.properties
Updated file D:\wip\SFSDK\inspections\plugins\com.salesforce\src\android\libs\SalesforceSDK\proguard-project.txt

produces (project.properties):

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "ant.properties", and override values to adapt the script to your
# project structure.

# Project target.
target=android-21
android.library=true
android.library.reference.1=../../external/cordova/framework
android.library.reference.2=..\\..\\..\\..\\..\\..\\platforms\\android\\CordovaLib

And (local.properties)

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must *NOT* be checked into Version Control Systems,
# as it contains information specific to your local configuration.

# location of the SDK. This is only used by Ant
# For customization when using a Version Control System, please read the
# header note.
sdk.dir=d:\\Android\\android-sdk

And (proguard-project.txt)

# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

Does that help?

from salesforcemobilesdk-cordovaplugin.

xuzongque avatar xuzongque commented on August 10, 2024

In project.properties Try to modify line:
android.library.reference.1=../../external/cordova/framework
into:
android.library.reference.1=..\\..\\..\\..\\..\\..\\platforms\\android\\CordovaLib

from salesforcemobilesdk-cordovaplugin.

wheresmythribble avatar wheresmythribble commented on August 10, 2024

Did anyone ever get this to work? This looks like it's the same issue I am having - trying to use SalesForce SDK to create an Android hybrid on Windows.

from salesforcemobilesdk-cordovaplugin.

michacom avatar michacom commented on August 10, 2024

@bhariharan, would you like to post the exact versions of ant, jdk, node and cordova you use?

from salesforcemobilesdk-cordovaplugin.

vdyalex avatar vdyalex commented on August 10, 2024

@michacom I already have experienced this bug using both the forcedroid and cordova plugin. I tried all solutions which @xuzongque kindly have proposed.

I believe these problems are occurring only with Windows. I'm trying on a Mac OS X also.

My versions of Windows are:

C:\>ant -v
Apache Ant(TM) version 1.9.6 compiled on June 29 2015
Trying the default build file: build.xml
Buildfile: build.xml does not exist!
Build failed

C:\>java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

C:\>node -v
v0.12.2

C:\>cordova -v
5.1.1

Thanks for attention helping us.

Kind regards.

from salesforcemobilesdk-cordovaplugin.

vdyalex avatar vdyalex commented on August 10, 2024

@annoyingmouse, try to downgrade the version of Cordova. It works to me.

npm uninstall -g cordova && npm install -g [email protected] 

from salesforcemobilesdk-cordovaplugin.

annoyingmouse avatar annoyingmouse commented on August 10, 2024

Thank @alexndreazevedo , the next time I need something using the SalesforceMobileSDK-CordovaPlugin I'll make sure I do so. ;-)

from salesforcemobilesdk-cordovaplugin.

wmathurin avatar wmathurin commented on August 10, 2024

We have added the max version constraint in the plugin.xml.
See:
487941c

from salesforcemobilesdk-cordovaplugin.

DiegoBuenoCoelho-zz avatar DiegoBuenoCoelho-zz commented on August 10, 2024

I cannot do anything with these command lines.. oh my god..
That's frustating

from salesforcemobilesdk-cordovaplugin.

vdyalex avatar vdyalex commented on August 10, 2024

@DieguitoBueno do you have tried remove and add again the android platform. When you downgrade the Cordova NPM, it doesn't change nothing into your project. I only could have success when I cleaned my platforms.

from salesforcemobilesdk-cordovaplugin.

Suchitkushwaha avatar Suchitkushwaha commented on August 10, 2024

delete the platforms and add the platforms again using ionic platform add android its works for me :-)

from salesforcemobilesdk-cordovaplugin.

FauzyAbdan avatar FauzyAbdan commented on August 10, 2024

can you build for another cordova project?
If it is yes, you must match configuration on "build.xml" line 577 with your "config.xml".
In my case the problems were "uses-permission" and "access origin" in my "config.xml".

from salesforcemobilesdk-cordovaplugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.