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

Issue with parsing APK #76

Closed
Darkhax opened this issue Oct 2, 2016 · 13 comments
Closed

Issue with parsing APK #76

Darkhax opened this issue Oct 2, 2016 · 13 comments
Assignees
Projects
Milestone

Comments

@Darkhax
Copy link
Contributor

Darkhax commented Oct 2, 2016

I am currently trying to run a unit test of sorts on android using the Silence Engine, however I get a parsing error when I try to install the app. This happens with all 3 generated APK files. Could you test and see if it's an issue with the apk? download

As for what the app actually does, it runs 12 tests on the device, which time how long Oracle's Random takes to generate large amounts of various things, and then compares it against my implementation of Random, and a friends alternative version. This test is pretty taxing on the CPU, so I wouldn't recommend running it past a few seconds.

Edit: The specs of my device should be able to hit Silence Engine's minimum. It's an Asus Zenfone 2 ZE551ML running Android 5.0.

@sriharshachilakapati
Copy link
Owner

Installing this package gives me this on the terminal through ADB.

adb install SilenceCommonsAndroid-release-unsigned.apk
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
284 KB/s (1255765 bytes in 4.312s)
        pkg: /data/local/tmp/SilenceCommonsAndroid-release-unsigned.apk
Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]

This is because unsigned APKs cannot be installed on a real device. SilenceEngine apps cannot run in an emulator because of the requirement of OpenGL ES 3.0, and hence your APK cannot be installed and run.

You want to self sign your apk in order for it to get installed on a device. If it is for your own testing, use debug builds, or better use desktop backend while development and test it on android after everything is working.

@Darkhax
Copy link
Contributor Author

Darkhax commented Oct 2, 2016

Thank you for pointing out all of the earlier issues. After correcting them, I am still having the parse issue however. Using adb I get the following response.

C:\adb>adb install xor.apk
7309 KB/s (1286401 bytes in 0.171s)
        pkg: /data/local/tmp/xor.apk
Failure [INSTALL_FAILED_OLDER_SDK]

Not sure if this is related to the device or the PC. The new download is here. As for testing, this application was created for the sole purpose of testing the performance of certain code on physical devices, so the desktop edition is not accurate enough.

@sriharshachilakapati
Copy link
Owner

Dunno, but it installed fine, but it failed to run.

C:\Users\Harsha\Downloads> adb install xor.apk
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
289 KB/s (1286401 bytes in 4.342s)
        pkg: /data/local/tmp/xor.apk
Success

@sriharshachilakapati
Copy link
Owner

I have got some logcat output for you, and it seems that you are calling SilenceEngine methods before they are initialized.

E AndroidRuntime: FATAL EXCEPTION: GLThread 1723
E AndroidRuntime: Process: xyz.epoxide.silencecommons.android, PID: 2062
E AndroidRuntime: java.lang.ExceptionInInitializerError
E AndroidRuntime:        at xyz.epoxide.silencecommons.android.SilenceCommonsLauncher.launchGame(SilenceCommonsLauncher.java:15)
E AndroidRuntime:        at com.shc.silenceengine.backend.android.AndroidLauncher$$Lambda$1.invoke(Unknown Source)
E AndroidRuntime:        at com.shc.silenceengine.backend.android.AndroidWindow.onSurfaceCreated(AndroidWindow.java:51)
E AndroidRuntime:        at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1503)
E AndroidRuntime:        at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'com.shc.silenceengine.logging.Logger com.shc.silenceengine.logging.ILogDevice.getLogger(java.lang.String)' on a null object reference
E AndroidRuntime:        at xyz.epoxide.silencecommons.SilenceCommons.<clinit>(SilenceCommons.java:23)
E AndroidRuntime:        ... 5 more
E AbstractTracker: Can't create handler inside thread that has not called Looper.prepare()

The device objects in the SilenceEngine class will be null until you call the runtime, and it is that you are using the logger before the engine is initialized, that is in the launchGame method. This is why your app is failing to launch.

@Darkhax
Copy link
Contributor Author

Darkhax commented Oct 2, 2016

After digging into things a bit further, I think I have found the source of the issue. By default Silence Engine sets the minimum SDK to 22, however Android 5.0 is SDK 21. I went through the gradle script to manually lower the minimum SDK (Since 5.0 was listed as the lowest android version required) however I got the following issue.

* What went wrong:
Execution failed for task ':SilenceCommonsAndroid:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 21 cannot be smaller than version 22 declared in library [:backend-android-debug:] C:\Users\darkh\Desktop\Workspace\SilenceCommons\SilenceCommonsAndroid\build\intermediates\exploded-aar\backend-android-debug\AndroidManifest.xml
        Suggestion: use tools:overrideLibrary="com.shc.silenceengine.backend.android" to force usage

@sriharshachilakapati
Copy link
Owner

Will fix that by tonight. The same thing also happens with AndroidOpenAL project which is a dependency of android backend. Will change every thing by tonight.

@Darkhax
Copy link
Contributor Author

Darkhax commented Oct 3, 2016

Okay, thank you for looking into this. I will hold off on updating to 6.0 until then, so we can confirm that the issue has been solved.

@sriharshachilakapati
Copy link
Owner

I have reduced the minimum Android SDK to 21 (Lollipop). Can you try it now again?

@Darkhax
Copy link
Contributor Author

Darkhax commented Oct 4, 2016

After re-downloading the project creator and making a new project, the sdk version was set to 22 by default. After changing it, I got the same error as before.

https://gist.github.com/darkhax/8507b7a9a680c7cf35ae6da2a0db444b

@sriharshachilakapati
Copy link
Owner

I haven't yet updated the binaries in the project creator, in the sense that the project is not a released version. Please compile it yourselves and replace the library files.

@Darkhax
Copy link
Contributor Author

Darkhax commented Oct 5, 2016

I can't compile it myself if you do not push the code to GitHub.
Edit: Thought you meant compile the project creator myself.
Edit 2: The default render tests installed and runs fine.

@sriharshachilakapati
Copy link
Owner

Did you get this working? In that case, this can be closed.

@Darkhax
Copy link
Contributor Author

Darkhax commented Oct 8, 2016

Yes, this change fixed my issues. Was able to run the test apps from silence fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
1.1.1
DONE
Development

No branches or pull requests

2 participants