Yahavw
Yahavw

Reputation: 129

Error-Branch IO : Trouble initializing Branch. Unable to reach the Branch servers, please try again shortly

I am trying to use Branch IO Android SDK, by referencing the branch documentation I created a simple blank application and implemented the onStart() method in the Main Activity:

@Override
public void onStart() {
    super.onStart();
    Branch branch = Branch.getInstance();

    branch.initSession(new Branch.BranchReferralInitListener() {
        @Override
        public void onInitFinished(JSONObject referringParams, BranchError error) {
            if (error == null) {
                // params are the deep linked params associated with the link that the user clicked before showing up
                Log.i("BranchConfigTest", "deep link data: " + referringParams.toString());
            } else {
                Log.e("MyApp", error.getMessage());
            }
        }
    }, this.getIntent().getData(), this);
}

After the application has been opened by the branch link, I received this error on the Android Logcat:

E/MyApp: Trouble initializing Branch. Unable to reach the Branch servers, please try again shortly.

I/Adreno-EGL: : EGL 1.4 QUALCOMM build: Nondeterministic_AU_msm8974_LA.BF.1.1.1.C3__release_AU () OpenGL ES Shader Compiler Version: E031.25.03.06 Build Date: 04/27/15 Mon Local Branch: mybranch9445032 Remote Branch: quic/LA.BF.1.1.1.c3_1 Local Patches: NONE Reconstruct Branch: NOTHING

Upvotes: 3

Views: 4584

Answers (2)

Abvishek kumar
Abvishek kumar

Reputation: 41

Here are some troubleshooting tips related to the issue you're facing:

Ensure that your app has the INTERNET permission: Verify this in your AndroidManifest.xml file.

Confirm that no ad blockers are active: Certain ad blockers may interfere with the Branch SDK. For example, in my case with a Redmi phone, the issue was resolved by disabling the private DNS.

Verify the correctness of your Branch key: Retrieve your Branch key from the Branch dashboard.

Upvotes: 0

Alex Bauer
Alex Bauer

Reputation: 13613

Alex from Branch here: we usually see this error if your app doesn't have the INTERNET permission configured (see here for more on the Android developer portal).

Try setting <uses-permission android:name="android.permission.INTERNET" /> in your AndroidManifest.xml and this error should clear up. See here for how it's set up in our demo app.

Upvotes: 2

Related Questions