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: github.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:08353c45-f7df-041b-8744-196ea0f7addb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ED16:22581D:732B51:A2C8E6:697B8C36 |
| html-safe-nonce | dc60d99c12e4e9f64eafed289778dc5dac51d7cf60d26909d46e59ce445bafc1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRDE2OjIyNTgxRDo3MzJCNTE6QTJDOEU2OjY5N0I4QzM2IiwidmlzaXRvcl9pZCI6IjczMjA0ODMyODIwMjgzMDEzNjYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | abfdd100930dd2b2d90b97de759cc69e796eb2f199679417ed5201c8e887a519 |
| 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 | 86b3730167656228ed8d24c4f0770806131d1f695bff36b9485630bb7443aa64 |
| 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 | 6adfecb5bc9d8f1aac645d1f3797aca9d302dd85 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width