Code Monkey home page Code Monkey logo

Comments (22)

toddhalfpenny avatar toddhalfpenny commented on August 10, 2024

I have found that I need to, following cordova prepare that I need to open in Android Studio to build and run the project. Using the cordova commands at this stage causes me issues.

from salesforcemobilesdk-cordovaplugin.

coderReview avatar coderReview commented on August 10, 2024

In android studio I get a lot of errors:
Error:(5, 0) Project with path ':libs:SmartSync' could not be found in project ':SalesforceHybrid'.

from salesforcemobilesdk-cordovaplugin.

toddhalfpenny avatar toddhalfpenny commented on August 10, 2024

Ah right, there is a post install script that should run after the SF plugin us added. This requires shelljs npm package to be installed locally. Could be that this is not there?

from salesforcemobilesdk-cordovaplugin.

coderReview avatar coderReview commented on August 10, 2024

It is there. What cordova version is to be used? Can it be the latest one?

from salesforcemobilesdk-cordovaplugin.

wmathurin avatar wmathurin commented on August 10, 2024

Could you run:

npm list -g | grep -A1 forcedroid

To see what version of forcedroid and dependent packages you are using.

shelljs released a new version (0.6.0) on thursday which causes forcedroid to not copy files the right way when setting up an hybrid applications. We should have a patch release out soon.

from salesforcemobilesdk-cordovaplugin.

coderReview avatar coderReview commented on August 10, 2024

What version of shelljs is compatible with forcedroid?

from salesforcemobilesdk-cordovaplugin.

wmathurin avatar wmathurin commented on August 10, 2024

from salesforcemobilesdk-cordovaplugin.

coderReview avatar coderReview commented on August 10, 2024

Using 0.5.3 work partially. I had to manually run the script to update the AndroidManifest.xml:

shjs plugins/com.salesforce/tools/postinstall-android.js

from salesforcemobilesdk-cordovaplugin.

coderReview avatar coderReview commented on August 10, 2024

After that when building the code using

cordova build android

I get the following error:

platforms/android/build/intermediates/manifests/full/debug/AndroidManifest.xml:35:23-41 : No resource found that matches the given name (at 'icon' with value '@drawable/sf__icon').

from salesforcemobilesdk-cordovaplugin.

coderReview avatar coderReview commented on August 10, 2024

Only worked if I open the project in Android Studio

from salesforcemobilesdk-cordovaplugin.

toddhalfpenny avatar toddhalfpenny commented on August 10, 2024

Yup, same here (though I had the same with earlier version of shelljs).

from salesforcemobilesdk-cordovaplugin.

coderReview avatar coderReview commented on August 10, 2024

Now I am getting error in dexDebug because of the android method limit. Caused by the play services library.

from salesforcemobilesdk-cordovaplugin.

toddhalfpenny avatar toddhalfpenny commented on August 10, 2024

Cool, you can overcome this by replacing the following line in build-gradle with this;

compile "com.google.android.gms:play-services:7.5.0"

with

compile "com.google.android.gms:play-services-gcm:7.5.0"

This reduces the Google services to be pulled in.

I have some notes on my progress and issues so far, but not thoroughly tested yet.

from salesforcemobilesdk-cordovaplugin.

coderReview avatar coderReview commented on August 10, 2024

Thanks. Got it to compile. Now I manage to login to Salesforce, but got a new error:
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/xxx/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]] couldn't find "libstlport_shared.so"

from salesforcemobilesdk-cordovaplugin.

toddhalfpenny avatar toddhalfpenny commented on August 10, 2024

Good stuff, I have seen that too... But can't remember how I git round it. Sorry not at my pc till Monday (it's Sat night where I am), but I can post up then if you don't get past this by then.

Might be worth searching the issues on this repo for any errors as I did initially post a few of my notes up.

from salesforcemobilesdk-cordovaplugin.

coderReview avatar coderReview commented on August 10, 2024

Found it in previous issue. Finally managed to get the application working. I will do a merge request for the play service and libstlport_shared.so issue.

Still don't understand why the AndroidManifest.xml file didn't get updated when the plugin is added only after running shjs manually.

from salesforcemobilesdk-cordovaplugin.

toddhalfpenny avatar toddhalfpenny commented on August 10, 2024

Fantastic!
You don't happen to have other plugins installed do you?

from salesforcemobilesdk-cordovaplugin.

coderReview avatar coderReview commented on August 10, 2024

Lots of other plugins, :).

cordova-plugin-console
cordova-plugin-datepicker
cordova-plugin-device
cordova-plugin-network-information
cordova-plugin-splashscreen
cordova-plugin-statusbar
cordova-plugin-whitelist
cordova-plugin-x-toast
ionic-plugin-keyboard
phonegap-plugin-push

from salesforcemobilesdk-cordovaplugin.

toddhalfpenny avatar toddhalfpenny commented on August 10, 2024

Ah right, so I have a theory that the SF plugin currently needs to be the last to be added, otherwise things don't quite go to plan.
You could try removing the sf plugin, removing and adding the platform and then re-adding the SF plugin.
Like I said I have some notes but nothing to concrete yet.

from salesforcemobilesdk-cordovaplugin.

coderReview avatar coderReview commented on August 10, 2024

There is a fetch.json file. The Salesforce plugin is the last one in the file.

from salesforcemobilesdk-cordovaplugin.

coderReview avatar coderReview commented on August 10, 2024

What I did.

cordova platform rm android
cordova plugin rm com.salesforce
cordova platform add [email protected]
cordova plugin add https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin.git

AndroidManifest.xml wasn't updated by the post installation script.

from salesforcemobilesdk-cordovaplugin.

bhariharan avatar bhariharan commented on August 10, 2024

This issue should be resolved in our 4.1 release, which is now live.

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.