Pro Tips for Installing Bugbattle SDKs

Thursday, 26 November 2020

As you might know, installing Bugbattle is pretty easy and there is an awesome documentation with step-by-step guidance on how to install Bugbattle to your platform. So why am I even writing a blog post on this topic? Because we as developers know, things can go wrong. So let’s have a look at the most common mistakes developers make while installing Bugbattle.

If we take the Flutter SDK for example, there are three simple steps to add Bugbattle to your app.

1.) Add bugbattle to your dependencies:

dependencies:

bugbattle_sdk: ^3.0.2

2.) Navigate to your IOS project folder within the terminal and run

pod install

Maybe there goes your first “ohh nooooo” moment because an error occurred which probably looks a bit like this:

Specs satisfying the ‘BugBattle’ dependency were found, but they require a higher minimum deployment target.

What is the minimum deployment target?

The deployment target is a minimum version of iOS which is supported by your target.

And what does the Bugbattle SDK have to do with my minimum deployment target?

Our Bugbattle SDKs also include such minimum deployment targets and you have to adjust your deployment target to the Bugbattle one. Otherwise Bugbattle will not work on your application. The current minimum deployment target of Bugbattle is 9.0. To double-check and constantly be up to date, always have a look at our official docs.

Now that we’ve identified the problem let’s solve it. Navigate to your iOS project folder and open the Podfile. At the top of your file you should see a platform definition such as platform: ios, ‘8.0’. Change the deployment target to 9.0. If you don’t see a deployment target, please add the following line: platform: ios, ‘9.0’. Now run pod install again and the error should be fixed.

3.) Initialize the Bugbattle SDK

Import the Bugbattle SDK by adding the following import inside one of your root components.

Import ‘package:BugbattleSDK/BugbattleSDK.dart;
BugBattle.initialize(‘YOUR_API_KEY’, ActivationMethod.SHAKE);

You can find your API key in the project settings in the Bugbattle app. Possible values for the activation method are Bugbattle.NONE, Bugbattle.THREE_FINGER_DOUBLE_TAB and Bugbattle.SHAKE.

Now you can run your app using Bugbattle.

Wait, maybe we forgot something. When you try to run your app on an Android device there is a chance that an error like this might occur:

Minifest merger failed:
uses-sdk:minSdkVersion 16 cannot be smaller than version 21

Now, doesn’t this error look familiar to you? It is the same problem as with the iOS minimum deployment target only that it is called minSdkVersion in Android. So let’s go fix the same problem only in Android. Navigate to your Android project folder and open the build.gradle file. In this file you can find a property called minSdkVersion. Change the minSdkVersion to 21 which is the current minSdkVersion of Bugbattle.

Now rebuild your build.gradle and your Android app should run without any errors.

Happy bug battling!

Get Started for Free

Join the future of bug reporting in less than 60 seconds. Try our full feature set for 14 days. No credit card required. 

Tobias Duelli

Tobias Duelli

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on whatsapp
WhatsApp

Keep Reading

Accelerate your bug reporting process

You are only one click away from saving time and sparing your nerves while debugging.

Coming
Soon.

BugBattle will change your bug reporting experience forever. Be the first to know when we launch.