if srclib["Update Project"] == "Yes":
print "Updating srclib %s at path %s" % (name, libdir)
- if subprocess.call([os.path.join(config['sdk_path'], 'tools', 'android'),
- 'update', 'project', '-p', libdir]) != 0:
- raise BuildException( 'Error updating ' + name + ' project')
+ p = FDroidPopen([
+ os.path.join(config['sdk_path'], 'tools', 'android'),
+ 'update', 'project', '-p', libdir])
+ # Check to see whether an error was returned without a proper exit
+ # code (this is the case for the 'no target set or target invalid'
+ # error)
+ if p.returncode != 0 or (p.stderr != "" and
+ p.stderr.startswith("Error: ")):
+ raise BuildException("Failed to update srclib project {0}"
+ .format(name), p.stdout, p.stderr)
+ remove_signing_keys(libdir)
+
if basepath:
return sdir
return libdir