FlowDroid icon indicating copy to clipboard operation
FlowDroid copied to clipboard

java.lang.ClassNotFoundException: gnu.trove.strategy.HashingStrategy

Open elegantya opened this issue 5 years ago • 13 comments

[main] INFO soot.jimple.infoflow.android.SetupApplication - Initializing Soot... [main] INFO soot.jimple.infoflow.android.SetupApplication - Loading dex files... [main] INFO soot.jimple.infoflow.android.SetupApplication - ARSC file parsing took 0.0639073 seconds [main] INFO soot.jimple.infoflow.android.entryPointCreators.AndroidEntryPointCreator - Creating Android entry point for 1 components... [main] INFO soot.jimple.infoflow.android.SetupApplication - Constructing the callgraph... [main] INFO soot.jimple.infoflow.android.callbacks.DefaultCallbackAnalyzer - Collecting callbacks in DEFAULT mode... [main] INFO soot.jimple.infoflow.android.callbacks.DefaultCallbackAnalyzer - Callback analysis done. [main] WARN soot.jimple.infoflow.android.resources.LayoutFileParser - Could not find layout class android.support.v7.internal.widget.ActionBarContainer [main] WARN soot.jimple.infoflow.android.resources.LayoutFileParser - Could not find layout class android.support.v7.internal.widget.ActionBarView [main] WARN soot.jimple.infoflow.android.resources.LayoutFileParser - Could not find layout class android.support.v7.internal.widget.ActionBarContextView [main] WARN soot.jimple.infoflow.android.resources.LayoutFileParser - Could not find layout class android.support.v7.internal.widget.ActionBarContainer [main] WARN soot.jimple.infoflow.android.resources.LayoutFileParser - Could not find layout class android.support.v7.internal.widget.ActionBarOverlayLayout [main] WARN soot.jimple.infoflow.android.resources.LayoutFileParser - Could not find layout class android.support.v7.internal.widget.ActionBarContainer [main] WARN soot.jimple.infoflow.android.resources.LayoutFileParser - Could not find layout class android.support.v7.internal.widget.ActionBarView [main] WARN soot.jimple.infoflow.android.resources.LayoutFileParser - Could not find layout class android.support.v7.internal.widget.ActionBarContextView [main] WARN soot.jimple.infoflow.android.resources.LayoutFileParser - Could not find layout class android.support.v7.internal.widget.ActionBarContainer [main] WARN soot.jimple.infoflow.android.resources.LayoutFileParser - Could not find layout class view [main] WARN soot.jimple.infoflow.android.resources.LayoutFileParser - Could not find layout class view [main] WARN soot.jimple.infoflow.android.resources.LayoutFileParser - Could not find layout class android.support.v7.internal.widget.LinearLayoutICS [main] WARN soot.jimple.infoflow.android.resources.LayoutFileParser - Could not find layout class android.support.v7.internal.view.menu.ActionMenuItemView [main] WARN soot.jimple.infoflow.android.resources.LayoutFileParser - Could not find layout class android.support.v7.internal.view.menu.ActionMenuView [main] WARN soot.jimple.infoflow.android.resources.LayoutFileParser - Could not find layout class android.support.v7.internal.widget.ActionBarContextView [main] WARN soot.jimple.infoflow.android.resources.LayoutFileParser - Could not find layout class android.support.v7.internal.widget.LinearLayoutICS [main] WARN soot.jimple.infoflow.android.resources.LayoutFileParser - Could not find layout class android.support.v7.internal.view.menu.ExpandedMenuView [main] WARN soot.jimple.infoflow.android.resources.LayoutFileParser - Could not find layout class android.support.v7.internal.view.menu.ListMenuItemView [main] WARN soot.jimple.infoflow.android.resources.LayoutFileParser - Could not find layout class android.support.v7.internal.view.menu.ListMenuItemView [main] WARN soot.jimple.infoflow.android.resources.LayoutFileParser - Could not find layout class view [main] WARN soot.jimple.infoflow.android.resources.LayoutFileParser - Could not find layout class android.support.v7.internal.widget.NativeActionModeAwareLayout [main] WARN soot.jimple.infoflow.android.resources.LayoutFileParser - Could not find layout class android.support.v7.internal.widget.NativeActionModeAwareLayout [main] INFO soot.jimple.infoflow.android.entryPointCreators.AndroidEntryPointCreator - Creating Android entry point for 1 components... [main] INFO soot.jimple.infoflow.android.SetupApplication - Constructing the callgraph... [main] INFO soot.jimple.infoflow.android.callbacks.DefaultCallbackAnalyzer - Running incremental callback analysis for 1 components... [main] INFO soot.jimple.infoflow.android.callbacks.DefaultCallbackAnalyzer - Incremental callback analysis done. [main] INFO soot.jimple.infoflow.memory.MemoryWarningSystem - Shutting down the memory warning system... [main] INFO soot.jimple.infoflow.android.SetupApplication - Callback analysis terminated normally [main] INFO soot.jimple.infoflow.android.SetupApplication - Entry point calculation done. [main] INFO soot.jimple.infoflow.android.SetupApplication - Collecting callbacks and building a callgraph took 1 seconds [main] INFO soot.jimple.infoflow.android.SetupApplication - Running data flow analysis on E:\worksoftware\eclipse\workspace\soot-infoflow-android\testAPKs\enriched1.apk with 0 sources and 0 sinks... [main] INFO soot.jimple.infoflow.InfoflowConfiguration - Implicit flow tracking is NOT enabled [main] INFO soot.jimple.infoflow.InfoflowConfiguration - Exceptional flow tracking is enabled [main] INFO soot.jimple.infoflow.InfoflowConfiguration - Running with a maximum access path length of 5 [main] INFO soot.jimple.infoflow.InfoflowConfiguration - Using path-agnostic result collection [main] INFO soot.jimple.infoflow.InfoflowConfiguration - Recursive access path shortening is enabled [main] INFO soot.jimple.infoflow.InfoflowConfiguration - Taint analysis enabled: false [main] INFO soot.jimple.infoflow.InfoflowConfiguration - Using alias algorithm FlowSensitive Exception in thread "main" java.lang.NoClassDefFoundError: gnu/trove/strategy/HashingStrategy at soot.jimple.infoflow.Infoflow.runAnalysis(Infoflow.java:267) at soot.jimple.infoflow.Infoflow.runAnalysis(Infoflow.java:239) at soot.jimple.infoflow.android.SetupApplication$InPlaceInfoflow.runAnalysis(SetupApplication.java:1180) at soot.jimple.infoflow.android.SetupApplication.processEntryPoint(SetupApplication.java:1424) at soot.jimple.infoflow.android.SetupApplication.runInfoflow(SetupApplication.java:1359) at soot.jimple.infoflow.android.SetupApplication.constructCallgraph(SetupApplication.java:1203) at flowdroidcg.CGGenerator.main(CGGenerator.java:29) Caused by: java.lang.ClassNotFoundException: gnu.trove.strategy.HashingStrategy at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 7 more

I wonder how to solve this problem.

elegantya avatar Nov 08 '19 10:11 elegantya

How did you run FlowDroid? Did you use the JAR fil with all dependencies? Or did you integrate FlowDroid into your own application?

StevenArzt avatar Nov 08 '19 16:11 StevenArzt

With adding all project dependencies (soot, soot-infoflow, soot-infoflow-android) to my project in eclipse, I have faced the same problem and the same log.

Here is my project code.

SetupApplication app = new SetupApplication (androidJar, apkFile);
app.constructCallgraph();

scliu96 avatar Nov 27 '19 05:11 scliu96

thank you | | 李雅 | | 邮箱:[email protected] |

签名由 网易邮箱大师 定制

On 11/27/2019 13:12, Shaocong Liu wrote:

With adding all project dependencies (soot, soot-infoflow, soot-infoflow-android) to my project in eclipse, I have faced the same problem and the same log.

Here is my project code.

SetupApplication app = new SetupApplication (androidJar, apkFile); app.constructCallgraph();

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

elegantya avatar Nov 27 '19 07:11 elegantya

I have the same problem.I only put soot-infoflow-android-classes.jar 、soot-infoflow-classes.jar(FlowDroid2.7.1) and sootclasses-trunk-jar-with-dependencies.jar(soot 4.1.0) into build path of the eclipse project, using jdk 1.8 , then I have the same error. Here is my code:

public void makeCallGraph(String androidPlatforms, String apk) { // Initialize analyzer SetupApplication analyzer = new SetupApplication(androidPlatforms, apk); SootConfigForAndroid sootConf = new SootConfigForAndroid() { @Override public void setSootOptions(Options options, InfoflowConfiguration config) { super.setSootOptions(options, config); Options.v().set_process_multiple_dex(true); Options.v().set_allow_phantom_refs(true); Options.v().set_whole_program(true); } }; analyzer.setSootConfig(sootConf); // Get call graph analyzer.constructCallgraph(); cg = Scene.v().getCallGraph(); }

Hope for your reply @StevenArzt

Person-J avatar Mar 13 '20 06:03 Person-J

I had the same problem when I only use soot-infoflow-android-classes.jar, soot-infoflow-classes.jar (FlowDroid2.7.1) and sootclasses-trunk-jar-with-dependencies.jar (Soot 4.1.0) as libs of my project, and it complained that "java.lang.ClassNotFoundException: gnu.trove.strategy.HashingStrategy" when I ran it.

Then I searched gnu.trove.strategy.HashingStrategy in FlowDroid source code, I found it is imported at here, and the lib trove4j is added as a dependency of FlowDroid at here.

The solution is obvious: add trove4j-3.0.3.jar as another lib of your project, and you can get it here.

Wangxiz avatar Mar 30 '20 09:03 Wangxiz

I would recommend using Maven to integrate FlowDroid into your own project, because Maven takes care of resolving all the (transitive) dependencies.

StevenArzt avatar Mar 30 '20 09:03 StevenArzt

I tried to use Maven to integrate FlowDroid into my project, but I found only soot-infoflow in maven center repository, and soot-infoflow-android is not there.

Wangxiz avatar Mar 30 '20 09:03 Wangxiz

@Wangxiz It works! Thank you!

Person-J avatar Mar 31 '20 02:03 Person-J

@Wangxiz Thanks! Added the dependency to maven and it solved my problem too.

itstartstosnow avatar Nov 21 '20 12:11 itstartstosnow

I tried to use Maven to integrate FlowDroid into my project, but I found only soot-infoflow in maven center repository, and soot-infoflow-android is not there.

Same here. It seems the only available repository is de.tud.sse:soot-infoflow:2.8. How can I add soot-infoflow-android dependency in maven?

noidsirius avatar Mar 04 '21 22:03 noidsirius

@mbenz89 Can you comment on the issue with the official build? It seems there is a problem with your build chain. We can also host the official build at Fraunhofer SIT, if that's better for you. We only need to ensure that we're not messing up each others' build chains.

StevenArzt avatar Mar 05 '21 08:03 StevenArzt

@noidsirius You can find de.tud.sse:soot-infoflow-android in this repository.

Wangxiz avatar Mar 05 '21 08:03 Wangxiz

Thanks @Wangxiz

noidsirius avatar Mar 05 '21 16:03 noidsirius