cuplv / droidel

Framework model for static analysis of Android
Apache License 2.0
46 stars 14 forks source link

AndroidCallbacks.txt null? #11

Closed highwater closed 9 years ago

highwater commented 9 years ago

So I just run Droidel again after moving to other PC and I got this NullPointerException error around this line:

private val callbackClasses = {
    Source.fromURL(getClass.getResource(s"/${DroidelConstants.CALLBACK_LIST}")).getLines.foldLeft (Set.empty[TypeReference]) ((set, line) => set + TypeReference.findOrCreate(ClassLoaderReference.Primordial, ClassUtil.walaifyClassName(line)))
} 

I don't know what's going on?

sblackshear commented 9 years ago

Hi Coraline, I've pushed a change that should fix the issue; grab the latest and you should be set.

I've also made some major improvements to Droidel lately. Harness compilation should be much, much more reliable and the call graphs you build using Droidel should be much more sound! Make sure you check the updated README--there's one additional step you need to take in order to use this updated version.

highwater commented 9 years ago

I think my issue was because I changed to Windows PC. Anyway I've installed Ubuntu back. I will try the new fix now. I actually use Droidel as an Eclipse library, a bit tedious to set everything right. Maybe in the future you can make it to support Eclipse? Thank you.

sblackshear commented 9 years ago

Hi Coraline, The fix I pushed should make Droidel work on Windows again too, but I'm only testing it on Max and Linux these days.

If you install the ScaleIDE plugin for Eclipse, you ought to be able to import Droidel as an SBT project and have everything work out of the box once you've run the install_deps.sh script. I've confirmed that this works with IntelliJ.

highwater commented 9 years ago

Strange, I'm still getting this NPE error now :cry: what caused it? I already built Eclipse project using sbteclipse and then imported it, didn't think of this earlier.

But, when I use terminal I didn't get the error.

sblackshear commented 9 years ago

I think the solution is unfortunately to use the terminal build then. If you figure out what the problem is, I'd be happy to accept a pull request!

highwater commented 9 years ago

I figured it out, in order to use Source.fromURL(getClass.getResource(<file>)), the file must be in classpath, so I added it.