Skip to content
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

How to compile the bundletool code when I add some feature which is based on the branch code. #28

Closed
CHan-HanChuang opened this issue Sep 25, 2018 · 17 comments

Comments

@CHan-HanChuang
Copy link

I just compile the code with gradle but the output jar was only 1.3M.

@plecesne
Copy link
Contributor

The default build task will build the jar without dependencies. For the standalone tool, you want to execute the executableJar task.

@CHan-HanChuang
Copy link
Author

thank you

@TamilanPeriyasamy
Copy link

@plecesne can't find com.android.bundle.* packages
Did you add any dependencies?

@plecesne
Copy link
Contributor

I just tried the following command and it built successfully.

./gradlew executableJar 

What command are you running? And what exception are you getting? Did you modify the build.gradle?

@aishang5wpj
Copy link

aishang5wpj commented Jun 13, 2019

I just tried the following command and it built successfully.

./gradlew executableJar 

What command are you running? And what exception are you getting? Did you modify the build.gradle?

this command worked for me, and I got a jar file bundletool-all.jar in directory bundletool-master/build/libs/.

./gradlew executableJar

but what should I do if I want to debug the project ? I import it into IntelliJ IDEA CE and create an application configuration for it , then I run it , it shows me the message bellow:

Error:(18, 36) java: 程序包com.android.bundle.Targeting不存在
Error:(19, 61) java: 程序包com.android.bundle.Targeting.TextureCompressionFormat不存在
Error:(20, 36) java: 程序包com.android.bundle.Targeting不存在
Error:(27, 38) java: 找不到符号
  符号:   类 TextureCompressionFormatAlias
  位置: 类 com.android.tools.build.bundletool.model.utils.TextureCompressionUtils
Error:(40, 44) java: 找不到符号
  符号:   类 TextureCompressionFormatTargeting
  位置: 类 com.android.tools.build.bundletool.model.utils.TextureCompressionUtils
Error:(53, 7) java: 找不到符号
  符号:   类 TextureCompressionFormatAlias
  位置: 类 com.android.tools.build.bundletool.model.utils.TextureCompressionUtils
Error:(52, 18) java: 找不到符号
  符号:   类 TextureCompressionFormatTargeting
  位置: 类 com.android.tools.build.bundletool.model.utils.TextureCompressionUtils

this is my configuration:

image

what mistakes with my steps ? @plecesne

@plecesne
Copy link
Contributor

Look at my answer here: #54 (comment)

@aishang5wpj
Copy link

Look at my answer here: #54 (comment)

good answer, still does not help me.

@plecesne
Copy link
Contributor

Have you added all three source folders in the module? Can you show me a screenshot of how you've configured this?

@aishang5wpj
Copy link

Have you added all three source folders in the module? Can you show me a screenshot of how you've configured this?

sure. here is my configuration, is this right ?

image

@plecesne
Copy link
Contributor

Make sure java and proto are selected as "Source Folders".

bundletool-project

@aishang5wpj
Copy link

It still doesn't work :(

image
image

@plecesne
Copy link
Contributor

Yeah, sorry, missing the generated files:

bundletool-main

And for tests, add the source, and add a dependency on main:

bundletool-test0
bundletool-test

@aishang5wpj
Copy link

Yeah, sorry, missing the generated files:

bundletool-main

And for tests, add the source, and add a dependency on main:

bundletool-test0
bundletool-test

Thanks , it worked. In addition to this, there are some places to pay attention to.

  1. source code does not contains build folder, you need run ./gradlew executableJar to generate it.
  2. you must remove all config from bundletool-master first in configuration panel, otherwise you cannot add build folder to main.

image

@plecesne
Copy link
Contributor

Great, we should add this to the CONTRIBUTING files possibly.
Feel free to send the pull request if you're interested in helping out, otherwise I'll add it at some point myself :)

@aishang5wpj
Copy link

aishang5wpj commented Jun 18, 2019

Great, we should add this to the CONTRIBUTING files possibly.
Feel free to send the pull request if you're interested in helping out, otherwise I'll add it at some point myself :)

I am happy to do this, but I am worried that I am not doing well, maybe you are more suitable. LOL

@Shihab-BD
Copy link

@plecesne I tried to run the source also, same "com.android.bundle" package not found. Is it coming from any dependency. Got no idea anyway.

@plecesne
Copy link
Contributor

Follow the instructions from this thread, in particular make sure you ran gradlew and that you added the generated sources to the source folders.

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

No branches or pull requests

5 participants