How to add Facebook share capability to Gluon app - gluon

I've added the facebook-android-sdk to my build.gradle dependencies. When I start the login flow, I get the exception:
NoClassDefFoundError: Failed resolution of: Lcom/facebook/common/R$layout.
I guess this file is created when you build the app with Android Studio, but it doesn't work on Eclipse.
I imported the facebook-android-sdk git repository, and tried to reference it as project in my app project, which didn't work.
Is there a possibility to use Facebook-Login without having to use Gluon-CloudLink?

Related

Is it possible to use Material widgets with Compose for Web?

I tried adding the androidx.compose.material3 package to my default "Compose for Web" Intellij project using Gradle but it throws an error during build saying that Material3 requires an older version of androidx.compose.annotations (which I guess is imported as an dependency of androidx.compose.web). So I was wondering if that means that it still isn't possible to use Material widgets to build web applications using Kotlin+Compose (kinda like in Flutter)? If it is possible, how should my build.gradle.kt look like?
I've already tried using both the template from Intellij and the template on Compose's GitHub repo but they both throw build errors when importing Material3.

Modules, Gradle Subprojects, and IntelliJ Woes?

I am trying to make use of modules and gradle subprojects and either receive compile time errors or complaints from IntelliJ.
My project structure is as follows:
Root
- settings.gradle
- core
- build.gradle
- desktop
- build.gradle
- src/main/java/module-info.java
The desktop build.gradle file as a requirement on core as:
dependencies {
implementation project(":core")
}
There is no reference to the "core" project in the module-info.java files.
In this configuration, IntelliJ doesn't like usage of classes from the "core" project in the "desktop" project (I see a lot of red), but running gradlew.bat desktop:run works with no issues. Bug with IntelliJ? I am using microsoft's openjdk, but hopefully that doesn't matter.
My best attempt to fix this, was to add a module-info.java file to the core project as well and reference the core project in the desktop project's module-info.java file. Unfortunately this configuration, while making IntelliJ happy, renders me unable to run the desktop from command line anymore. I get errors about the core project being unable to find required modules that are the exact same as the required modules I pull in for the desktop module. I think this might be an error on my part, but I'm not sure how or what to do to fix it.
Would appreciate any insight.
P.S. Of these issues, I think I would prefer to get IntelliJ working with the first setup, because I intend to have this core library be shared between the desktop project and an android project, and while I haven't looked into it yet, I am not sure Android supports new java modules?
I think terminal should be the first priority. If your original setup made it compiled successfully under terminal, then there is no problem in your project. Do not add extra files for just making the IDE happy.
There's still something you can do. The first step is compiling your project successfully under terminal. This step downloads all the necessary dependencies before IntelliJ, reducing the problem scope to IntelliJ's linking and indexing. Then there are some options:
In the Gradle tool window, click the top-left button Refresh all Gradle projects.
Delete all the .idea folders in your project. Then open the root folder of your project via UI or CLI.
Click the invalidate caches/restart in the main menu.
You can also also create a new Gradle multi-module project with command gradle init, and open it with IntelliJ. It should be analyzed by IntelliJ normally. Then you can compare its project structure with yours. Maybe there's something different.
Hope these steps could help you.

How to import Android library module (AAR) using gradle cli

I am developing an Android Library module in AAR format. I found it very troublesome to have to be manually importing the module via Android Studio wizard each time I need to test library changes on an Android sample app. I changed my approach to using a symbolic link and linking the generated AAR on the library side with the AAR on the sample app side and just building and syncing Gradle via Android Studio.
However, this process is still not the best because I need to manually click buttons on Studio to achieve this. What I would like is to write a simple script using Gradle CLI and/or bash that allows me, from the app's side, to import the module into the app from some directory and sync the app's Gradle after importing.
Is this possible? Thanks.
You don't need to import your library module every time. Make your library as one of the modules and link the dependency between app and library.
Make sure the library is listed at the top of your settings.gradle file, as shown here for a library named "my-library-module":
include ':app', ':my-library-module'
Open the app module's build.gradle file and add a new line to the dependencies block as shown in the following snippet:
dependencies {
implementation project(":my-library-module")
}
And build using command lines.
gradlew assembleDebug
https://developer.android.com/studio/projects/android-library

Where to put the google-services.json file for Firebase in netbeans?

Can somebody help with where to put the google-services.json file I downloaded from Firebase? I'm using maven in netbeans? Or is there some other way of doing it without the file?
The only supported way to work with Firebase on Android is using the Gradle plugin, as described in the setup documentation. You can't build an app with Firebase using only maven, unless you do all the work that would be done by the plugin to properly inject the values from your google-services.json file into your app build, or skip that and initialize Firebase yourself.

Error - Configuration With name 'default' not found- React Native android importing projects for Android

I have two react native projects Project A on which I am working on. I had previously created another project for setting the orientation (also react native having java code to expose the orientation methods to javascript). I included the orientation project using npm install into Project A node modules. As per the documentation available added the following entries in settings.gradle of Proj A --
include ':orientation',':app'
project(':orientation').projectDir = new File(settingsDir, '../node_modules/react-native-my-orientation/android/')
And then added compile project(':orientation') in build.gradle available within the app folder. When the compiles i keep getting the error Configuration With name 'default' not found.
Has anyone faced such a problem in including an external project to a react-native android project.
I just solved this issue. Sometimes when you install RN packages with npm, or more specifically uninstall them, code is leftover in the Android files. You can manually delete this packages in the app/build.gradle file also the settings.gradle file and that works for me.

Resources