error: container 'AndroidApp' has no member called 'init'
Closed this issue · 3 comments
and error: container '.build_options' has no member called 'app_name'
are the two errors I'm getting on Artix Linux (Arch Linux based).
I'm not sure what more info to give, please let me know?
artixvbox:[user]:~/zat/ZigAndroidTemplate-master$ time zig build
CrossTarget{ .cpu_arch = Arch.aarch64, .cpu_model = CpuModel{ .baseline = void }, .cpu_features_add = Set{ .ints = { 0, 0, 67108864, 0, 0 } }, .cpu_features_sub = Set{ .ints = { 0, 0, 0, 0, 0 } }, .os_tag = Tag.linux, .os_version_min = null, .os_version_max = null, .glibc_version = null, .abi = null, .dynamic_linker = DynamicLinker{ .buffer = { 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170 }, .max_byte = null } }
./src/android-support.zig:45:23: error: container 'AndroidApp' has no member called 'init'
app.* = AndroidApp.init(
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:164:16: note: called from here
log(.emerg, scope, format, args);
^
./src/android-support.zig:115:18: note: called from here
std.log.emerg("PANIC: {s}\n", .{message});
^
./src/android-support.zig:114:83: note: called from here
pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace) noreturn {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:164:16: note: called from here
log(.emerg, scope, format, args);
^
./src/android-support.zig:118:22: note: called from here
std.log.emerg("{}\n", .{st});
^
./src/android-support.zig:114:83: note: called from here
pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace) noreturn {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:164:16: note: called from here
log(.emerg, scope, format, args);
^
./src/android-support.zig:88:34: note: called from here
std.log.emerg("{s}", .{self.line_buffer[0..self.line_len]});
^
./src/android-support.zig:83:59: note: called from here
fn write(self: *LogWriter, buffer: []const u8) !usize {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:164:16: note: called from here
log(.emerg, scope, format, args);
^
./src/android-support.zig:125:26: note: called from here
std.log.emerg("failed to write stack trace: {s}", .{err});
^
./src/android-support.zig:114:83: note: called from here
pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace) noreturn {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:164:16: note: called from here
log(.emerg, scope, format, args);
^
./src/android-support.zig:128:22: note: called from here
std.log.emerg("failed to get debug info: {s}", .{err});
^
./src/android-support.zig:114:83: note: called from here
pub fn panic(message: []const u8, stack_trace: ?*std.builtin.StackTrace) noreturn {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:232:16: note: called from here
log(.debug, scope, format, args);
^
./src/android-support.zig:34:18: note: called from here
app_log.debug("Starting on Android Version {}\n", .{
^
./src/android-support.zig:22:133: note: called from here
export fn ANativeActivity_onCreate(activity: *android.ANativeActivity, savedState: ?[*]u8, savedStateSize: usize) callconv(.C) void {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:164:16: note: called from here
log(.emerg, scope, format, args);
^
./src/android-support.zig:39:22: note: called from here
app_log.emerg("Could not create new AndroidApp: OutOfMemory!\n", .{});
^
./src/android-support.zig:22:133: note: called from here
export fn ANativeActivity_onCreate(activity: *android.ANativeActivity, savedState: ?[*]u8, savedStateSize: usize) callconv(.C) void {
^
./src/main.zig:107:35: error: expected 2 argument(s), found 1
self.egl = EGLContext.init(window) catch |err| blk: {
^
./src/egl.zig:19:9: note: declared here
pub fn init(window: *android.ANativeWindow, version: Version) !Self {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:232:16: note: called from here
log(.debug, scope, format, args);
^
./src/android-support.zig:197:30: note: called from here
app_log.debug("ANativeActivity callback onSaveInstanceState not available on {s}", .{@typeName(App)});
^
./src/android-support.zig:186:105: note: called from here
fn onSaveInstanceState(activity: *android.ANativeActivity, outSize: *usize) callconv(.C) ?[*]u8 {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:232:16: note: called from here
log(.debug, scope, format, args);
^
./src/android-support.zig:181:30: note: called from here
app_log.debug("ANativeActivity callback {s} not available on {s}", .{ func, @typeName(App) });
^
./src/android-support.zig:210:19: note: called from here
invoke(activity, "onStart", .{});
^
./src/android-support.zig:209:74: note: called from here
fn onStart(activity: *android.ANativeActivity) callconv(.C) void {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:232:16: note: called from here
log(.debug, scope, format, args);
^
./src/android-support.zig:181:30: note: called from here
app_log.debug("ANativeActivity callback {s} not available on {s}", .{ func, @typeName(App) });
^
./src/android-support.zig:213:19: note: called from here
invoke(activity, "onResume", .{});
^
./src/android-support.zig:212:75: note: called from here
fn onResume(activity: *android.ANativeActivity) callconv(.C) void {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:232:16: note: called from here
log(.debug, scope, format, args);
^
./src/android-support.zig:181:30: note: called from here
app_log.debug("ANativeActivity callback {s} not available on {s}", .{ func, @typeName(App) });
^
./src/android-support.zig:216:19: note: called from here
invoke(activity, "onPause", .{});
^
./src/android-support.zig:215:74: note: called from here
fn onPause(activity: *android.ANativeActivity) callconv(.C) void {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:232:16: note: called from here
log(.debug, scope, format, args);
^
./src/android-support.zig:181:30: note: called from here
app_log.debug("ANativeActivity callback {s} not available on {s}", .{ func, @typeName(App) });
^
./src/android-support.zig:219:19: note: called from here
invoke(activity, "onStop", .{});
^
./src/android-support.zig:218:73: note: called from here
fn onStop(activity: *android.ANativeActivity) callconv(.C) void {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:232:16: note: called from here
log(.debug, scope, format, args);
^
./src/android-support.zig:181:30: note: called from here
app_log.debug("ANativeActivity callback {s} not available on {s}", .{ func, @typeName(App) });
^
./src/android-support.zig:228:19: note: called from here
invoke(activity, "onWindowFocusChanged", .{(hasFocus != 0)});
^
./src/android-support.zig:227:104: note: called from here
fn onWindowFocusChanged(activity: *android.ANativeActivity, hasFocus: c_int) callconv(.C) void {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:232:16: note: called from here
log(.debug, scope, format, args);
^
./src/android-support.zig:181:30: note: called from here
app_log.debug("ANativeActivity callback {s} not available on {s}", .{ func, @typeName(App) });
^
./src/android-support.zig:234:19: note: called from here
invoke(activity, "onNativeWindowResized", .{window});
^
./src/android-support.zig:233:120: note: called from here
fn onNativeWindowResized(activity: *android.ANativeActivity, window: *android.ANativeWindow) callconv(.C) void {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:232:16: note: called from here
log(.debug, scope, format, args);
^
./src/android-support.zig:181:30: note: called from here
app_log.debug("ANativeActivity callback {s} not available on {s}", .{ func, @typeName(App) });
^
./src/android-support.zig:237:19: note: called from here
invoke(activity, "onNativeWindowRedrawNeeded", .{window});
^
./src/android-support.zig:236:125: note: called from here
fn onNativeWindowRedrawNeeded(activity: *android.ANativeActivity, window: *android.ANativeWindow) callconv(.C) void {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:232:16: note: called from here
log(.debug, scope, format, args);
^
./src/android-support.zig:181:30: note: called from here
app_log.debug("ANativeActivity callback {s} not available on {s}", .{ func, @typeName(App) });
^
./src/android-support.zig:249:19: note: called from here
invoke(activity, "onContentRectChanged", .{rect});
^
./src/android-support.zig:248:115: note: called from here
fn onContentRectChanged(activity: *android.ANativeActivity, rect: *const android.ARect) callconv(.C) void {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:232:16: note: called from here
log(.debug, scope, format, args);
^
./src/android-support.zig:181:30: note: called from here
app_log.debug("ANativeActivity callback {s} not available on {s}", .{ func, @typeName(App) });
^
./src/android-support.zig:222:19: note: called from here
invoke(activity, "onConfigurationChanged", .{});
^
./src/android-support.zig:221:89: note: called from here
fn onConfigurationChanged(activity: *android.ANativeActivity) callconv(.C) void {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:232:16: note: called from here
log(.debug, scope, format, args);
^
./src/android-support.zig:181:30: note: called from here
app_log.debug("ANativeActivity callback {s} not available on {s}", .{ func, @typeName(App) });
^
./src/android-support.zig:225:19: note: called from here
invoke(activity, "onLowMemory", .{});
^
./src/android-support.zig:224:78: note: called from here
fn onLowMemory(activity: *android.ANativeActivity) callconv(.C) void {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:195:16: note: called from here
log(.err, scope, format, args);
^
./src/egl.zig:24:24: note: called from here
std.log.err("Error: No display found!\n", .{});
^
./src/egl.zig:19:73: note: called from here
pub fn init(window: *android.ANativeWindow, version: Version) !Self {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:195:16: note: called from here
log(.err, scope, format, args);
^
./src/egl.zig:31:24: note: called from here
std.log.err("Error: eglInitialise failed!\n", .{});
^
./src/egl.zig:19:73: note: called from here
pub fn init(window: *android.ANativeWindow, version: Version) !Self {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:223:16: note: called from here
log(.info, scope, format, args);
^
./src/egl.zig:35:21: note: called from here
std.log.info(
^
./src/egl.zig:19:73: note: called from here
pub fn init(window: *android.ANativeWindow, version: Version) !Self {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:195:16: note: called from here
log(.err, scope, format, args);
^
./src/egl.zig:73:24: note: called from here
std.log.err("Error: eglChooseConfig failed: 0x{X:0>4}\n", .{c.eglGetError()});
^
./src/egl.zig:19:73: note: called from here
pub fn init(window: *android.ANativeWindow, version: Version) !Self {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:223:16: note: called from here
log(.info, scope, format, args);
^
./src/egl.zig:77:21: note: called from here
std.log.info("Config: {}\n", .{num_config});
^
./src/egl.zig:19:73: note: called from here
pub fn init(window: *android.ANativeWindow, version: Version) !Self {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:195:16: note: called from here
log(.err, scope, format, args);
^
./src/egl.zig:83:20: note: called from here
log.err("Error: eglCreateContext failed: 0x{X:0>4}\n", .{c.eglGetError()});
^
./src/egl.zig:19:73: note: called from here
pub fn init(window: *android.ANativeWindow, version: Version) !Self {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:223:16: note: called from here
log(.info, scope, format, args);
^
./src/egl.zig:88:21: note: called from here
std.log.info("Context created: {}\n", .{context});
^
./src/egl.zig:19:73: note: called from here
pub fn init(window: *android.ANativeWindow, version: Version) !Self {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:223:16: note: called from here
log(.info, scope, format, args);
^
./src/egl.zig:95:21: note: called from here
std.log.info("Screen Resolution: {}x{}\n", .{ android_width, android_height });
^
./src/egl.zig:19:73: note: called from here
pub fn init(window: *android.ANativeWindow, version: Version) !Self {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:223:16: note: called from here
log(.info, scope, format, args);
^
./src/egl.zig:100:21: note: called from here
std.log.info("Got Surface: {}\n", .{egl_surface});
^
./src/egl.zig:19:73: note: called from here
pub fn init(window: *android.ANativeWindow, version: Version) !Self {
^
./src/android-support.zig:160:22: error: container '.build_options' has no member called 'app_name'
build_options.app_name.ptr,
^
/usr/lib/zig/std/log.zig:128:21: note: called from here
root.log(message_level, scope, format, args);
^
/usr/lib/zig/std/log.zig:195:16: note: called from here
log(.err, scope, format, args);
^
./src/egl.zig:103:24: note: called from here
std.log.err("Error: eglCreateWindowSurface failed: 0x{X:0>4}\n", .{c.eglGetError()});
^
./src/egl.zig:19:73: note: called from here
pub fn init(window: *android.ANativeWindow, version: Version) !Self {
^
zig-gles2-demo...The following command exited with error code 1:
/usr/bin/zig build-lib /home/user/zat/ZigAndroidTemplate-master/src/main.zig -lGLESv3 -lEGL -landroid -llog -lc --pkg-begin build_options /home/user/zat/ZigAndroidTemplate-master/zig-cache/zig-gles2-demo_build_options.zig --pkg-end -ffunction-sections --libc /home/user/zat/ZigAndroidTemplate-master/libc/arm64.conf --cache-dir /home/user/zat/ZigAndroidTemplate-master/zig-cache --global-cache-dir /home/user/.cache/zig --name zig-gles2-demo --version 1 -dynamic -fcompiler-rt -target aarch64-linux -mcpu=generic+v8a -I /home/user/zat/ZigAndroidTemplate-master/src -I /home/user/Android/Sdk/ndk/21.1.6352462/sysroot/usr/include -I /home/user/Android/Sdk/ndk/21.1.6352462/sysroot/usr/include/aarch64-linux-android -L /home/user/Android/Sdk/ndk/21.1.6352462/platforms/android-29/arch-arm64/usr/lib -D ANDROID -fPIC --enable-cache
error: the following build command failed with exit code 1:
/home/user/zat/ZigAndroidTemplate-master/zig-cache/o/666e5446e07e99f433499102b29ef746/build /usr/bin/zig /home/user/zat/ZigAndroidTemplate-master /home/user/zat/ZigAndroidTemplate-master/zig-cache /home/user/.cache/zig
real 0m23.754s
user 0m21.258s
sys 0m1.950s
This error: container 'AndroidApp' has no member called 'init'
apparently happens because init()
got removed in commit e657b0b but maybe I'm misinterpreting this and it's just trying to use a completely different init()
which it didn't use before that commit but it's expecting to have.
EDIT: yeah it's definitely a different init()
because one has 3 args and one has none, so my bad.
Can you fetch a fresh install from latest zig master, as well as this repo and try building it again?
Closing this as outdated. Please open a new issue when it still persists.