rubenlagus / TelegramBots

Java library to create bots using Telegram Bots API
https://telegram.me/JavaBotsApi
MIT License
4.77k stars 1.22k forks source link

Error while build APK #1252

Closed ketela7 closed 7 months ago

ketela7 commented 1 year ago

using implementation 'org.telegram:telegrambots:6.7.0'

Task :app:compileReleaseJavaWithJavac FAILED /storage/emulated/0/z_termux/v3/app/src/main/java/com/notification/MainService.java:36: error: cannot find symbol import org.telegram.telegrambots.ApiContextInitializer; ^ symbol: class ApiContextInitializer location: package org.telegram.telegrambots /storage/emulated/0/z_termux/v3/app/src/main/java/com/notification/MainService.java:37: error: cannot find symbol import org.telegram.telegrambots.TelegramBotsApi; ^ symbol: class TelegramBotsApi location: package org.telegram.telegrambots /storage/emulated/0/z_termux/v3/app/src/main/java/com/notification/MainService.java:38: error: package org.telegram.telegrambots.exceptions does not exist import org.telegram.telegrambots.exceptions.TelegramApiException; ^ /storage/emulated/0/z_termux/v3/app/src/main/java/bot/telegram/Bot.java:3: error: package org.telegram.telegrambots.api.methods.send does not exist import org.telegram.telegrambots.api.methods.send.SendMessage; ^ /storage/emulated/0/z_termux/v3/app/src/main/java/bot/telegram/Bot.java:4: error: package org.telegram.telegrambots.api.objects does not exist import org.telegram.telegrambots.api.objects.Update; ^ /storage/emulated/0/z_termux/v3/app/src/main/java/bot/telegram/Bot.java:6: error: package org.telegram.telegrambots.exceptions does not exist import org.telegram.telegrambots.exceptions.TelegramApiException; ^ /storage/emulated/0/z_termux/v3/app/src/main/java/bot/telegram/Bot.java:13: error: cannot find symbol public void onUpdateReceived(Update update) { ^ symbol: class Update location: class Bot /storage/emulated/0/z_termux/v3/app/src/main/java/bot/telegram/Bot.java:16: error: cannot find symbol Message message = update.getMessage(); ^ symbol: class Message location: class Bot /storage/emulated/0/z_termux/v3/app/src/main/java/bot/telegram/Bot.java:26: error: cannot find symbol SendMessage sendMessage = new SendMessage(); ^ symbol: class SendMessage location: class Bot /storage/emulated/0/z_termux/v3/app/src/main/java/bot/telegram/Bot.java:26: error: cannot find symbol SendMessage sendMessage = new SendMessage(); ^ symbol: class SendMessage location: class Bot /storage/emulated/0/z_termux/v3/app/src/main/java/bot/telegram/Bot.java:30: error: cannot find symbol sendMessage.setParseMode(ParseMode.HTML); ^ symbol: variable ParseMode location: class Bot /storage/emulated/0/z_termux/v3/app/src/main/java/bot/telegram/Bot.java:34: error: cannot find symbol } catch(TelegramApiException e) { ^ symbol: class TelegramApiException location: class Bot Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /storage/emulated/0/z_termux/v3/app/src/main/java/com/notification/RequestUtil.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 12 errors

FAILURE: Build failed with an exception.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.4.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 4s

centralhardware commented 1 year ago

this library doesn't support android

rubenlagus commented 7 months ago

You can give it a try with the new version but still, no official support for Android at this stage