Build failed with CrashlyticsOrgIdException - crashlytics-android

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.

Related

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/

Is there a recommended way to distribute iOS apps to testers prior to publishing on the app store?

I need to distribute my apps to testers prior to submitting them to the store(s). Nativescript builds an apk file that is easily distributed to Android testers. Is TestFlight the recommended way to distribute iOS apps? And should I use the xcode project file to build the app in Xcode in order to submit it to TestFlight. That method seems counter intuitive.
Yes, ideally you would use TestFlight. It's also a perfect way for you to test your distribution build/signing etc since you would upload the exact same build that will end up on the App Store. In fact, if your testing goes well with your users, you can submit the same build that you've already uploaded for TestFlight to the reviewers for the App Store, you don't even need to upload a new build.
As #Dave Wood mentioned, yes, TestFlight should be the way to go forward as you do not need to re-build the app to submit for review to Apple.
Answer to your next question should I use the xcode project file to build the app in Xcode -
No
You can use the below commands to build and publish app to Apple store.
From the root folder of your app
tns build ios --release --for-device --bundle <Your Provision Profile>
this will show the path where it has created the .ipa file, then
tns publish ios --ipa <.ipa file>
this will ask your Apple ID and App Specific password and will process the actual App based on your appid mentioned in your package.json.
You can change the app version and App name in info.plist inside App Resources->ios folder.
Thanks. I realized this was the answer after I posted the question. I'm new to NativeScript, but not to iOS development. It occurred to me that once the app is uploaded to App Store Connect, I still control the activities of either posting or setting up TestFlight. Thank you.

How do I upgrade Android native app to new version based on NativeScript while keeping data from old app?

I want to update an existing Android app (not made with NativeScript), with a new one (made with NativeScript).
The old app stored some user data in a SQLite database. I want this to survive the upgrade.
Now, I have the same app-id in the new app, as the old, so that part is in place. To test if the database survives though, I have started the Android Emulator with the old app, created a few records, then published the native script version using
tns run android --bundle --device=1
and this correctly replaces the old app with the new code, but at the same time it seems to wipe the database, which is otherwise correctly stored in /data/data/app-id/databases
Is this due to the tns deployment for debugging possibly starting out wiping the system, or something else ?
How do you guys test this?
Edit: Apparently the uninstalling after each compile, rather than upgrading is a known thing, tracked in their Github as issue #3382
tns run android --bundle produces a development version of APK which would not match the signature of your production version of APK built with native Android.
If you use the same signing certificate you used for the production native app while running app / building your {N} version of APK, then you will survive the upgrade by default.
So your command may look like
tns [build|run] android --bundle --release --keyStorePath /path/to/keystore --keyStorePassword keystore-password --keyStoreAlias keystore-alias --keyStoreAliasPassword keystore-alias-passwrd
Read more on docs.
Edit: CLI seems to have a known issue with tns run, instead of replacing the APK, it deletes the old version and installs new version. So it should not be a problem when you publish the APK built with tns build. Credits to #DimitarTachev.

Nativescript sidekick error during cloud build

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.

Google iOS SDK fails to archive (use of undeclared identifier errors)

I have attempted to archive my project for submission to App Store, however, every time I get errors "use of undeclared identifier" for everything related to google iOS SDK. The application itself runs and builds flawlessly with the discussed SDK integrated, the only thing that fails is the archive process. I have tried both cocoa pods and manual method of integration (separately, of course). Furthermore, I used the latest xCode versions (6.4 and 7 beta 4) on two different macs running OS X 10.10.4. This is the guide I have been using.
Your issue has something to do with the configuration of archiving in combination with your Release settings. If you change the scheme settings Command + < to use the Debug configuration for archiving, you may be able to successfully archive your app. This means that somewhere you are probably not matching the Debug and Release configurations.
See the following screenshot for example project Build Settings that are missing the Swift bridging header in release:
Add bridge.h to the release configuration and you will be able to build with the Release schema and you will be able to archive under release configuration.

Resources