I have spent the whole day looking for a XMPP client library that will work in Xamarin.
Specifically put , I am developing a cross platform app with a portable class library (Xamarin Forms). I have gone through Sharp.Xmpp, s22.xmp, agsSharp and UbietyXMPP.
Each one have its own peculiar plugging in issue with Xamarin.
Is there any tested and tried client library that is compatible with Xamarin?
The following is the error text of each client libraries while adding from NuGet and in the case of agsXmpp the compile time error log.
Error messages for client libraries:
AgsXmpp
Error 2 Exception while loading assemblies:
System.IO.FileNotFoundException: Could not load assembly
'System.Drawing, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'. Perhaps it doesn't exist in the Mono
for Android profile? File name: 'System.Drawing.dll' at
Xamarin.Android.Tuner.DirectoryAssemblyResolver.Resolve(AssemblyNameReference
reference, ReaderParameters parameters) at
Xamarin.Android.Tasks.ResolveAssemblies.AddAssemblyReferences(ICollection`1
assemblies, AssemblyDefinition assembly, Boolean topLevel) at
Xamarin.Android.Tasks.ResolveAssemblies.Execute() whattf.Droid
S22.Xmpp
Installing 'S22.Xmpp 1.0.0.0'. Successfully installed 'S22.Xmpp
1.0.0.0'. Adding 'S22.Xmpp 1.0.0.0' to whattf.Droid. Uninstalling 'S22.Xmpp 1.0.0.0'. Successfully uninstalled 'S22.Xmpp 1.0.0.0'.
Install failed. Rolling back... Could not install package 'S22.Xmpp
1.0.0.0'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v6.0', but the package does not contain
any assembly references or content files that are compatible with that
framework. For more information, contact the package author.
XMPP
Installing 'XMPP 0.7.0.21'. Successfully installed 'XMPP 0.7.0.21'.
Adding 'XMPP 0.7.0.21' to whattf.Droid. Uninstalling 'XMPP 0.7.0.21'.
Successfully uninstalled 'XMPP 0.7.0.21'. Install failed. Rolling
back... Could not install package 'XMPP 0.7.0.21'. You are trying to
install this package into a project that targets
'MonoAndroid,Version=v6.0', but the package does not contain any
assembly references or content files that are compatible with that
framework. For more information, contact the package author.
UbietyXMPP
Attempting to resolve dependency 'SharpZipLib (= 0.86.0)'. Attempting
to resolve dependency 'Heijden.Dns (= 1.0.0)'. Attempting to resolve
dependency 'Microsoft.Bcl (= 1.1.10)'. Attempting to resolve
dependency 'Microsoft.Bcl.Build (= 1.0.14)'. Attempting to resolve
dependency 'Microsoft.Bcl.Build (= 1.0.21)'. Attempting to resolve
dependency 'Microsoft.Net.Http (= 2.2.29)'. Attempting to resolve
dependency 'Serilog (= 1.5.9)'. Attempting to resolve dependency
'Serilog.Sinks.Seq (= 1.5.15)'. Attempting to resolve dependency
'libidn (= 1.29.1)'. Attempting to resolve dependency
'ExceptionAnalyzer (= 1.0.5)'. Attempting to resolve dependency
'Microsoft.AnalyzerPowerPack (= 1.0.1)'. Installing 'SharpZipLib
0.86.0'. Successfully installed 'SharpZipLib 0.86.0'. Installing 'Heijden.Dns 1.0.0'. Successfully installed 'Heijden.Dns 1.0.0'.
Installing 'Microsoft.Bcl 1.1.10'. Successfully installed
'Microsoft.Bcl 1.1.10'. Installing 'Microsoft.Bcl.Build 1.0.21'.
Successfully installed 'Microsoft.Bcl.Build 1.0.21'. Installing
'Microsoft.Net.Http 2.2.29'. Successfully installed
'Microsoft.Net.Http 2.2.29'. Installing 'Serilog 1.5.9'. Successfully
installed 'Serilog 1.5.9'. Installing 'Serilog.Sinks.Seq 1.5.15'.
Successfully installed 'Serilog.Sinks.Seq 1.5.15'. Installing 'libidn
1.29.1'. Successfully installed 'libidn 1.29.1'. Installing 'ExceptionAnalyzer 1.0.5'. Successfully installed 'ExceptionAnalyzer
1.0.5'. Installing 'Microsoft.AnalyzerPowerPack 1.0.1'. Successfully installed 'Microsoft.AnalyzerPowerPack 1.0.1'. Installing 'UbietyXMPP
0.7.37.0'. Successfully installed 'UbietyXMPP 0.7.37.0'. Adding 'SharpZipLib 0.86.0' to whattf.Droid. Uninstalling 'SharpZipLib
0.86.0'. Successfully uninstalled 'SharpZipLib 0.86.0'. Install failed. Rolling back... Could not install package 'SharpZipLib
0.86.0'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v6.0', but the package does not contain
any assembly references or content files that are compatible with that
framework. For more information, contact the package author.
Xamarin is a subset of the full .NET framework and uses its own core libraries. This is why you will not get those libraries running without recompiling them for Xamarin and doing some modifications to the source when required.
The MatriX XMPP library is available for Xamarin iOS and Android. But its a commercial product.
Related
Cannot compile my App for Android 64-bit with Delphi 10.3.3.
My App is using Box2D library.
While compile I get following errors:
[DCC Error] E2597 C:\Users\Public\Documents\Embarcadero\Studio\android-ndk-r17b\toolchains\aarch64-linux-android-4.9\prebuilt\windows\aarch64-linux-android\bin\ld.exe: cannot find -lFlatBox2D
C:\Users\Public\Documents\Embarcadero\Studio\android-ndk-r17b\toolchains\aarch64-linux-android-4.9\prebuilt\windows\aarch64-linux-android\bin\ld.exe: cannot find -lgnustl_static
Compilation for Android 32-bit of same App is successful.
Compilation of another my (simple) App for Android 64-bits works fine.
So, I realized, that problem is only with Box2D for Android 64-bits used in my App.
Then I also tested compilation of Box2D TestBed App that is coming with RAD (here ...\Embarcadero\Studio\20.0\Samples\Object Pascal\Multi-Device Samples\Physics\TestBed\) - the same issue - it is compiled successfully for Android 32-bits, but same error when I'm compiling TestBed for Android 64-bits!
Please help. Thousands of lines of code in my App already, and now it is full stop - can't build it for Android 64-bits [scared]
UPDATE1
Second error "cannot find -lgnustl_static" fixed by adding path C:\Users\Public\Documents\Embarcadero\Studio\android-ndk-r17b\sources\cxx-stl\gnu-libstdc++\4.9\libs\arm64-v8a into menu Tools->Options, then 'SDK Manager'->NDK->'Android SDK 25.2.5 64-bits'-> value for 'Delphi NDK Library path'.
However, the first problem 'cannot find -lFlatBox2D'still exists.
I found only 2 files of library libFlatBox2D.a on my computer, it is
C:\Program Files (x86)\Embarcadero\Studio\20.0\lib\android\debug
C:\Program Files (x86)\Embarcadero\Studio\20.0\lib\android\release
Both paths I added to the same 'Delphi NDK Library path' at SDK Manager for Android 64bit.
However, now getting error message skipping incompatible libFlatBox2D.a when searching for -lFlatBox2D for each of these paths.
So the question now - where to find a compatible libFlatBox2D.a that required for Android 64bits?
UPDATE2:
Hm... and in following 2 android64 paths do not have any libFlatBox2D.a files.
C:\Program Files (x86)\Embarcadero\Studio\20.0\lib\android64\debug
C:\Program Files (x86)\Embarcadero\Studio\20.0\lib\android64\release
Does it mean, that 10.3.3 Delphi installation is missing 64-bits Box2D android library?
UPDATE3:
As answered by #Stefanos , now I have 64bit version of libFlatBox2D.a.
But now while compiling I receiving count of 1700 linker errors about Box2D names , all of them similar to below:
[DCC Error] E2597 C:\Users\Public\Documents\Embarcadero\Studio\20.0\Samples\Object Pascal\Multi-Device Samples\Physics\TestBed\Android64\Debug\Box2D.Common.o: In function `Box2d::Common::Create_b2Draw_delegate(System::DelphiInterface<Box2d::Common::Ib2Draw>)':
Box2D.Common:(.text._ZN5Box2d6Common22Create_b2Draw_delegateEN6System15DelphiInterfaceINS0_7Ib2DrawEEE[_ZN5Box2d6Common22Create_b2Draw_delegateEN6System15DelphiInterfaceINS0_7Ib2DrawEEE]+0x0): undefined reference to `Create_b2Draw_delegate'
C:\Users\Public\Documents\Embarcadero\Studio\20.0\Samples\Object Pascal\Multi-Device Samples\Physics\TestBed\Android64\Debug\Box2D.Common.o: In function `Box2d::Common::Destroy_b2Draw_delegate(NativeUInt)':
Box2D.Common:(.text._ZN5Box2d6Common23Destroy_b2Draw_delegateE10NativeUInt[_ZN5Box2d6Common23Destroy_b2Draw_delegateE10NativeUInt]+0x0): undefined reference to `Destroy_b2Draw_delegate'
C:\Users\Public\Documents\Embarcadero\Studio\20.0\Samples\Object Pascal\Multi-Device Samples\Physics\TestBed\Android64\Debug\Box2D.Common.o: In function `Box2d::Common::b2Version_Create()':
Box2D.Common:(.text._ZN5Box2d6Common16b2Version_CreateEv[_ZN5Box2d6Common16b2Version_CreateEv]+0x0): undefined reference to `b2Version_b2Version'
C:\Users\Public\Documents\Embarcadero\Studio\20.0\Samples\Object Pascal\Multi-Device Samples\Physics\TestBed\Android64\Debug\Box2D.Common.o: In function `Box2d::Common::b2BlockAllocator_Create()':
Box2D.Common:(.text._ZN5Box2d6Common23b2BlockAllocator_CreateEv[_ZN5Box2d6Common23b2BlockAllocator_CreateEv]+0x0): undefined reference to `b2BlockAllocator_b2BlockAllocator_1'
C:\Users\Public\Documents\Embarcadero\Studio\20.0\Samples\Object Pascal\Multi-Device Samples\Physics\TestBed\Android64\Debug\Box2D.Common.o: In function `Box2d::Common::b2BlockAllocator_Destroy(NativeUInt)':
Box2D.Common:(.text._ZN5Box2d6Common24b2BlockAllocator_DestroyE10NativeUInt[_ZN5Box2d6Common24b2BlockAllocator_DestroyE10NativeUInt]+0x0): undefined reference to `b2BlockAllocator_dtor'
etc...etc...
UPDATE4: Current status
I'm looking now for original libFlatBox2D.a library file for Android 64-bits (Delphi 10.3.3). If anyone has it, please share it with me.
The above attempts were not successful. An 'original' 64bits libFlatBox2D.a is required, which is not in my installation of RAD 10.3.3...
UPDATE5:
Embarcadero QA created a ticket:
https://quality.embarcadero.com/browse/RSP-27762
Will wait from their solution.
You have to create a new Package with name FlatBox2D, add all FlatBox units from ..\studio\20.0\source\FlatBox2D and compile it for Android64.
I have created the package and compiled both debug and release versions for Android64 with Delphi 10.3.3. In the link below you will find the new package files and the Android64 folder where you can find the libFlatBox2D.a for Debug and Release. Just copy the .a file to the corresponding folder in ..\studio\20.0\lib\Android64.
You can always compile the package on your own by just copying the FlatBox2D.dpr and FlatBox2D.dproj files in ..\studio\20.0\source\FlatBox2D, load the dpr in Delphi and compile it for Android64...
Stefanos
FlatBox2D.zip
I am wanting to debug and install my application on a physical clock.
First I tried to create the application in Xamarin.Android, I finished the application and it worked very well in an emulator, but when I tried to send to the device, the following error appeared:
ADB0010: Failure [INSTALL_FAILED_MISSING_SHARED_LIBRARY: Package couldn't be >installed in /data/app/AppXamarinWear.AppXamarinWear-1: Package >AppXamarinWear.AppXamarinWear requires unavailable shared library >com.google.android.wearable; failing!]
em Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String >output, String packageName) na >E:\A_work\1824\s\External\androidtools\Mono.AndroidTools\Internal\AdbOutputP>arsing.cs:linha 341
em Mono.AndroidTools.AndroidDevice.<>c__DisplayClass95_0.>>b__0(Task1 t) na >E:\A\_work\1824\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:li>nha 753
em System.Threading.Tasks.ContinuationTaskFromResultTask1.InnerInvoke()
em System.Threading.Tasks.Task.Execute() 0
Then I created an empty project in AndroidStudio, just created the project, did not change any line of code, and tried to run the application on the device, so I got the following error:
Installation failed with message Failed to commit install session 1131471407 >with command cmd package install-commit 1131471407. Error: >INSTALL_FAILED_MISSING_SHARED_LIBRARY: Package couldn't be installed in >/data/app/br.pinheiros.weardebug7-1: Package br.pinheiros.weardebug7 requires >unavailable shared library com.google.android.wearable; failing!.
It is possible that this issue is resolved by uninstalling an existing >version of the apk if it is present, and then re-installing.
I understood that the two solutions are bringing the same error, something with Google Api, I have already changed all the developer settings in Wear.
Model: Zeblaze Thor 4 Pro
I'am using Eclipse JUNO 4.2.2 for JAVA EE Developers with IBM Mobile First 6.3 Developer Edition.
I am also using Java 1.7 and the ADT plug-in in Eclipse.
My problem is when i try to visualize my App in the MobileFirt Console i have an error that says
Server error. Contact the server administrator.
And i have the following logs in my eclipse console:
[ERROR ] C:\Users\Aokiji\IBM%20Workspace\MobileFirstServerConfig\servers\worklight\workarea\org.eclipse.osgi\bundles\73\data\cache\com.ibm.ws.app.manager_108\.cache\WEB-INF\lib\ibm_web20_wink_no_abdera_no_jackson-1.1.0.0-20110422.jar (The system cannot find the path specified)
C:\Users\Aokiji\IBM%20Workspace\MobileFirstServerConfig\servers\worklight\workarea\org.eclipse.osgi\bundles\73\data\cache\com.ibm.ws.app.manager_108\.cache\WEB-INF\lib\ibm_web20_wink_no_abdera_no_jackson-1.1.0.0-20110422.jar (The system cannot find the path specified)
[ERROR ] C:\Users\Aokiji\IBM%20Workspace\MobileFirstServerConfig\servers\worklight\workarea\org.eclipse.osgi\bundles\73\data\cache\com.ibm.ws.app.manager_108\.cache\WEB-INF\lib\ibm_web20_wink_no_abdera_no_jackson-1.1.0.0-20110422.jar (The system cannot find the path specified)
C:\Users\Aokiji\IBM%20Workspace\MobileFirstServerConfig\servers\worklight\workarea\org.eclipse.osgi\bundles\73\data\cache\com.ibm.ws.app.manager_108\.cache\WEB-INF\lib\ibm_web20_wink_no_abdera_no_jackson-1.1.0.0-20110422.jar (The system cannot find the path specified)
[ERROR ] Uncaught.init.exception.thrown.by.servlet
ManagementServlet
WorklightServices
java.lang.NoClassDefFoundError: Could not initialize class org.apache.wink.common.internal.i18n.Messages
at org.apache.wink.server.internal.DeploymentConfiguration.initAlternateShortcutMap(DeploymentConfiguration.java:386)
at org.apache.wink.server.internal.DeploymentConfiguration.init(DeploymentConfiguration.java:167)
at org.apache.wink.server.internal.servlet.RestServlet.getDeploymentConfiguration(RestServlet.java:202)
at org.apache.wink.server.internal.servlet.RestServlet.createRequestProcessor(RestServlet.java:138)
at org.apache.wink.server.internal.servlet.RestServlet.init(RestServlet.java:103)
at javax.servlet.GenericServlet.init(GenericServlet.java:161)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:325)
at [internal classes]
at com.ibm.worklight.admin.services.RestFilter.doFilter(RestFilter.java:61)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:194)
at [internal classes]
at com.ibm.worklight.admin.common.filter.HSTSFilter.doFilter(HSTSFilter.java:110)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:194)
at [internal classes]
Whenever there are unexplained Mobilefirst Studio errors, such as yours, it is typically best to:
Create a new workspace
Import the project
Re-build
If it fails still you should install the latest 6.3 plugin. You can obtain it from the following location: https://mobilefirstplatform.ibmcloud.com/downloads/#past-releases
Unable to download the Fabric plugin on Android studio. I am able to download other plugins on the same network, so not an issue with the connectivity.
As an alternative, i tried manual installation of the plugin. But with manual installation, the plugin somehow does not launch (ends with an exception).
So I am back to this. Is anyone else facing this issue ?
P.S - I am on Android Studio 2.2.2
P.S - Below is the crash log when i install the plugin manually and restart Android Studio (Some part of the crash stack removed for brevity)
Plugin 'com.crashlytics.tools.androidstudio' failed to initialize and will be disabled. Please restart Android Studio.
java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of com/intellij/ide/plugins/cl/PluginClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of com/intellij/util/lang/UrlClassLoader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:299)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:269)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
at com.crashlytics.tools.bootstrap.osgi.OsgiBootstrapper.<clinit>(OsgiBootstrapper.java:54)
at com.crashlytics.tools.intellij.CrashlyticsPlugin.initComponent(CrashlyticsPlugin.java:89)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:522)
at
I am trying to integrate facebook using Plugin-x in cocos2d-x v3.5. I followed the following steps:
cd to MyProject/cocos2d/plugin/tools/
./publish.sh - on cygwin all the plugins get published one by one, for eg consider this Flurry trace
atarget dir is /Users/Shivam/Documents/Gautam/FinalWorkingApp/cocos2d/plugin/publish/plugins/flurry
android project dir is /Users/Shivam/Documents/Gautam/FinalWorkingApp/cocos2d/plugin/plugins/flurry/proj.android
Publish plugin for android
~/Documents/Gautam/FinalWorkingApp/cocos2d/plugin/plugins/flurry/proj.android ~/Documents/Gautam/FinalWorkingApp/cocos2d/plugin/tools ~/Documents/Gautam/FinalWorkingApp/cocos2d/plugin/tools
BUILD SUCCESSFUL
Total time: 0 seconds
BUILD FAILED
/Users/Shivam/Documents/Gautam/android-sdk-macosx/tools/ant/build.xml:542: Unable to resolve project target 'android-7'
Total time: 0 seconds
cp: /Users/Shivam/Documents/Gautam/FinalWorkingApp/cocos2d/plugin/plugins/flurry/proj.android/bin/*.jar: No such file or directory
~/Documents/Gautam/FinalWorkingApp/cocos2d/plugin/tools
~/Documents/Gautam/FinalWorkingApp/cocos2d/plugin/tools
All the plugins get published in the similar manner. I don't have android API 7, because of which it is failing, so can this be the reason my libpluginProtocol.jar is not getting generated?
I see a proper structure under under MyProject/cocos2d/plugin/publish/plugins
I also used gameDevGuide.sh and selected facebook.
Still I don't see libPluginProtocol.jar and libPluginFacebook.jar.
Please help. TIA
Ok so I found the answer. the library gets generated only when you have all the Android APIs viz, 7,8,10,17 and 19 apart from your own target APIs