Skip to content

Branch Init Fails for unknown reason #1240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
gabidev89 opened this issue Jan 13, 2025 · 6 comments
Open

Branch Init Fails for unknown reason #1240

gabidev89 opened this issue Jan 13, 2025 · 6 comments

Comments

@gabidev89
Copy link

gabidev89 commented Jan 13, 2025

Describe the bug

After app start, init was called, listener inited and then the app throws the following error:
Screenshot 2025-01-14 at 0 00 05
After this, app stops delivering deeplink data

Steps to reproduce

  1. Impliment Android by the configuration steps
    2.Run App
    3.Get Branch init failed -120, Task timeout

Expected behavior

Init running and app delivering deeplink data

SDK Version

5.15.0

Make and Model

Pixel 6a , Samsung s24 and more

OS

Android 15

Additional Information/Context

also logcat shows the following, that might be related (the app has no other issues):
E/TRuntime.CctTransportBackend( 2190): Couldn't encode request, returning with 400
E/TRuntime.CctTransportBackend( 2190): javax.net.ssl.SSLHandshakeException: connection closed
E/TRuntime.CctTransportBackend( 2190): at com.android.org.conscrypt.SSLUtils.toSSLHandshakeException(SSLUtils.java:358)

@gabidev89
Copy link
Author

D/FlutterBranchSDK(17786): triggered onAttachedToEngine
D/FlutterBranchSDK(17786): triggered setupChannels
D/FlutterBranchSDK(17786): SDK Init
D/FlutterBranchSDK(17786): triggered onAttachedToActivity
D/FlutterBranchSDK(17786): triggered setActivity
D/FlutterBranchSDK(17786): triggered onActivityStarted: ...
D/FlutterBranchSDK(17786): triggered SessionBuilder init
D/FlutterBranchSDK(17786): triggered onActivityResumed: ...

D/FlutterBranchSDK(17786): triggered setupBranch
I/BranchSDK(17786): !SDK-VERSION-STRING!:io.branch.sdk.android:library:5.15.0
V/BranchSDK(17786): disableTracking context: android.app.Application@16e319e disableTracking: false callback: null
V/BranchSDK(17786): Set Consumer Protection Preference to FULL
D/FlutterBranchSDK(17786): notifyNativeToInit()
V/BranchSDK(17786): notifyNativeToInit deferredSessionBuilder io.branch.referral.Branch$InitSessionBuilder@ae6b15c
V/BranchSDK(17786): Beginning session initialization
V/BranchSDK(17786): Session uri is null
V/BranchSDK(17786): Callback is br.com.rsmarques.flutter_branch_sdk.FlutterBranchSdkPlugin$1@1c713cf
V/BranchSDK(17786): Is auto init false
V/BranchSDK(17786): Will ignore intent null
V/BranchSDK(17786): Is reinitializing false
V/BranchSDK(17786): isInstantDeepLinkPossible false
V/BranchSDK(17786): ServerRequest constructor
V/BranchSDK(17786): setPost {}
D/BranchSDK(17786): Creating io.branch.referral.ServerRequestRegisterInstall@ec5b417 from init on thread main
V/BranchSDK(17786): initializeSession io.branch.referral.ServerRequestRegisterInstall@ec5b417 delay 0
V/BranchSDK(17786): Intent: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x30000000 cmp=/.MainActivity (has extras) } forceBranchSession: false initState: UNINITIALISED
V/BranchSDK(17786): registerAppInit io.branch.referral.ServerRequestRegisterInstall@ec5b417
V/BranchSDK(17786): Ordering init calls
V/BranchSDK(17786): Queue is:
V/BranchSDK(17786): Moving io.branch.referral.ServerRequestRegisterInstall@ec5b417 to front of the queue or behind network-in-progress request
V/BranchSDK(17786): Finished ordering init calls
V/BranchSDK(17786): Queue is: io.branch.referral.ServerRequestRegisterInstall@ec5b417 with locks []
V/BranchSDK(17786): initTasks io.branch.referral.ServerRequestRegisterInstall@ec5b417
V/BranchSDK(17786): Added INSTALL_REFERRER_FETCH_WAIT_LOCK
V/BranchSDK(17786): Begin fetchInstallReferrer
V/BranchSDK(17786): Added GAID_FETCH_WAIT_LOCK
V/BranchSDK(17786): Begin fetchGoogleAdId
V/BranchSDK(17786): processNextQueueItem registerAppInit
V/BranchSDK(17786): Queue is: io.branch.referral.ServerRequestRegisterInstall@ec5b417 with locks [INSTALL_REFERRER_FETCH_WAIT_LOCK, GAID_FETCH_WAIT_LOCK]
D/BranchSDK(17786): processNextQueueItem, req io.branch.referral.ServerRequestRegisterInstall@ec5b417
D/BranchSDK(17786): No Facebook App ID provided. Can't check for Meta Install Referrer
W/BranchSDK(17786): Caught getSamsungGalaxyStoreReferrerDetails onInstallReferrerSetupFinished response code: 2
D/AdvertisingIdClient(17786): AdvertisingIdClient already created.
W/BranchSDK(17786): Caught getSamsungGalaxyStoreReferrerDetails response code: 2
V/BranchSDK(17786): Could not find com.huawei.hms.ads.installreferrer.api.InstallReferrerClient. If expected, import the dependency into your app.
V/BranchSDK(17786): Could not find com.miui.referrer.api.GetAppsReferrerClient. If expected, import the dependency into your app.
V/BranchSDK(17786): processNextQueueItem onAdsParamsFetchFinished
V/BranchSDK(17786): Queue is: io.branch.referral.ServerRequestRegisterInstall@ec5b417 with locks [INSTALL_REFERRER_FETCH_WAIT_LOCK]
D/BranchSDK(17786): processNextQueueItem, req io.branch.referral.ServerRequestRegisterInstall@ec5b417
D/FlutterBranchSDK(17786): triggered onAttachedToEngine
D/FlutterBranchSDK(17786): triggered setupChannels
D/FlutterBranchSDK(17786): SDK Init
W/BranchSDK(17786): Caught getGooglePlayStoreReferrerDetails onInstallReferrerSetupFinished response code: 0
V/BranchSDK(17786): All Install Referrers: [InstallReferrerResult(appStore=PlayStore, latestInstallTimestamp=1736808262, latestRawReferrer=utm_source=google-play&utm_medium=organic, latestClickTimestamp=0, isClickThrough=true), null, null, null, null]
V/BranchSDK(17786): Latest Install Referrer: InstallReferrerResult(appStore=PlayStore, latestInstallTimestamp=1736808262, latestRawReferrer=utm_source=google-play&utm_medium=organic, latestClickTimestamp=0, isClickThrough=true)
V/BranchSDK(17786): fetchInstallReferrer resumeWith got result: InstallReferrerResult(appStore=PlayStore, latestInstallTimestamp=1736808262, latestRawReferrer=utm_source=google-play&utm_medium=organic, latestClickTimestamp=0, isClickThrough=true)
V/BranchSDK(17786): INSTALL_REFERRER_FETCH_WAIT_LOCK removed
V/BranchSDK(17786): processNextQueueItem onInstallReferrersFinished
V/BranchSDK(17786): Queue is: io.branch.referral.ServerRequestRegisterInstall@ec5b417 with locks []
D/BranchSDK(17786): processNextQueueItem, req io.branch.referral.ServerRequestRegisterInstall@ec5b417
V/BranchSDK(17786): executeTimedBranchPostTask io.branch.referral.ServerRequestRegisterInstall@ec5b417
V/BranchSDK(17786): callback to be returned br.com.rsmarques.flutter_branch_sdk.FlutterBranchSdkPlugin$1@1c713cf
V/BranchSDK(17786): onPreExecute io.branch.referral.ServerRequestRegisterInstall@ec5b417
V/BranchSDK(17786): doFinalUpdateOnMainThread
V/BranchSDK(17786): doFinalUpdateOnBackgroundThread
V/BranchSDK(17786): Beginning rest post for io.branch.referral.ServerRequestRegisterInstall@ec5b417
V/BranchSDK(17786): posting to https://api2.branch.io/v1/install
...
D/FlutterBranchSDK(17786): triggered getLatestReferringParams
D/FlutterBranchSDK(17786): triggered onListen
V/BranchSDK(17786): onPostExecuteInner io.branch.referral.ServerRequestQueue$BranchPostTask@935b0bc io.branch.referral.ServerResponse@51db845
V/BranchSDK(17786): onRequestFailed
D/FlutterBranchSDK(17786): triggered onInitFinished
D/FlutterBranchSDK(17786): BranchReferralInitListener - error: Trouble initializing Branch. Task exceeded timeout.
V/BranchSDK(17786): processNextQueueItem onPostExecuteInner
V/BranchSDK(17786): Queue is:

Can't figure out why does V/BranchSDK(17786): onRequestFailed

@gabidev89
Copy link
Author

E/BranchSDK(17786): Branch Networking Error:
E/BranchSDK(17786): URL: https://api2.branch.io/v1/install
E/BranchSDK(17786): Response Code: -1
E/BranchSDK(17786): Response Message:
E/BranchSDK(17786): Caught exception type: java.net.SocketTimeoutException
E/BranchSDK(17786): Retry number: 2
E/BranchSDK(17786): requestId:
E/BranchSDK(17786): Final attempt: false
E/BranchSDK(17786): Object: io.branch.referral.network.BranchRemoteInterfaceUrlConnection@c5aa887
E/BranchSDK(17786): Exception Message: Read timed out
E/BranchSDK(17786): Stacktrace: java.net.SocketTimeoutException: Read timed out
E/BranchSDK(17786): at java.net.SocketInputStream.socketRead0(Native Method)
E/BranchSDK(17786): at java.net.SocketInputStream.socketRead(SocketInputStream.java:118)
E/BranchSDK(17786): at java.net.SocketInputStream.read(SocketInputStream.java:173)
E/BranchSDK(17786): at java.net.SocketInputStream.read(SocketInputStream.java:143)
E/BranchSDK(17786): at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.readFromSocket(ConscryptEngineSocket.java:985)
E/BranchSDK(17786): at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.processDataFromSocket(ConscryptEngineSocket.java:949)
E/BranchSDK(17786): at com.android.org.conscrypt.ConscryptEngineSocket$SSLInputStream.-$$Nest$mprocessDataFromSocket(Unknown Source:0)
E/BranchSDK(17786): at com.android.org.conscrypt.ConscryptEngineSocket.doHandshake(ConscryptEngineSocket.java:238)
E/BranchSDK(17786): at com.android.org.conscrypt.ConscryptEngineSocket.startHandshake(ConscryptEngineSocket.java:220)
E/BranchSDK(17786): at com.android.okhttp.internal.io.RealConnection.connectTls(RealConnection.java:196)
E/BranchSDK(17786): at com.android.okhttp.internal.io.RealConnection.connectSocket(RealConnection.java:153)
E/BranchSDK(17786): at com.android.okhttp.internal.io.RealConnection.connect(RealConnection.java:116)
E/BranchSDK(17786): at com.android.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:186)
E/BranchSDK(17786): at com.android.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:128)
E/BranchSDK(17786): at com.android.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:97)
E/BranchSDK(17786): at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:289)
E/BranchSDK(17786): at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:232)
E/BranchSDK(17786): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:465)
E/BranchSDK(17786): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:131)
E/BranchSDK(17786): at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:262)
E/BranchSDK(17786): at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:219)
E/BranchSDK(17786): at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:30)
E/BranchSDK(17786): at io.branch.referral.network.BranchRemoteInterfaceUrlConnection.doRestfulPost(BranchRemoteInterfaceUrlConnection.java:201)
E/BranchSDK(17786): at io.branch.referral.network.BranchRemoteInterfaceUrlConnection.doRestfulPost(BranchRemoteInterfaceUrlConnection.java:280)
E/BranchSDK(17786): at io.branch.referral.network.BranchRemoteInterfaceUrlConnection.doRestfulPost(BranchRemoteInterfaceUrlConnection.java:280)
E/BranchSDK(17786): at io.branch.referral.network.BranchRemoteInterfaceUrlConnection.doRestfulPost(BranchRemoteInterfaceUrlConnection.java:67)
E/BranchSDK(17786): at io.branch.referral.network.BranchRemoteInterface.make_restful_post(BranchRemoteInterface.java:137)
E/BranchSDK(17786): at io.branch.referral.ServerRequestQueue$BranchPostTask.doInBackground(ServerRequestQueue.java:525)
E/BranchSDK(17786): at io.branch.referral.ServerRequestQueue$BranchPostTask.doInBackground(ServerRequestQueue.java:495)
E/BranchSDK(17786): at android.os.AsyncTask$3.call(AsyncTask.java:394)
E/BranchSDK(17786): at java.util.concurrent.FutureTask.run(FutureTask.java:264)
E/BranchSDK(17786): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
E/BranchSDK(17786): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
E/BranchSDK(17786): at java.lang.Thread.run(Thread.java:1012)

@robertevans1
Copy link

Also getting this same error

@gabidev89
Copy link
Author

Also getting this same error

VPN , firewall and adblockers are blocking branch due to their attempt to track the user, this causes a break preventing from proper init of the whole sdk for some reason , they don't handle it very well.. no tracking no service kind of policy..

@robertevans1
Copy link

Did you find a solution @gabidev89 ?

@gabidev89
Copy link
Author

gabidev89 commented Mar 27, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants