У меня следующая проблема: я пишу приложение которое будет принимать и посылать уведомления с помощью Pushover, и делаю все по инструкции с официального сайта, однако все равно получаю ошибку: https://github.com/sps/pushover4j
вот список всех моих зависимостей:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
//RecyclerView
implementation 'androidx.recyclerview:recyclerview:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
//Pushover
implementation 'com.github.sps.pushover.net:pushover-client:1.0.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'org.apache.httpcomponents:httpcore:4.4.1'
implementation 'org.apache.httpcomponents:httpclient:4.5.10'
}
configurations {
all {
exclude module: 'httpclient'
}
}
но я всё равно получаю ошибку когда отправляю уведомление
Process: com.example.testnotifications, PID: 17659
java.lang.NoSuchMethodError: org.apache.http.client.entity.UrlEncodedFormEntity.<init>
at net.pushover.client.PushoverRestClient.pushMessage(PushoverRestClient.java:61)
at com.example.testnotifications.ui.NotificationActivity.sendNotification(NotificationActivity.kt:110)
at com.example.testnotifications.ui.NotificationActivity.insertNewNotification(NotificationActivity.kt:103)
at com.example.testnotifications.ui.NotificationActivity.onClick(NotificationActivity.kt:216)
Ошибка случается в этом методе:
client.pushMessage(
PushoverMessage.builderWithApiToken("adi4551cxnddnrxtfh63h9i4cf7n1h")
.setUserId("unq2h3mu8d8joryzs8c9d4migt4y79")
.setMessage("testing!")
.build()
)
Зараннее спасибо за любую помощь, сразу оговорюсь, что мне нужно использовать именно pushover, т.к. это тестовое задание