telegram-s / telegram-api-old

Telegram Api library for java
MIT License
138 stars 64 forks source link

Getting Below Error While Trying To run ""gradle build" #26

Open prasenjeet86 opened 10 years ago

prasenjeet86 commented 10 years ago
prasenjeet86 commented 10 years ago

I am getting this issue while trying to run as per the steps given in url as Building from source code "https://github.com/ex3ndr/telegram-api" . I tried in many way but finally same issue is coming. Please help me to resolve this. I want to create a telegram Java client for desktop to integrate with my application.

Thanks in advance.

jnitish25 commented 9 years ago

The project also depends on the actors folder. Copy telegram-actors to actors folder and then run the build file.

prasenjeet86 commented 9 years ago

Hi Nitish,

I tried using actor folder also, facing same error. In case it works for yoy, can you please help me with the client or steps?

My mail id : prasenjeet86@gmail.com

Many thanks in advance.

Regards, Peasenjeet

pjr1060 commented 9 years ago

The gradle build files are out of date. Here's what worked for me.

  1. Clone all of the telegram-xxxx projects into a colocated folder.
  2. Go into telegram-api/ and edit build.gradle... Add a repositories{} section shown here after apply plugin declarations (this fixes the android actors lib error)...
project.group = "org.telegram"

apply plugin: 'java'
apply plugin: 'shadow'

repositories {
    mavenLocal()
    mavenCentral()
}

dependencies {
    compile project(':tl-core')
    compile project(':mtproto')
    compile project(':actors')
    compile files('libs/tl-api-v12.jar')
}
  1. Edit settings.gradle to the following, this fixes the project dependencies to the correct gradle cloned sub-projects (notice it assumes they are located as peers of the telegram-api/ folder)...
rootProject.name = "telegram-api"

include ':tl-core', ':mtproto', ':actors'

project(':tl-core').projectDir = new File( '../telegram-tl-core' )
project(':mtproto').projectDir = new File( '../telegram-mt' )
project(':actors').projectDir = new File( '../telegram-actors' )
  1. You can now do _gradle build_ and it will build. _gradle shadowJar_ will create a single deployable jar with all dependencies rolled up.

So now the next question is - why does the resulting snapshot shadow jar throw errors if I use it instead of the download 1.1.127 shadow jar? This project needs some TLC.

Also where is the source for the lib/tl-api-v12.jar ?

kardapoltsev commented 9 years ago

+1 for question about sources for the lib/tl-api-v12.jar