问题
I encounter the following error:
Error 1006: %function_name% is not a function
We have 2 util classes in out project named as ArrayUtils
. All functions in them are public static. Another developer added function %function_name%
to one of ArrayUtils
. I use this method in my code. I recompiled whole application. It compiles OK and IDE (IntelliJ IDEA) detects this method normally (imports are correct). But at runtime I got mentioned above error. The most strange thing is that this code works as it should on other developer's machine.
P.S. Browser cache, IntelliJ IDEA cache and maven (we use is as build tool) local repository were cleared, nothing helped.
回答1:
There are 2 reasons of this error:
- you have ArrayUtils class in another precompiled library and you have access to ArrayUtils via linkage and you trying to link library with old version of class.
- you have another library, that now contains dependency of that ArrayUtils and your linkage was replaced by that. So, in result you have 2 ArrayUtils in your project scope. Try to find it and remove one.
来源:https://stackoverflow.com/questions/12616770/strange-error-1006-function-name-is-not-a-function