We are use Xamarin forms local notifications on our app. with the below line in the code it causes the app the crash
UNUserNotificationCenter.Current.RemovePendingNotificationRequests(requests);
even tho the line should only be run on iOS devices. this is done with the following;
`
if (Device.RuntimePlatform == "Android")
{
}
else
{
UNUserNotificationCenter.Current.RemovePendingNotificationRequests(requests);
}
`
the below error is given with the UNUserNotificationsCenter in the code
System.IO.FileNotFoundException: Could not load file or assembly 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' or one of its dependencies.
anyone any ideas??
We have tried completely reimplementing the local notifications, clean and clearing bin/obj. updated both machine and vs to the latest version, updated frameworks.
built on VS Mac 2022 17.3.6
android framework 13.0.0.0
Related
Hellow.
I have a trouble with template KMM application. It got an error after I created new KMM application - in shared IOS app module it cannot find package platform. It's on kotlin. Adroid app works well.
Need to say, that I works on window by Android studio. I know there are troubles to start IOS app on window, but I do not want to start or build app - I want to just it find the reference platform.
I tried to find some dicisions. There are the same questions, but nobody can answer them.
Code with trouble:
import platform.UIKit.UIDevice // here there is the error
actual class Platform actual constructor() {
actual val platform: String = UIDevice.currentDevice.systemName() + " " + UIDevice.currentDevice.systemVersion
}
This question is a bit strange: how do you think iOS application will compile and work on a Windows computer?
To make KMM work on both OS you need a Mac. This is the reason why you are not able to find "platform.UIKit.UIDevice" on your machine.
I'm running a React Native app which has a local Node project as a dependency, managed through yalc. I'm using rn-nodeify to deal with the Node libraries.
Whenever I try using one of the methods/constants from my Node project, I get the above error during react-native start after the app is built (I'm using Intellij's default "Android" configuration to run RN and have an emulator in Android Studio).
I looked up the error message and people say it's related to supports-color, but neither of my projects use that library and installing it didn't fix it either.
Edit:
I'm not sure if this could be related, but I also have to add the lines
import { Buffer } from 'buffer';
import 'reflect-metadata';
global.Buffer = global.Buffer || Buffer
When I use this file from my Node project or I get errors regarding Reflect.hasOwnMetadata and Buffer
We have a project using Tipsi Stripe React module, when trying to build for Android I get the following error message: Native Module StripeModule tried to override StripeModule for module name StripeModule.
The error message does not make sense to me and I don't really know where to begin looking since i'm fairly new to mobile and React Native development.
Building for iOS works fine.
I have the same problem, i've tried adding
#Override
public boolean canOverrideExistingModule() {
return true;
}
to: /tipsi-stripe/android/src/main/java/com/gettipsi/stripe/StripeModule.java based on what i found here How to set canOverrideExistingModule=true.
It compiles, but I haven't tested if it keeps working, if it works i'll fork tipsi-stripe and create a PR later
When building a project I get the following error:
Flavor 'nativescript-telerik-ui' has unknown dimension 'nativescript-telerik-ui'.
It happens only when using the pro version through the #progress registry. Doesn't happen with the local .tgz pro version.
I noticed the error has to do with the include.gradle file it generates. I read the following article: https://docs.nativescript.org/plugins/plugins#includegradle-specification
It says that when the plugin doesn't have the include.gradle, at build time gradle creates a default one with default elements. When I saw the include.gradle it generated for the plugin it seems to have generated a default one like so:
android {
productFlavors {
"nativescript-telerik-ui" {
dimension "nativescript-telerik-ui"
}
}
}
The include.gradle generated for the local .tgz version of the plugin is like this:
android {
productFlavors {
"F6" {
dimension "nativescripttelerikuipro"
}
}
}
I replaced the default include.gradle with the latter and it got past the error. You can recreate the problem by following these steps:
create a new hello world app
use the command npm login --registry=https://registry.npm.telerik.com/ --scope=#progress to log in if you're a paying customer.
use the command npm install --save #progress/nativescript-telerik-ui-pro to install the plugin
use tns run android
Is there anything I can do to solve this problem? Really need help on this.
My name is Vladimir and I am part of the nativescript-telerik-ui-pro team. Thank you for logging this issue in our feedback portal. We are going to review it as soon as possible and update you regarding its status, but from what I currently see there is some incorrect "parameters" passed to the 'pro' version of the plugin that are going to be resolved very fast.
We apologize for any inconvenience that this is causing.
First of all, thank you for your help.
Here is my problem.
I have made a custom system service (it does connect through the binder, and hooks into the system server, then into the HAL, etc). One of the main commands is isBacklightOn(). I also ran the make update-api to include it in my ROM build.
I am now ready to test the functionality using an app. I am using the following code:
import android.os.BacklightManager; //My service manager name
...
BacklightManager bm = (BacklightManager) getSystemService(BACKLIGHT_SERVICE);
...
if(!bm.isBacklightOn()) {
//Turn it on.
} else {
//Other Things...
}
My problem occurs because Android Studio will not build the application due to not knowing what the BacklightManager is. How can I build this application to test my code? (import something into Android Manager, force a build ignoring errors, etc.)
It looks like the solution is to build a custom SDK within the AOSP build environment. And then import that into Android Studio