[英]Capacitor Plugins don't work on Android version
Hello i am trying to build my capacitor 3 project.您好,我正在尝试构建我的电容器 3 项目。 It works on iOS just fine but in Android version i am getting errors for all the plugins i am using (like the one on image -Google Sign in) except from the 2 i am declaring on MainActivity.java (FACEBOOK AND FCM).它在 iOS 上工作得很好,但在 Android 版本中,我正在使用的所有插件(如图像上的插件 - Google 登录)都出现错误,除了我在 MainActivity.java(FACEBOOK 和 FCM)上声明的 2。
MainActivity.java MainActivity.java
package com.myproject.mobile;
import android.os.Bundle;
import com.getcapacitor.BridgeActivity;
import com.getcapacitor.Plugin;
import com.getcapacitor.community.fcm.FCMPlugin;
import java.util.ArrayList;
public class MainActivity extends BridgeActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Initializes the Bridge
this.init(savedInstanceState, new ArrayList<Class<? extends Plugin>>() {{
// Additional plugins you've installed go here
**add(com.getcapacitor.community.facebooklogin.FacebookLogin.class);
add(com.getcapacitor.community.fcm.FCMPlugin.class);**
}});
}
}
I am getting a problem report on Visual Studio我收到有关 Visual Studio 的问题报告
"message": "MainActivity.java is not on the classpath of project app, only syntax errors are reported",
Do i have to declare all the plugins on MainActivity.java?我是否必须在 MainActivity.java 上声明所有插件? It seems kind of off that's why i am asking.这似乎有点不对劲,这就是我问的原因。
Plus, the splashscreen jpg works but i am getting the capacitor icon as an app icon.另外,启动画面 jpg 有效,但我将电容器图标作为应用程序图标。
Any hint?有什么提示吗?
Try to migrate to Capacitor version 4: Here's the official guide尝试迁移到 Capacitor 版本 4:这是官方指南
I was working on google sign-in for so long with capacitor when one day, all of sudden, got multiple errors on Android. What I did notice is that capacitor was just been updated to version 4 and some Android variables needed to change.有一天,我在 Android 上突然遇到了多个错误,我一直在使用电容器进行谷歌登录。我注意到电容器刚刚更新到版本 4,一些 Android 变量需要更改。 After I did the upgrade, those error went away.升级后,这些错误消失了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.