Buildozer is building kivy each time though it has previously built dist

400 Views Asked by At

I am using buildozer with kivy and its process if

  • downloading stuff
  • build recipe for the arch
  • reuse that dist for next distributions of apk

but in my app im using garden flower zbarcam, im directly puttin gsource folder, but each gtime, buildozer is building the dist for arch though its already present, as per my reading, version number should match from requirement tag in buildoser.specs but im not defining the version number in it, using directly ,measn there shouldnot be andy issue about version number in recipe

my question is , buildozer is doing ndk build each time again it finds it in dists folder, though it has the dist already built, from previous compilation. can any one help?

1

There are 1 best solutions below

0
On

I brainstormed over it and came up with a solution as follows

  • There´s no need to update to 13jdk from 11jdk it won't work, the jdk8 SDK tool from android is deprecated and only supports that version, so don't update it to a higher version.

  • There´s no need to re-build for your architecture if the requirements didn't change.

  • Do bulldozer clean each time you change your requirements.

  • put src/ folder of kivy_garden in the side folder of the project, and isn´t necessary to install it from the requirements section.

Also, I have made some changes in the toolchain file under p4a as follows

def require_prebuilt_dist(func):
"""Decorator for ToolchainCL methods. If present, the method will
automatically make sure a dist has been built before continuing
or, if no dists are present or can be obtained, will raise an
error.
"""

@wraps(func)
def wrapper_func(self, args, **kw):
    ctx = self.ctx
    ctx.set_archs(self._archs)
    ctx.prepare_build_environment(user_sdk_dir=self.sdk_dir,
                                  user_ndk_dir=self.ndk_dir,
                                  user_android_api=self.android_api,
                                  user_ndk_api=self.ndk_api)
    dist = self._dist
    info_notify(dist)
    if dist.needs_build:
        info_notify('needs build')
        if dist.folder_exists():  # possible if the dist is being replaced
            info_notify('not deleting')
            #dist.delete()
        info_notify('No dist exists that meets your requirements, '
                    'so one will be built.')
        #build_dist_from_args(ctx, dist, args)
    func(self, args, **kw)
return wrapper_func

and now it will only work, after one successful build,

Please leave a comment if you find a better way around this.

Thanks