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

NullPointerException in ObfArtifact.getFile #68

Closed
Dykam opened this issue Feb 23, 2014 · 11 comments
Closed

NullPointerException in ObfArtifact.getFile #68

Dykam opened this issue Feb 23, 2014 · 11 comments

Comments

@Dykam
Copy link

Dykam commented Feb 23, 2014

We're trying to produce 3 versions of the same code, one LiteLoader, one Forge and a basemod. For this I configure 3 Jar tasks. From what I can see, for ForgeGradle to pick it up I need to call reobf { reobf }, except this generates an NPE.

Reproducable by cloning from https://github.com/Dykam/tabbychat/tree/NPE/
git clone -b NPE --single-branch git@github.com:Dykam/tabbychat.git
and running
gradle build --stacktrace

@AbrarSyed
Copy link
Member

I have cloned the repo you linked, and tested it on my Arch Linux system. I have been unable to reproduce.

@Dykam
Copy link
Author

Dykam commented Feb 27, 2014

Did you make sure to check out the NPE branch?

@AbrarSyed
Copy link
Member

your right.. I didnt get the NPE branch....

@AbrarSyed AbrarSyed reopened this Feb 27, 2014
@Dykam
Copy link
Author

Dykam commented Feb 27, 2014

I edited the initial comment, --stackoverflow had to be --stacktrace (of course, oops)

@Dykam
Copy link
Author

Dykam commented Feb 27, 2014

When will it be live? Or is there a way to quickly use it?

@AbrarSyed
Copy link
Member

Every commit is live within 20 seconds of it bieng pushed to github. You
can ensure you have the latest version by running your build with
'--refresh-dependencies'

@Dykam
Copy link
Author

Dykam commented Feb 27, 2014

I don't know how related it is, but when configuring jar { onlyIf { false } } to turn the default jar off it generates an exception in the same task:

Execution failed for task ':reobf'.
> java.io.FileNotFoundException: <path>\tabbychat\build\libs\TabbyChat-1.11.0.jar (The system cannot find the file specified)

@AbrarSyed
Copy link
Member

dont turn the default jar off. Configure it.

@Dykam
Copy link
Author

Dykam commented Feb 27, 2014

Regarding previous mention, I think we have a related bug;
The following line gets obfuscated properly in the default jar:

if (mc.thePlayer != null && mc.thePlayer.getCommandSenderName() != null) {

to:

if ((mc.field_71439_g != null) && (mc.field_71439_g.func_70005_c_() != null)) {

However in any extra jar included with reobf { reobf jarTask } it becomes:

if ((mc.field_71439_g != null) && (mc.field_71439_g.getCommandSenderName() != null)) {

@AbrarSyed
Copy link
Member

Thats because it needs the classpath.
https://github.com/matthewprenger/ServerTools/blob/develop/build.gradle#L66-L70
^ something like that will ensure it works

@Dykam
Copy link
Author

Dykam commented Feb 27, 2014

Thank you very much, that fixed it in Dykam/tabbychat@80ba708

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

2 participants