Title: Android error: missing method body, or declare abstract · Issue #575 · nativelibs4java/nativelibs4java · GitHub
Open Graph Title: Android error: missing method body, or declare abstract · Issue #575 · nativelibs4java/nativelibs4java
X Title: Android error: missing method body, or declare abstract · Issue #575 · nativelibs4java/nativelibs4java
Description: I'm trying to run the Android example found in BridJ/Examples/AndroidExample. I am able to get dependencies resolved after downloading BridJ and using maven to build it successfully. I place the generated bridj-0.7.1-SNAPSHOT-andorid.jar...
Open Graph Description: I'm trying to run the Android example found in BridJ/Examples/AndroidExample. I am able to get dependencies resolved after downloading BridJ and using maven to build it successfully. I place the ge...
X Description: I'm trying to run the Android example found in BridJ/Examples/AndroidExample. I am able to get dependencies resolved after downloading BridJ and using maven to build it successfully. I place th...
Opengraph URL: https://github.com/nativelibs4java/nativelibs4java/issues/575
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Android error: missing method body, or declare abstract","articleBody":"I'm trying to run the Android example found in BridJ/Examples/AndroidExample. I am able to get dependencies resolved after downloading BridJ and using maven to build it successfully. I place the generated bridj-0.7.1-SNAPSHOT-andorid.jar in app/libs, and I place everything under BridJ/src/main/android-libs in app/src/main/jniLibs. I copy the files in BridJ/Examples/AndroidExample/ to my Android project. All of the BridJ dependencies are resolved.\r\n\r\nThe problem is that MainActivity won't compile. The error on \r\n\r\n`public static void helloLog(Pointer\u003cByte\u003e logThis);`\r\n\r\nsays \"Missing method body, or declare abstract\". If I declare the method to be native, then I get the following runtime error.\r\n\r\n`java.lang.UnsatisfiedLinkError: No implementation found for void yada.yada.yada.MainActivity.helloLog(org.bridj.Pointer) (tried Java_yada_yada_yada_MainActivity_helloLog and Java_yada_yada_yada_MainActivity_helloLog__Lorg_bridj_Pointer_2)`\r\n\r\n I haven't added or removed anything from MainActivity.java, but for what it's worth, I'm pasting the source for that below. Any ideas?\r\n\r\n\tpackage yada.yada.yada;\r\n\r\n\timport android.app.Activity;\r\n\timport android.os.Bundle;\r\n\timport android.util.Log;\r\n\r\n\timport java.io.IOException;\r\n\r\n\timport org.bridj.BridJ;\r\n\timport org.bridj.NativeLibrary;\r\n\timport org.bridj.Pointer;\r\n\timport org.bridj.ann.Library;\r\n\timport org.bridj.demangling.Demangler.Symbol;\r\n\r\n\timport static org.bridj.Pointer.pointerToCString;\r\n\r\n\tpublic class MainActivity extends Activity {\r\n\r\n\t\tstatic final String TAG = MainActivity.class.getName();\r\n\r\n\t\t@Library(\"example\")\r\n\t\tpublic static void helloLog(Pointer\u003cByte\u003e logThis);\r\n\r\n\t\tstatic {\r\n\t\t\tBridJ.register();\r\n\t\t}\r\n\r\n\t\t@Override\r\n\t\tprotected void onCreate(Bundle savedInstanceState) {\r\n\t\t\tsuper.onCreate(savedInstanceState);\r\n\t\t\thelloLog(pointerToCString(\"Hello, World!\"));\r\n\t\t\ttry {\r\n\t\t\t\tNativeLibrary lib = BridJ.getNativeLibrary(\"example\");\r\n\t\t\t\tfor (Symbol s : lib.getSymbols()) {\r\n\t\t\t\t\tString p = s.getParsedRef() + \"\";\r\n\t\t\t\t\tSystem.out.println(p);\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tthrow new RuntimeException(\"BridJ loading failed?\", e);\r\n\t\t\t}\r\n\t\t\tsetContentView(R.layout.activity_main);\r\n\t\t}\r\n\t}\r\n","author":{"url":"https://github.com/martinkbrown","@type":"Person","name":"martinkbrown"},"datePublished":"2016-12-12T14:07:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/575/nativelibs4java/issues/575"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f3eadb38-45cf-e87d-76a6-9a12a27a6906 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E600:259C87:17E3D56:208D5A4:697A9BA6 |
| html-safe-nonce | 82f0a96c927a85f1a4fcdb7a786266f672e809b61ca799d079f0a7adea941e34 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNjAwOjI1OUM4NzoxN0UzRDU2OjIwOEQ1QTQ6Njk3QTlCQTYiLCJ2aXNpdG9yX2lkIjoiMTYyODMyNjg1MzY0MDYyNTA2MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ff348d7a8b2819a6aa580d10a5926fe65a31da53e8d61c72c2d8e971487ee0fe |
| hovercard-subject-tag | issue:194982687 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nativelibs4java/nativelibs4java/575/issue_layout |
| twitter:image | https://opengraph.githubassets.com/10884a3cb242e6cd6457d72c89418a48ccc4bc8478812361f6296a0f074e01f2/nativelibs4java/nativelibs4java/issues/575 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/10884a3cb242e6cd6457d72c89418a48ccc4bc8478812361f6296a0f074e01f2/nativelibs4java/nativelibs4java/issues/575 |
| og:image:alt | I'm trying to run the Android example found in BridJ/Examples/AndroidExample. I am able to get dependencies resolved after downloading BridJ and using maven to build it successfully. I place the ge... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | martinkbrown |
| hostname | github.com |
| expected-hostname | github.com |
| None | f73c0dfa17dfe2bc934284d1387c1cedefe723d2133ede564feefd2cbeb98e55 |
| turbo-cache-control | no-preview |
| go-import | github.com/nativelibs4java/nativelibs4java git https://github.com/nativelibs4java/nativelibs4java.git |
| octolytics-dimension-user_id | 11545921 |
| octolytics-dimension-user_login | nativelibs4java |
| octolytics-dimension-repository_id | 2194042 |
| octolytics-dimension-repository_nwo | nativelibs4java/nativelibs4java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 2194042 |
| octolytics-dimension-repository_network_root_nwo | nativelibs4java/nativelibs4java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 58b9322bb0d01c6949be2239e39780fa702e604c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width