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

Add an external jar dependency? #11

Closed
ravener opened this issue Dec 16, 2018 · 4 comments
Closed

Add an external jar dependency? #11

ravener opened this issue Dec 16, 2018 · 4 comments

Comments

@ravener
Copy link

ravener commented Dec 16, 2018

Hey there, i just discovered this yesterday and its nice but I'm stuck here, how would you add an external jar dependency in this case i want to use OkHttp

I downloaded okhttp.jar and its dependency okio.jar

What would i need to modify in buildOne.sh to link this jar files with it and use it.

Thanks.

@SDRausty
Copy link
Owner

SDRausty commented Jan 13, 2019

if [ -d "$TMPDIR"/buildAPKsLibs ] && [ -d "$WDR"/libs ] 
# checks if directories exist
then # loads artifacts
        ecj -d ./obj -classpath "$TMPDIR"/buildAPKsLibs:"$WDR"/libs -sourcepath . "$(find . -type f -name "*.java")"
elif [ -d "$TMPDIR"/buildAPKsLibs ]
then
        ecj -d ./obj -classpath "$TMPDIR"/buildAPKsLibs -sourcepath . "$(find . -type f -name "*.java")"
else
        ecj -d ./obj -sourcepath . "$(find . -type f -name "*.java")"
fi

From https://raw.githubusercontent.com/BuildAPKs/buildAPKs/master/scripts/bash/build/build.one.bash

@ravener
Copy link
Author

ravener commented Jan 23, 2019

I've already solved this by doing the following: put the jar file(s) in the project folder, edit buildOne.sh to include the jar file(s) in the ecj's -cp flag, : seperated, then in the dx call pass the jar files as extra arguments so they also get bundled with classes.dex, and your done.

@ravener ravener closed this as completed Jan 23, 2019
@SDRausty SDRausty pinned this issue Jun 16, 2019
@SDRausty SDRausty unpinned this issue Jun 19, 2019
@SDRausty SDRausty pinned this issue Jul 17, 2019
@SDRausty
Copy link
Owner

@pollen5 BuildAPKs/buildAPKs#1

@SDRausty
Copy link
Owner

SDRausty commented Dec 1, 2019

Unifying native artifacts should be a simple solution. File bootclasspath.sh is created to ease inegration of native libraries that are present on device.

Reference from BuildAPKs/buildAPKs#2 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants