Nativescript sidekick error during cloud build - nativescript

I am getting a strange error from sidekick cloud build since a few hours ago.
I was building the app successfully, but all of a sudden, it gives me the following error and even reversing the changes does not fix anything. I have even tried with a fully working version of my git repo.
[19-01-28 16:55:27.709] Build step started.
[19-01-28 16:55:37.465] (CLI) Unable to apply changes on device: a754d27bafb8bb273e444b9d6cefd370cd55f4d4. Error is: Build failed..
[19-01-28 16:55:37.469] Error detected during LiveSync on a754d27bafb8bb273e444b9d6cefd370cd55f4d4 for C:\Users\Afshar\Desktop\myapp. Error: Build failed.
I doesn't give me any more details about the issue.
I was wondering if anyone knows how to get more logs in cloud build or if this is a known issue?
Thanks

It happens with me as well for reasons unknown. I couldn't find any root cause, but I did notice one pattern. It usually happens when I am already running the app on an Android Emulator/Device.
When we execute tns run android --bundle, it listens for file changes after the first build and does some webpack incremental build thing afterwards, right?
At the same time, once Sidekick delivers a successful iOS build, it also starts listening for changes to do the webpack incremental builds on iOS.
So while we have these two LISTENERS active and we request for another iOS cloud build, before Sidekick communicates with the cloud, it modifies some files which the android listener detects and results in an incremental android build, which in turn modifies some other files, which the iOS listener detects, resulting in Sidekick trying to do the incremental iOS build but this time its stuck between giving you the incremental update and the new requested cloud build, so it throws you this LiveSync error.
Moral of the story: Try to request cloud builds, when these listeners are inactive.

I finally managed to solve it.
In case anyone else faces this issue, I tried the following command using a hint on this page and it solved the problem.
https://docs.nativescript.org/troubleshooting
tns platform remove ios
and then, I was able to build the project in sidekick.

Related

Building a Xamarin app using a Dev-Ops pipeline, build completes, publish fails,

I have the following configured Azure DevOps pipeline which is building the Windows version of the Xamarin App, was going to try and get that one working first and the build works, but I'm getting an error in the publish, path not found, the 2 paths look fine but I guess this is down to me not building one of these before.
Build step which works fine
Publish artifact step which fails
The error that I get is as follows
Still trying to work out what I have got wrong, so I will keep going at it but if anyone
has any hints would be greatly apprecaited.
This thread as posted by Hongxin Sui was the solution for me, this is the thread.
Publishing build artifacts failed with an error: Not found PathtoPublish: D:\a\1\s\$(buildStagingDirectory)
However, what I did need to do was create a new YAML pipeline and I copied all the working steps in from the previous classic pipeline, I used the "Copy YAML" functionality and then I used the different Task as stated in that thread. Just make sure you change the case of the "Build" and "ArtifactStaging.." variable names as they need to be lower case not upper case.

AWS CodeStar code not propagated to the website

I have a AWS CodeStar Java Web application. I have a Route 53 domain which links to this application. Until yesterday, everything was working fine.
Yesterday, I was adding some new features and pushing them to the CodeStar repository. I didn't notice that four commits failed to build due to one issue. Today I noticed the failed builds and posted a new commit that fixes the issue. The commit was built and successfully deployed.
The problem is that the changes that I did in the commits that failed to build are not propagated to the web app. I can't see them on my website. I can open Developer tools and see that the source code is like it was before my changes.
BUT when I look at the code in AWS CodeCommit, all the changes are there. Included the changes I did in the commit that failed to build. The code is complete the same way I have it in my local machine.
What is the problem here? Why are the changes not propagated to the website if I can see them in CodeCommit? Do the failed builds have some negative effect here? What should I do to get my changes to my web app?
I wasn't able to figure out what the issue is, but I just created a new CodeStar project, copied the code from the old project to the new project and continued onwards with the new (working) project.

Why is Android Studio failing to build, with an AAPT2 error on images?

After a recent update, Android Studio fails to build an unmodified project with errors along these lines:
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> AAPT2 aapt2-4.1.1-6503028-linux Daemon #0: Unexpected error during compile '/path/to/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png', attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.
Notice that it's failing on an image supplied by Android Studio itself!
What can I do to fix it?
This seems to be an error in the newest (newer?) Gradle plugin(s) when it comes to PNG images; Google's IssueTracker lists several newly reported bugs along these lines. One of them mentions that it's a Gradle issue; I made mine work by reverting to a previous version: Gradle Plugin 4.0.1 and Gradle version 6.1.1 work fine.
It will be necessary to ignore AS' nagging about a newer version until this gets fixed.
[Added at the request of #YinOrYan]
To revert to an older version of Gradle:
In the menu, select "Files", then "Project Structure..."
In the dialog that pops up, select "Project" (first item in my version).
You can select the desired versions of the Gradle plugin and of Gradle from the drop-down menus.
This should not lose any system calls, as this is different from the SDK or API versions. However, it's not independent of them, so there is probably a limit to where you can set them.
As usual you will want to be online when you first build, or whenever you have to import a dependency, but otherwise it should be possible to work offline.
Sadly, it looks like an issue with older architectures. While the team at Google is looking into fixing it, in the meanwhile you can still use the new Android Studio and AGP, but temporarily revert to using an older version of AAPT2:
Try locating the old aapt2 executable in your gradle cache, e.g.:
~/.gradle/caches/<subdirectories, hashes
etc>/aapt2-4.1.0-alpha03-6246747-/aapt2(.exe)
Once you have the path you can add to your gradle.properties file:
android.aapt2FromMavenOverride=path/to/old/aapt2
To make this a little bit more robust you can actually copy that executable to a non-cache location, in case you clean your caches and it dissapears.
Hope this helps! Keep an eye on the Issue Tracker bug for updates.
I also had the same problem with AAPT2 errors and I have got over it.
First, downgrades Gradle to version 4.0.1, or
Second, I have done is upgrading the AMD Athlon processor to AMD FX-4300 without downgrading the gradle plugin version.
Wow, that's a real show-stopper! Can you explain how you reverted to an older gradle in Android Studio. Is it possible to work offline after doing this. And, did you lose any of the new system calls as a result? All this going on after finally getting my code working with the new AR Core stuff...

Build failed with CrashlyticsOrgIdException

I just integrated the new Firebase SDK following these instructions:
https://firebase.google.com/docs/crashlytics/get-started-new-sdk
It's working with debug builds, but I get this exception on release build:
java.io.IOException: com.google.firebase.crashlytics.buildtools.exception.CrashlyticsOrgIdException: Could not fetch Crashlytics Org Id
Any idea?
I was having the same error when trying to build a release APK, but it wasn't going away.
I realized that you need to generate at least one crash in Firebase Crashlytics before your Org Id becomes available.
After my first crash was visible in the Firebase Crashlytics Report page, release build started working.
So, make sure to follow the Firebase doc and run a test crash in debug before you try to build release.
There seems to be a bug with the new firebase crashlytcs SDK where the Org Id is not generated unless the app is run with the firebase crashlytcs set up.
I followed the older sdk documentation which uses Fabric and ran the app with that. This is the older doc : https://firebase.google.com/docs/crashlytics/get-started?platform=android
Update to the new crashlytics SDK then and the project should build for you now. This is the new doc : https://firebase.google.com/docs/crashlytics/get-started-new-sdk?platform=android
You need to go through all steps in Firebase web console in Crashlytics section until you'll see:
Build and run your app
We'll be listening for your app to communicate with our servers.
Then you can build an apk.

How to use ServiceCore framework from salesforce in a Xamarin forms app?

I am getting a warning in my console when I try building the app in Release configuration. The warning reads The ServiceSDK frameworks have not been prepared for release.
Please ensure the "prepare-framework" script is run after the "Embed Frameworks" build phase.
From the documentations, I understand that a build phase script has to be run to fix the issue.
Here is how I use the framework in my solution:
I am creating a binding library which refers the framework through a Native Reference. Then I run the library project and build a .dll with I use in the iOS project within my Xamarin forms application. All this is working fine. I am able to use the intended features from the framework.
However, there is this warning which appears in the console when I run the App in Release configuration. Also, when I tried submitting the App to App Store, it throws error, which is apparently the same mentioned above.
I tried by adding Custom commands which I think is the equivalent of Xcode build phase scripts, but the warning doesn't simply go away.
Any help would be really appreciated.
Sample Repos - https://github.com/XamarinUniversity/ENT302
Youtube Video Link - https://www.youtube.com/watch?v=HEypPXVoYnY&feature=youtu.be
Gudie Here - https://xamarinuniversity.github.io/ENT302/

Resources