-
Notifications
You must be signed in to change notification settings - Fork 34
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
Build for Android and iOS #475
Comments
ok so now I am trying to build the "basic" app from when we forked from master without any changes. Trying to run a build will result in:
This seems to be a known problem, see this post: So now I'll downgrade to cordova 8.1.0 and try again |
Actually I didn't downgrade but instead did what the error said, which was to remove the mentioned instances of Also, I get now that, of course, the correct order is to build first and then the sign_and_align_keys script will have something to work with. After a lot of bouncing around, understanding the sign_and_align_keys script and removing webwalk plugin, I finally got the signed apk but still stuck in the loading screen, forever spinning the spinny loader. |
ah yes, it seems I missed pretty much the entire lower part of the readme^^where it says to install cordova 8 and the http ios hook |
so if you use the lower part of the README, are there still any pending issues?
|
yes definitely. It seems some configuration in package.cordovabuild.json is not working. I am always working on the latest master on the official repo now, just to make sure the build works on the original code. I download it, configure, do npm and bower install etc. Then, I wanted to execute the cordovabuild configuration but it causes the following problems:
Now, I will just stay with the "serve" configuration and try to build the debug apk from there |
You cannot build an apk with the 'server' configuration because it does not list the required plugins. |
This is almost certainly related to the incorrect npm version. Please make sure that the versions exactly match the versions listed in the README. |
ok. Then I'll get a fresh checkout from master again and build the "cordovabuild" version from the start. Maybe it's just a problem if you do npm install with the package.serve.json Alright, I'll try to get exactly the correct npm version |
Note that the npm version error was previously reported in #290, and I gave the exact same response. You might want to look at prior issues to resolve the errors that you see. |
I run into the same issue I had before while trying to run cordova prepare / platform / build:
Also, I noticed that in "cordovabuild", the command |
Yes,
This looks like it is related to the new i18n code. |
That file definitely exists. What happens if you run the script manually? |
Simple mistake. The file didn't have execute permission, sorry about that. Ok, let's see if I can proceed to build now |
Note that you probably also want to actually generate a german translation at some point. Thanks to @DO3B for building the i18n framework that makes it easy to do this! |
Maybe it should be executable by default. Would be great if you could submit a PR for that too 😄 |
ok now this is the most recent problem amongst others:
this is probably because the android platform folder is "out of the box" with an older version of the build tools. I will try removing the android platform and re-adding it with cordova |
Ok so I literally cannot build the latest master commit for Android (haven't even tried iOS yet) which is, as far as I can tell, due to a ton of deprecated dependencies like Java 6, location services 11, gradle 2 and so on and so on and there is no telling, in how many places I will have to replace those to get the build running. Hence my question: Is any one of you able to build the current latest commit on master for the e-mission-phone? Here is the specific list of steps I go through:
cd into your project folder, wherever you cloned into
12.2) then some more cocoa iOS setup stuff:
I’m assuming the gradle version in line 50 must be updated accordingly: Also change the distribution URL as mentioned here: https://stackoverflow.com/questions/37125496/cordova-build-changes-distributionurl-in-gradle-wrapper-properties-file
I have also tried to upgrade the google play location and auth services versions and upgrading the Jsva version to 8 in build.gradle: I couldn't tell from the error output whether that helped or not. Also, I was wondering, what does this mean? Here is my current error output that I get using the steps described above, in case that helps. I cut out the first couple hundred lines, since they seemed to repeat the same errors but I can maybe paste them into an external tool like pastebin if that helps.
|
@st-patrick I just rebuilt from a freshly checked out copy of master.
However, on
I have not seen this error before, but I have also not rebuilt since after the i18n changes that @DO3B checked in. Let me see if I can figure out how to fix it. |
You should not need to upgrade the google play location and auth services versions since the error is in gson.jar, which is only used by data collection. |
This appears to be an issue with using java 1.8 instead of java 1.6 (https://stackoverflow.com/questions/47136718/errorcom-android-builder-dexing-dexarchivebuilderexception-failed-to-process-g). I think this means that the the dependency ( However, all our code uses java 1.6. I see that you also found this and tried to fix it with
But the gradle files are autogenerated! Since this is a cordova app, everything in
I would say that the safer option is to downgrade |
Looks like it was 2.8.5, not 2.8.6.
|
After forcing the use of 2.8.5, the compile works.
|
I forced the use of 2.8.5 by changing this line of the plugin.xml
and manually removing and re-adding it
This explains why @PatGendre and I haven't seen this before, it is related to a minor release update in the gson library that was released in Oct (https://github.com/google/gson/releases/tag/gson-parent-2.8.6) If you use the same steps, you should be able to fix the build. I will release a new version of the plugin with this fix, but I don't have the time to do so right now. In particular, I have other partially pending changes for that plugin, and I don't remember which I have checked in and which I have not. And I have other higher-priority tasks that I must complete before mid-December. If you urgently need an official update before then, we may be able to get @sunil07t to work on this for an hourly fee. But no guarantees, since he may be busy too. |
Hi! All 3 APKs are now generated and as far as I can tell also signed and aligned with the given script. Nevertheless, none of them install on my Samsung Galaxy S8+ or on my Android Virtual Device, which is the standard Nexus 2. The installation simply ends with "App could not be installed" At this point I really wouldn't even know where to look for the error anymore. I would assume, though, that it has something to do with the build settings and not the app itself, since I was able to create an installable (yet not functional, since it lacked all plugins) apk yesterday from the "serve" app. I also do not get any error message while trying to install. Maybe I can access a sort of AVD console somehow to see more output, I'll look for that. |
ok, so I switched to a public version of the "serve" version and so that'll work with Android but trying to build the devapp for ios, I get errors:
|
it seems this is a bug with the old cordova-ios version: apache/cordova-ios#647 is it safe to upgrade this? |
If you are OK with supporting only Lollipop+ then you only need one apk.
Install from the command line (e.g. |
I explored using the newer version of cordova earlier (in #437), but as you can see, then the ionic deploy plugin fails. So if you need to upgrade to cordova-ios@5.0.0, I would suggest removing the ionic-deploy plugin and then everything should work. That issue has the list of other minor fixes I needed to make to get it to work with cordova-ios@5.0.0. Note that several of the build issues listed in the README disappear with the migration to cordova-ios@5.0.0, so it is a good change overall. I just don't have the time right now to do it right and update all the docs. |
Alright I will soon look into the adb debugging. Regarding ios, I tried installing the newest .app release from em-devapp repository with the Apple Configurator 2, but it didn't work on our iPhone 6 with iOS 12. I tried signing it with our certificates, too but to no avail. Is there anyone who can currently build the em-devapp on their system and could provide a newer .app file? |
em-devapp works fine on the emulator, but prior users who have tried to deploy using the configurator were unsuccessful as well. Which is why the devapp README doesn't give instructions on how to deploy the When I test on a physical iPhone, I rebuild the app from scratch and deploy directly from xcode. That is the only mode that is known to work. |
Note also that the phonegap-devapp, which is what e-mission-devapp is based on, does not even release a If you do figure out how to make it work with the Apple Configurator, please send a PR with the exact instructions... |
I just tried to create a Testflight project for the iOS devapp. It says that the id edu.berkeley.eecs.emission.devapp already exists (makes sense). Is there any way you could provide us the iOS em-devapp via Testflight? We need to deploy a working version for iOS and since the builds are not working out of the box right now we are looking for any other way to be able to distribute to an alpha tester group. |
also, if that is not an option, can you provide the last commit that you built for iOS on? That way I can try to rebase our changes to that commit and hopefully build from there. |
The issue is not with updates to the code, but with updates to xcode and the underlying dependencies, similar to the android issue that you reported earlier. Native compilation is extremely dependent on exact versions as you saw earlier. Using the most recent versions will not work. Note that README says:
You probably have Xcode 11 and Catalina, which has even more incompatible changes. Using an older version of xcode should resolve these issues. I can't currently run my xcode because I don't have enough disk space 😦 , but I seem to have version 10.3 installed. You could try with that version and the checked in cordova-ios and see if it works. @PatGendre can you ask Yann what version of xcode he used? @jf87 do you remember which version of xcode you used to build the app? |
Alternatively, you can upgrade to cordova-ios@5.0.0 according to the instructions at #437 and that should work more smoothly. |
ok so the problem with the apk was that the dependencies were conflicting with em-devapp. I remembered this from emission conflicting with devapp but didn't think it would matter once I changed the package name. It did, though, this was the error output from adb install:
So far I was able to build the master commit we built on so I should be able to build our own commit, too. After that only iOS is left as problem (again^^) |
wrt provider conflict, you need to make the changes at #406 |
@shankari @st-patrick FYI we currently use Xcode V 10.2.1 |
Regarding xcode issues. I solved the issues before with using multiple xcode versions. One to move the code to the new Swift version and another to then open the same project and compiling it for new iOS targets. However, the last time I wanted to create a build I ran into some other issues and because there was no immediate need for us to have a new build, I kind of put solving this off for now. Generally, I feel that the build process is a bit hard to control from my side. I am no expert on cordova and iOS/Android builds, so I always struggled a bit when I created a new build for various reasons. In the future, we might think about how to improve this---if possible ;-) |
I think that the way to improve this in the future is to have proper automated builds and dedicated maintenance resources. On every new release of xcode/OSX, the maintenance person would check the automated build and fix all issues (likely to be minor) until the build succeeded again. Unfortunately, we don't currently have such a maintenance person due to lack of funding. I hope that orgs that rely on e-mission can make some contributions towards ongoing maintenance. The idea is that the community pools its resources to keep the software up to date. This can be either monetary contributions (to hire a maintenance person) or code contributions in terms of PRs. |
Yes, fully agree. |
@st-patrick you have three options for iOS
Once you have it working, please submit a PR with the fix 😄 |
@st-patrick any updates on this?
I forgot to ask you earlier - have you tried using a custom skin with emTripLog? LMK if you would like me to create a branch for you. |
I haven't had the chance yet because we are now focusing on finishing up a stable Android version but I will get back to you as soon as we start working on iOS again. |
I explicitly changed the message on shankari/e-mission-phone@f5b9a7f so it wouldn't auto-close it. But github closed it anyway. |
This packages all the correct build dependencies and makes it less likely to have issues similar to e-mission/e-mission-docs#475 (comment) or e-mission/e-mission-docs#290
Not all issues are resolved! |
Fixed in e-mission/e-mission-phone#707 |
Hello!
The time has come and we are trying to run our first build.
So far, I've been trying to follow whatever instructions I was able to find and started by creating android keys and changing the package id to ours (com.mcqdev.emission) as well as setting the version code back to 1.
Then I ran ./bin/sign_and_align_keys.sh which didn't really work I guess.
After that, I read a little bit and then followed with the commands
The commands failed at first but after changing minSDK in config.xml to 19 (which was explained in the error output) and also removed the following line in config.xml, which kept causing the build to fail since it couldn't be found anywhere. also, I couldn't find any similar named file in the entire project, so I decided to delte this line:
<hook src="package-hooks/ios9_allow_http.sh" type="after_prepare" />
Now I got the apk built (finally^^) but it's forever stuck in loading screen. The inspector tells me that cordova_plugins.js couldn't be found. It's probably because I changed the organisation name in package.json, too which was probably not correct.
I'll keep this issue open until I get all the builds for android and ios done, since I couldn't really find a good step by step documentation of building in the docs so far
The text was updated successfully, but these errors were encountered: