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

Avoids build error for opencv and bumps version to 4.5.1 #2419

Merged
merged 3 commits into from
Jun 14, 2021

Conversation

thescheff
Copy link
Contributor

Allows build with docker container. Without this changes, I could not build opencv with p4a.

Copy link
Member

@AndreMiras AndreMiras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update, it looks good to me.
Looks like this could solve kivy/buildozer#1144 right?
I've made a tiny comment if you don't mind updating before we merge
Edit: note that Travis is failing with error: Can not find Rust compiler, but that was prior your PR

Dockerfile Show resolved Hide resolved
@thescheff
Copy link
Contributor Author

Yes kivy/buildozer#1144 gets the same error I did:

CMake Error at cmake/android/OpenCVDetectAndroidSDK.cmake:176 (message):
Android SDK Tools: OpenCV requires Android SDK Tools revision 14 or newer.

And the cmake arguments -DANDROID_SDK_TOOLS_VERSION=6514223 and -DANDROID_PROJECTS_SUPPORT_GRADLE=ON are missing too.

I don't know how I could have created this error: error: Can not find Rust compiler. The error occurs before executing the test script. During the python3.7 -m pip install pyOpenSSL installation. That doesn't seem connected to these changes.

@obfusk
Copy link
Contributor

obfusk commented Feb 18, 2021

I don't know how I could have created this error: error: Can not find Rust compiler. The error occurs before executing the test script. During the python3.7 -m pip install pyOpenSSL installation. That doesn't seem connected to these changes.

That should be fixed by #2422 (when it's merged).

@ss1969
Copy link

ss1969 commented Mar 9, 2021

Allows build with docker container. Without this changes, I could not build opencv with p4a.
I tried this fix, and it works with P4A-develop / arm64-v8a / SDK27 / NDK21.
but it will crash into an "compileDebugJavaWithJavac FAILED" error with P4A-develop / armeabi-v7a / SDK24 / NDK21.
Can you show me your environment please?

@thescheff
Copy link
Contributor Author

Allows build with docker container. Without this changes, I could not build opencv with p4a.
I tried this fix, and it works with P4A-develop / arm64-v8a / SDK27 / NDK21.
but it will crash into an "compileDebugJavaWithJavac FAILED" error with P4A-develop / armeabi-v7a / SDK24 / NDK21.
Can you show me your environment please?

You used the default Dockerfile? I tested only with the "default" SDK/NDK versions. The following is what the Dockerfile installs (Source: android.mk):

ANDROID_NDK_VERSION ?= 19b
ANDROID_SDK_TOOLS_VERSION ?= 6514223
ANDROID_SDK_BUILD_TOOLS_VERSION ?= 29.0.3
ANDROID_HOME ?= $(HOME)/.android
ANDROID_API_LEVEL ?= 27

Perhaps this is the problem?

As for my environment:

I build the Dockerfile from thescheff:develop added the following vars in the container:

echo "ANDROIDSDK="$HOME/.android/android-sdk"" >> $HOME/.bashrc
echo "ANDROIDNDK="$HOME/.android/android-ndk"" >> $HOME/.bashrc
echo "ANDROIDAPI=27" >> $HOME/.bashrc
echo "ANDROIDNDKVER=19b" >> $HOME/.bashrc
source $HOME/.bashrc

And ran the build:

p4a apk --private $HOME/myapp \
    --package=org.example.myapp \
    --name="My application" \
    --version=0.1 \
    --bootstrap=sdl2 \
    --requirements=python3,kivy,opencv \
    --blacklist-requirements=sqlite3,openssl \
    --permission CAMERA \
    --sdk-dir $ANDROIDSDK \
    --ndk-dir $ANDROIDNDK \
    --arch armeabi-v7a

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 this pull request may close these issues.

5 participants