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

Sampleapp crashes due to missing dependencies #42

Closed
cyBerta opened this issue Jun 20, 2021 · 4 comments · Fixed by #43
Closed

Sampleapp crashes due to missing dependencies #42

cyBerta opened this issue Jun 20, 2021 · 4 comments · Fixed by #43
Assignees

Comments

@cyBerta
Copy link

cyBerta commented Jun 20, 2021

I'm having difficulties to integrate tor-android from maven into my app.

For the sake of simplicity I played with the sampletorapp to check if the issue can be reproduced and replaced implementation project(':tor-android-binary') with implementation 'info.guardianproject:tor-android:0.4.5.7' in build.gradle.
The app crashes with the following output:

java.lang.NoClassDefFoundError: Failed resolution of: Lnet/freehaven/tor/control/RawEventListener;
        at java.lang.Class.newInstance(Native Method)
        at android.app.AppComponentFactory.instantiateService(AppComponentFactory.java:129)
        at android.support.v4.app.CoreComponentFactory.instantiateService(CoreComponentFactory.java:68)
        at android.app.ActivityThread.handleCreateService(ActivityThread.java:4183)
        at android.app.ActivityThread.access$1500(ActivityThread.java:237)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "net.freehaven.tor.control.RawEventListener" on path: DexPathList[[zip file "/data/app/~~PnwwXCcitagMUetlwWWkcA==/org.torproject.android.sample-2yWMWQCRC-zPckCJvGCRMQ==/base.apk"],nativeLibraryDirectories=[/data/app/~~PnwwXCcitagMUetlwWWkcA==/org.torproject.android.sample-2yWMWQCRC-zPckCJvGCRMQ==/lib/x86, /data/app/~~PnwwXCcitagMUetlwWWkcA==/org.torproject.android.sample-2yWMWQCRC-zPckCJvGCRMQ==/base.apk!/lib/x86, /system/lib, /system_ext/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)

So it seems not all dependencies are shipped with the artifact on maven. If this is intended, then it would be great to adapt the documentation a little bit.

@n8fr8
Copy link
Member

n8fr8 commented Jun 21, 2021

Good find. Seems like it is related to: 'info.guardianproject:jtorctl:0.4.2.5'

@eighthave
Copy link
Member

@cyBerta your build is missing the jtorctl library, does your build include implementation 'info.guardianproject:jtorctl:0.4.5.7'?

@cyBerta
Copy link
Author

cyBerta commented Jun 22, 2021

Yes, I figured that out, too. I was trying info.guardianproject:jtorctl:0.4.2.5 and was able to run the sample app with it and used that version for the current integration into https://github.com/leapcode/bitmask_android/. I'll update to info.guardianproject:jtorctl:0.4.5.7. Thanks for your help!

@n8fr8
Copy link
Member

n8fr8 commented Jun 22, 2021

@eighthave it might be good to have the sample app gradle config include all necessary lines for use outside of the project, even if they are commented out.

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

Successfully merging a pull request may close this issue.

3 participants