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: bind/java/seq_test.go cannot find aar on latest android studio #10668
Comments
Same problem here. |
@crawshaw : I could reproduce the problem myself. The class files are in the apk (so, Go.init was called) and could be found from the app package but not from bind/java package. It seems that when find_class is called from the Go thread, a wrong class loader was picked up. Verified with logging the exception details. http://developer.android.com/training/articles/perf-jni.html#faq_FindClass I will try to cache the loader or class from JNI_OnLoad as recommended in the doc. @timcooijmans Is the problem related to the bind/java/seq_test.go? In seq_test.go setup, go.Seq is in build/intermediates/exploded-aar/testpkg/classes.jar. |
@hyangah I'm seeing exactly the same problem in other projects. However both in seq_test.go and in my project I was surprised to see that the go-related Java-class-files were not present during gradle-building in the intermediate/classes directory. I expected them there but maybe I am wrong on that. |
This allows the application class loader to be used when the bind/java package or other part of JNI dynamically loads java classes from a non-Java thread. http://developer.android.com/training/articles/perf-jni.html#faq_FindClass Fixes golang/go#10668. Change-Id: I44df3a9362617fa6dd26ddf88247e4fdaee7c7e8 Reviewed-on: https://go-review.googlesource.com/9732 Reviewed-by: David Crawshaw <crawshaw@golang.org>
This allows the application class loader to be used when the bind/java package or other part of JNI dynamically loads java classes from a non-Java thread. http://developer.android.com/training/articles/perf-jni.html#faq_FindClass Fixes golang/go#10668. Change-Id: I44df3a9362617fa6dd26ddf88247e4fdaee7c7e8 Reviewed-on: https://go-review.googlesource.com/9732 Reviewed-by: David Crawshaw <crawshaw@golang.org>
When running go test, adb logcat reports:
It looks like go.Seq is in the testpkg.aar, but gradle is not making it part of the apk.
The text was updated successfully, but these errors were encountered: