Correct Android config for capacitor v3?
See original GitHub issueThe docs for this plugin mention that we should be adding this plugin to MainActivity.java. However, the capacitor v3 docs say that most plugins don’t need to be imported this way, instead they’re automatically imported.
https://capacitorjs.com/docs/updating/3-0#switch-to-automatic-android-plugin-loading
Do we need this code block anymore?
import com.getcapacitor.community.firebaseanalytics.FirebaseAnalytics;
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
// Ex: add(TotallyAwesomePlugin.class);
add(FirebaseAnalytics.class);
}
}
);
}
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Configuring Android | Capacitor Documentation
This article covers the basic modifications you'll need to make to your app. Read the Android Manifest docs to learn a whole lot...
Read more >How to AUTOMATICALLY configure your Capacitor project ⚡️
We take an early look at the new Capacitor configuration tool called Capacitor configure which allows us to directly change native ...
Read more >Ionic Capacitor Sync Command
Sync (copy + update) an Android or iOS device project with Ionic Capacitor Sync. Read our documentation to learn more about this command...
Read more >Capacitor versions - Quasar Framework
Upgrading Capacitor · Delete the /src-capacitor/ios and /src-capacitor/android folders, but make sure that you are aware of any changes that you made in...
Read more >Ionic + Capacitor 3 + Android shows distorted splash image ...
@capacitor/splash-screen: 0.3.6; @ionic/angular: 5.6.3. The following configuration is used: const config: CapacitorConfig = ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
If you use capacitor v3 you should change this.init(); to registerPlugin(FirebaseAnalytics.class);
Updated docs - because of the Capacitor 3’s automatic Android plugin loading, you no longer need to edit
MainActivity.java
when adding or removing files via NPM.