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

x/mobile/app: library not working on Asus TPad TF300T #10878

Closed
mokiat opened this issue May 16, 2015 · 2 comments
Closed

x/mobile/app: library not working on Asus TPad TF300T #10878

mokiat opened this issue May 16, 2015 · 2 comments
Assignees
Milestone

Comments

@mokiat
Copy link

@mokiat mokiat commented May 16, 2015

Hi,

I have created a gomobile library for Android and am trying to use it as part of an Android application by importing it as an aar file. I have set up the tip of Go in order to have 1.5 so that I can use the gomobile tool.

The Application successfully starts on a Nexus 5 device running Lollipop but fails to run on an Asus Transformer Pad TF300T running Jelly Bean 4.2.1. According to documentation API 9 and above are supported, so API 15 should not be a problem.

Following is the error messages I get on the console.

05-16 23:44:36.780    3121-3140/? I/Go﹕ app.Run
05-16 23:44:36.780    3121-3121/? I/GoLog﹕ app.Run called
05-16 23:44:36.790    3121-3140/? W/dalvikvm﹕ Invalid indirect reference 0x414c1a38 in decodeIndirectRef
05-16 23:44:36.790    3121-3140/? E/dalvikvm﹕ VM aborting
05-16 23:44:36.790    3121-3140/? A/libc﹕ Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 3140 (chil.libexample)
05-16 23:44:36.820    3121-3121/? D/libEGL﹕ loaded /system/lib/egl/libEGL_tegra.so
05-16 23:44:36.820    3121-3121/? E/﹕ file /data/data/com.nvidia.NvCPLSvc/files/driverlist.txt: not found!
05-16 23:44:36.820    3121-3121/? I/﹕ Attempting to load EGL implementation /system/lib//egl/libEGL_tegra_impl
05-16 23:44:36.830    3121-3121/? I/﹕ Loaded EGL implementation /system/lib//egl/libEGL_tegra_impl

Any idea what could be the problem?

What's interesting is that the basic example in the gomobile examples runs on both devices. However, the artefact is an APK and not a library so it might have a different lifecycle.

Following is how my onCreate method looks like. This is the only go library related code I have. I have commented out any calls to the library's functions in my MainActivityGLRenderer so it's just the loading of the library in this class.

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.home_activity);

        // ASUS: armv7l
        System.out.println("### Running: " + System.getProperty("os.arch"));

        // Loads the library
        Go.init(getApplicationContext());

        glSurface = (GLSurfaceView)findViewById(R.id.gles_view);
        glSurface.setEGLContextClientVersion(2);
        glSurface.setRenderer(new MainActivityGLRenderer());
    }

Regards,
Momchil

@rakyll rakyll changed the title Go mobile library not working on Asus TPad TF300T x/mobile/app: library not working on Asus TPad TF300T May 16, 2015
@mokiat
Copy link
Author

@mokiat mokiat commented May 23, 2015

I modified the basic example locally and made it use the same implementation. It turned out that my shaders lacked the following line:

precision lowp float;

That would cause the app to crash on the tablet without any warning/error whatsoever. Still, that would not explain why the app was crashing when I was just loading the library without calling any methods on it. (Hence not executing any OpenGL calls).

Even worst (or maybe best), I managed to get it to work somehow, though I am not sure how. Any of the following might have happened.

  • After commenting out the usage of the library methods, the change might not have gotten through to the app, so it might have failed due to the shader issue previously.
  • I might have had some old artefacts in the pkg directory, that were compiled with the old 1.4 Go GOOS=android mechanism, which eventually got updated. This is really just a wild guess.

I don't have access to the tablet right now, but when I do, I will do some experiments with it and if I cannot reproduce the issue, I will close it.

@ianlancetaylor ianlancetaylor added this to the Unreleased milestone Jun 3, 2015
@mokiat
Copy link
Author

@mokiat mokiat commented Aug 22, 2015

Cannot reproduce anymore. Works fine with Go 1.5.

@mokiat mokiat closed this Aug 22, 2015
@golang golang locked and limited conversation to collaborators Aug 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.