We are trying to create Bahmni android app using the steps mentioned at following locations:
All of the commands in above url ran successfully.
Following are the issues we faced and resolved it:
Solution: We modified the code in config.xml. Changed
<content src="..." /> to
<content src="index.html" />
https://192.168.1.16/openmrs/ws/rest/v1/bahmnicore/sql/globalproperty?property=allowMultipleLoginLocation 404 (Not Found)
Solution: Added in head tag of index.html
Now, we are getting following attached error and would like to know if somebody faced it before:
Following are the version of various applications:
- Bahmni Connect, Bahmni Offline, Bahmni Config => 0.90
- Node => 6.13.0
- NPM => 4.6.1
- Cordova => 8.0.0
- Ionic => 3.19.1
- SDK Version => API 22 (Marshmellow)
- Build Tools Version => 27.0.3
We had certain doubts about the bahmni-connect apk compilation steps mentioned in
https://github.com/Bahmni/bahmni-offline README file
Particularly steps 8 and 9
After cloning the repo,I have the exact same copy as the one in github. If I run Step 8 it removes all the files and folders in bahmni-offline/android/platforms
After running Step 9, it adds new files and folders in bahmni-offline/android/platforms ,but they are not the same as the ones from before running Step 8.
Even the MainActivity.java in https://github.com/Bahmni/bahmni-offline/blob/master/android/platforms/android/src/main/java/org/bahmni/offline/MainActivity.java is different after running Step 9.
None of these folders and files are also present :https://github.com/Bahmni/bahmni-offline/tree/master/android/platforms/android/src/main/java/org/bahmni/offline
Because the this, we are getting the above error
The app is not able to find the files as they dont exist
If we skip Step 8 and try to build it as it is I get the following error : Unable to load PlatformApi from platform. Error: Cannot find module ‘/home/krishnanspace/Downloads/bahmni-offline-release-0.90 (2)/android/platforms/android/cordova/Api.js’
Can someone help us out.Thanks!
Edit:The newly generated MainActivity.java https://pastebin.com/RbyeYWkQ (edited)
Are you getting the same error with official build APK?
Hi @sumanmaity112 , we are not getting any problems with the official build.Its working as intended.Only when we are trying to compile the app on our own ,we are facing problems
Edit:By compile on our own,I mean that we have made some changes in Bahmni UI(dist folder) and want those changes reflected in the apk
Can you please try to install the following and try to rebuild
Thanks for your reply.
I installed the above specified versions,but for node I used v6.11.1 as there was no v6.11.10.
This is the error I get when I do “ionic build android” without doing “ionic platform remove/add android” :
After running "ionic platform remove/add android " when I run “ionic build android” I get an error saying that Android SDK is not found,even though I have set it.If I echo $ANDROID_HOME,I get the correct path as its output.
But I dont get this error when I use cordova v8.0.0.
Here is the pastebin for the error:
Thanks a lot @sumanmaity112 .The problem is solved after using reinstalling the above versions and building it.