zadam / trilium-sender

Simple android application for sending images and notes to Trilium
GNU General Public License v3.0
80 stars 31 forks source link

Network error during setup of v0.3 app #25

Open GravityCore opened 9 months ago

GravityCore commented 9 months ago

Can't setup the v0.3 of the app using http://[my_ip]:[my_port] because of a network error.

It should have been fixed in v0.3 by #18, but the error still persists. Using Android 14.

Noticed on the app info screen of the v0.3 app that the version is still 0.2: v03 shows as v02

Redacted following mentions of IP address, port number, user UID/GID and data path for security reasons.

Error from the logcat log:

2024-01-28 14:19:10.978 27668 27786 io.github.zadam.triliumsender E UserLoginCoroutine : Can't connect to Trilium server
java.net.UnknownServiceException: CLEARTEXT communication to [my_ip] not permitted by network security policy
    at okhttp3.internal.connection.RealConnection.connect(RealConnection.kt:188)
    at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:226)
    at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:106)
    at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:74)
    at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.kt:255)
    at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:32)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
    at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:95)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
    at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:83)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:76)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:109)
    at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:201)
    at okhttp3.internal.connection.RealCall.execute(RealCall.kt:154)
    at io.github.zadam.triliumsender.LoginActivity$doLogin$2.invokeSuspend(LoginActivity.kt:173)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

My docker compose:

version: '2.1'
services:
  trilium:
    image: zadam/trilium:0.62.6
    restart: always
    environment:
      - TRILIUM_DATA_DIR=/home/node/trilium-data
      - USER_UID=[my_UID]
      - USER_GID=[my_GID]
    ports:
      - "[my_port]:8080"
    volumes:
      - [my_path]:/home/node/trilium-data
HighFlip commented 8 months ago

When I downloaded the apk from https://github.com/zadam/trilium-sender/releases/download/v0.3/trilium-sender-0.3.apk, it showed me the same thing as you on my Android system: version 0.2 and not 0.3, as well as had the same CLEARTEXT communication issue.

I tried building the apk file from the source code instead and it worked for me.