jetpack compose multiplatform common dependencies not working - multiplatform

Hey I am trying to add a common dependency to work for both android and desktop but it doesn't work anywhere unless I put it directly in the android gradle file (then it works only for android).
gradle.properties
gradle common
gradle desktop
gradle android
MainActivity
commonMain ui
I tried to use any library in commonMain so I can build a ui for all platforms in one code, I expected any dependency that I put in commonMain to work in commonMain but none of them does it's like it totally ignores what I import

Related

React Native and using npm modules

So this is the case: we developed a web application. Now we are developing an app in React Native with Firebase, for iOS and Android... Is there a way to make use of the npm private module that we developed for the web application? Do we need to initialise firebase/app as well in typescript? Or is it really needed to develop a seperate module for android and a separate module for iOS?
So in this npm private module there are standardized ways for our company to get and set data in firestore.
Regards, Peter
As far as I understand it, every package from npm is mapped or linked to one in the respective operating system, that is Android and iOS in your case.
Is there a way to make use of the npm private module that we developed
for the web application?
Or is it really needed to develop a seperate module for android and a
separate module for iOS?
When there is no respective implementation for the operating system, that "translates" your npm package, it will not work.
Do we need to initialise firebase/app as well in typescript?
Yes indeed, also in react native you need to initialise firebase app.
So in this npm private module there are standardised ways for our
company to get and set data in firestore.
I cannot say why you did this in a custom way, if you use the "normal" firestore methods then maybe there is still a way to reuse some code? But that is hard to say from the outside.

I can't change my pom.xml in my CodeNameOne Project

AT the moment I'm trying to add the SDK Dependency from Firebase to my CodenameOne Project (pom.xml) but I cannot change that file because it is blocked. How can I add the Dependency to my Project?
We don't block adding dependencies but adding a Firebase dependency won't work since this isn't Android. Firebase is a native android dependency, it won't work on iOS etc.
You can add it in the native pom for Android and could probably use cocoapods for iOS support but this would require writing native code and probably not worth the hassle.

Issues embedding Firebase inside other framework

We have our own swift framework REFFramework that is using carthage to import Firebase (analytics and firestore). This is the cartfile in REFFramework:
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseFirestoreBinary.json"
The REFFramework is used in the app also using carthage to import it.
In addition the app itself also imports other modules from firebase (remote config).
This is the cartfile of the app:
git ".../REFFramework"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseAnalyticsBinary.json"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseFirestoreBinary.json"
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseRemoteConfigBinary.json"
As far as I know carthage is designed to fully support this kind of structure. We use other frameworks also embedded in REFFramework like this such as Alamofire.
However we notice a crash in the app that does not happen when we remove the Firebase out of the REFFramework.
So it's clearly todo with the embedding of Firebase in an intermediate Framework.
The crash is happening in "0 __pthread_kill", here is a screenshot of the debugger in xCode 10.3:
I see a remark in the documentation:
Note that the Firebase frameworks in the distribution include static libraries. While it is fine to link these into apps, it will generally not work to depend on them from wrapper dynamic frameworks.
Not sure if this is releated to this issue?
Yep, the Firebase Carthage frameworks include static libraries and can only be linked to other static library frameworks.

How to solve the problem with sqlite in cordova?

I'm moving the electron project to cordova. To work with sqlite I use NPM plugin sqlite-sync. In electron it worked perfectly. After porting the sources and installing the dependencies, I see an error when starting the project.
ERROR in ./node_modules/sql.js/js/sql.js
Module not found: Error: Can't resolve 'fs' in 'D:\PROJECTS\PRODUCTIONS\MOBILE\\node_modules\sql.js\js'
# ./node_modules/sql.js/js/sql.js 3:1275-1288 3:170484-170497
# ./node_modules/sqlite-sync/sqlite.js
# ./src/store/index.js
# ./src/main.js
# multi ./build/dev-client babel-polyfill ./src/main.js
how fix problem? win platform
Electron and Cordova are not the same, Electron implements the NodeJS API while Cordova uses its own API. If you want to use SqlLite in cordova you are going to have to rip out the parts that use NodeJS (if you see the word 'require' it is probably a node import -- in fact to make life easier on yourself use ES6 imports with WebPack or Browserify so that you know which code to rip out). You may be able to use a lot of node_modules with a modern build system but it is going to be a fair bit of work to move from Electron to Cordova. If you want to use SQLite, the SQLite Cordova Plugin is probably the easiest way to do this, but it is going to look a little different from the NodeJs Sqlite API.

Xamarin.Forms - Xamarin.Forms.Maps broken references in Droid Project

I need to implement Map functionality into an application that I'm building.
And I was folliwing this guide.
I downloaded the package and did all of the configuration.
I haven't implemented the Map class into my project yet, I only did the configuration required for both platforms (Android and iOS).
The Portable project and the iOS project are fine, the problem here is the Android project.
It has some broken references, these ones:
And when I try to compile the Android project, I get this error and these warnings:
Can anybody give me a hand? Thanks in advance.
EDIT:
As a sidenote, I'm using the Sdk installed by Android Studio, and that one has the latest Google Play Services installed.
UPDATE:
I just upgraded the version of my Xamarin.GooglePlayServices one by one (the one listed up there in the first image) for some reason it downloaded a really old version of those. So I just upgraded them, and it seems those references are fine now.
But I still get the error:
The "ResolveLibraryProjectImports" tasks failed unexpectedly.
SOLUTION:
I unloaded the Android project, added this:
<UseShortFileNames>True</UseShortFileNames>
To every property group in the .csproj file.
Load my android project back, and it all worked fine now.

Resources