Had a problem with Cordova / Ionic today:
com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:502)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)
After some hours of reading and testing found solution that worked for me in following configuration:
com.phonegap.plugins.facebookconnect 0.11.0 "Facebook Connect"
de.appplant.cordova.plugin.local-notification 0.8.2-dev "LocalNotification"
Fix was quite simple (after a couple of hours :) :
plugins/com.phonegap.plugins.facebookconnect/plugin.xml:
- <framework custom="true" src="platforms/android/FacebookLib">
+ <framework src="com.android.support:support-v4:+">
+ <framework src="com.facebook.android:facebook-android-sdk:3.23.0">
plugins/de.appplant.cordova.plugin.local-notification/plugin.xml:
- <dependency id="cordova-plugin-android-support-v4">
+ <framework src="com.android.support:support-v4:+">
Thursday, September 24, 2015
Cordova / Ionic - Multiple Dex Issue with "Facebook Connect" and "LocalNotification" plugins.
Posted by Unknown at 2:08 AM 7 comments
Labels: Android, Cordova, Ionic, JavaScript
Friday, September 26, 2014
backbone.js + underscore.js + ??? = good localization
Starting a localization process for one of projects. Currently looking for localization of backbone and underscore parts. i18n plugin from require.js seems to do almost all that I need, but... there is a strange feeling that everything is too simple... Looking around on the web found some frameworks, projects but they don't offer anything that I can not get with a plain and simple require.js i18n... Strange... Someone passed through same feeling before? What was the result? :)
Posted by Unknown at 9:09 PM 0 comments
Labels: backbone.js, i18n, JavaScript, require.js, underscore.js
Thursday, September 25, 2014
npm + grunt + bower + grunt-bower-task
Maybe this will help someone... In any case - I'm keeping this KB mostly for myself :)
Since I prefer following structure for my node.js (and backbone / underscore) projects:
project/
public/
js/
lib/ - here will go all libs/frameworks
app/ - here will go all JS application files
...
css/
fonts/
tpl/
1) Sample package.json:
{
"name": "test",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node app.js"
},
"dependencies": {
"express": "3.*",
"bower": "*"
},
"devDependencies": {
"grunt": "^0.4.5",
"grunt-bower-task": "^0.4.0"
}
}
Posted by Unknown at 3:04 PM 0 comments
Labels: JavaScript
Wednesday, November 27, 2013
MySQL privileges update for creating procedures, functions, etc.
After creating a new user you need to update his privileges to grant creation of procedures, functions and so on. Here is a SQL for this.
UPDATE user SET
Select_priv="Y", Insert_priv="Y", Update_priv="Y", Delete_priv="Y", Create_priv="Y", Drop_priv="Y", Reload_priv="Y", Process_priv="Y", File_priv="Y", References_priv="Y", Index_priv="Y", Alter_priv="Y", Super_priv="Y", Create_tmp_table_priv="Y", Lock_tables_priv="Y", Execute_priv="Y", Create_view_priv="Y", Show_view_priv="Y", Create_routine_priv="Y", Alter_routine_priv="Y", Event_priv="Y", Trigger_priv="Y"
WHERE user = "xxxxx";
FLUSH PRIVILEGES;
Posted by Unknown at 12:20 PM 0 comments
Labels: MySQL
Monday, March 25, 2013
jQuery executes error function even on success (200) status
Just lost a couple of hours with this problems.
jQuery was executing an error function regardless the jqXHR status. A little bit about setup:
node.js + Express + Backbone + backbone.paginator + Underscore
After upgrading to Express 3.0 an application that was working without any problems stoped to work. Problem - jQuery was always executing an error function for all ajax requests. After checking the code, googling, reading, debugging, taking a lunch, debugging again and again I saw that I was using res.json() and not res.jsonp() (added in Express 3.x). Change of one line and everything is working back again.
So - if your node.js + express 3.x returns jsonp, please, use res.jsonp() instead of res.json()
Posted by Unknown at 9:16 PM 0 comments
Labels: AJAX, backbone.js, express.js, JavaScript, jQuery, node.js, underscore.js
Saturday, December 1, 2012
MySQL PASSWORD() function in JavaScript
If you need to implement a MySQL PASSWORD() function in JavaScript - use http://code.google.com/p/crypto-js/#SHA-1 with 2 encodings.
Here is an example:
var password = "TestPassword";
var result = ("*"+CryptoJS.SHA1(CryptoJS.SHA1(password))).toUpperCase();
console.log("result : " + result);
Result will be *0F437A73F4E4014091B7360F60CF81271FB73180. If you check it with MySQL password() it will be the same:
mysql> select password("TestPassword") as result;
+-------------------------------------------+
| result |
+-------------------------------------------+
| *0F437A73F4E4014091B7360F60CF81271FB73180 |
+-------------------------------------------+
Posted by Unknown at 5:45 PM 14 comments
Labels: JavaScript, MySQL
Monday, June 11, 2012
Show hidden files on Mac
To show hidden files and folders in Finder - open terminal window and paste the following line:
defaults write com.apple.Finder AppleShowAllFiles YES
Posted by Unknown at 11:36 AM 0 comments
Monday, December 19, 2011
Find directory with biggest number of files / directories
Today we had a problem related with a number of files in a directory. We needed to find directories with a biggest number of files / directories in it. Here is a small shell script that will list directories and a number of files/directories in each directory.
find . -type d|awk {'print "echo -n "$1".\"\t\"; ls "$1"|wc -l"'} > /tmp/do; . /tmp/do|sort -k 2 -n -r |more
Explaining it a little bit:
"find . -type d" - find all directories bellow current directory
"awk {'print "echo -n "$1".\"\t\"; ls "$1"|wc -l"'} > /tmp/do" - generate a script that will print a directory name (echo -n), make ls in this directory and count a number of lines from ls (wc -l)
". /tmp/do" - execute generated script
"sort -k 2 -n -r" - sort the result using second column (-k 2) as numerical (-n) and in reverse order (-r)
Posted by Unknown at 10:07 PM 0 comments
Monday, February 22, 2010
iPhone takes too long to sync
After changing a notebook I got a following problem. My iPhone was taking an eternity to sync with iTunes. I made a restore - no solution. I made a restore as new iPhone - same problem. After googling a little bit I found that this can be related with "Sync Photos" option. At the moment that I disabled "sync photos" - my iPhone was synced in a couple of minutes.
Problem: iPhone is taking too much time to sync on Windows 7.
Possible solution: Try to disable "Sync Photos" option.
Posted by Unknown at 2:23 PM 0 comments
Labels: iPhone
Sunday, November 8, 2009
VMware crashes after updating (upgrading) of host OS (to CentOS 5.4)
Posted by Unknown at 2:38 AM 0 comments