Crashlytics native crash symbols for multiple modules - crashlytics

I was hoping to find some additional information about the mechanics of the symbol upload. Specifically, symbol upload for multi-module projects.
Suppose I have a project with the following structure with external native dependencies:
- library_1
- jniLibs
- lib1.so
- library_2
- jniLibs
- lib2.so
- app
The entry point is the app module, which contains the build.gradle file.
The first question is, can I independently run the symbols upload gradle task on each of the modules via the crashlytics {} gradle DSL? I.e by swapping out the relative paths to the androidNdkOut, androidNdkLibsOut, manifestPath?
The second question is, are uploaded symbols overwritten on every task run? I.e if I run symbols upload on lib1.so and then on lib2.so are the symbols for lib1.so removed?
Finally, where can I view the symbols that have been uploaded?

Related

HelloWorld in Kotlin gives error "Could not find or load main class"

I spent the last 1,5 hour trying to make this simple tutorial work in IntelliJ IDEA, as you can see in this video.
When trying to run the code, I get the error:
/[...] -Dfile.encoding=UTF-8 src.HelloKt
Error: Could not find or load main class src.HelloKt
Caused by: java.lang.ClassNotFoundException: src.HelloKt
I have tried setting up SDK, invalidating cache, removing .idea and .gradle, rebuilding project, deleting the profile and adding it again. I tried those actions in different orders.
Here's a screenshot of the project:
It also complains Kotlin is not configured, but I have already configured it.
Here's the run configuration:
Here are the project settings:
Your Hello.kt file needs to be somewhere inside the src/main folder, probably in src/main/kotlin. This is different from the tutorial, because your project is using Gradle, and the one in the tutorial isn't. I think this is because newer versions of IntelliJ use Gradle by default for new projects, which wasn't the case when the tutorial was written.
The use of src/main/kotlin and src/test/kotlin as source code directories is a convention in Gradle (and Maven). When importing a Gradle project into IntelliJ, main becomes a module, and kotlin becomes a source folder within that module. The same goes for test. In your screenshots, the bold text and blue icons on main and test confirm that's how your project is set up. Files outside of those folders aren't treated as source files, which explains why your Hello.kt file isn't being compiled or recognised correctly.
It's likely that the default behaviour of IntelliJ when creating a new project has changed since this tutorial was written. In the tutorial, they select "Kotlin" as the project type and this creates a project that doesn't use Gradle. As a result, the project doesn't use the src/main/kotlin directory structure.
I can see from your video that you selected the same option, but on the next screen, IntelliJ still automatically selected Gradle as the build system for the new project. To match the project structure used in the tutorial, I think you would need to select "IntelliJ" as the build system.

Calling *.aar files (android library) in nativescript vue

I already create an .aar (android library) files in android studio and want to call/use it in nativescript-vue project.
I have placed the aar file in "app/App_Resources/Android/libs" folder.
Based on my reading, in typescript the way to call the method in aar files is by calling com.package.MyClass.
My question is , how to call it in .vue files. I have tried to call the method using the same approach but its produce an error :
Module not found: Error: Can't resolve com.package.MyClass
Can someone please help me on this.
Your help is very much appreciated.
You may simply place your AAR file in your App_Resources/Android/libs directory, CLI will pick it up at build time and the native APIs should be available at runtime within your project.
Try a clean build if you see errors, make sure the AAR is picked up. You might be able to verify it from the CLI logs. If you still see issues, make sure the class you are trying to access is public.
I'm not sure it's possible to use the android lib directly in the main project or not. In my way, I create a NS plugin that includes the .aar library, then add this plugin to the main project & use the methods defined in the .aar library without problem.
If you place the .aar library in the main project, you should check if that .aar library is installed by running tns build command & look at console log. If it's installed together with the project, that means you can use the lib method in .vue or any .js files.

Problems archiving project with react-native-fbsdk

I have managed to get react-native-fbsdk (core, login and share) all working in my project. I can build to devices without issue but if I try to create an archive from Xcode I get the error
Lexical or Preprocessor Issue
'RCTBridgeModule.h' file not found
I have followed the install instructions and create a virgin project and done it again to ensure nothing else could be causing this.
Similar Xcode related questions have come up blank for me too:
Xcode 4 can't locate public header files from static library dependency
When archiving app Xcode complains about missing files
Xcode 4 and nested projects -- header files not found
This makes me wonder if there's something else to to with FBSDK specifically that I need to do to get it to archive properly.
Has anyone got a project to archive with react-native-fbsdk? If so, how?
Note: I skipped the step regarding explicitly naming the path for static libraries as I do not know what the name should be; I do not know which the static library would be fbsdkcore (etc) or react-native/react.
I appears that the repo had an error in its header search paths in 'release' distribution. The fix was to correct the xcodeproj in the plugin (A PR is currently going through for this) as outlined here
The following line is present in the debug distribution but not in release for any of the required xcodeproj's
"$(SRCROOT)/../../node_modules/react-native/React/**",
Adding this fixes the error.
Full Source Code Alterations

Cocoa Screensaver plugin with bundled custom frameworks

My app is partitioned into a number of frameworks.
Each framework has its Installation Directory set to #executable_path/../Frameworks, is linked and copied to the main executables Frameworks folder. All is working great.
Now some of the same frameworks are used in a separate screen saver executable.
The frameworks are linked, copied, present in the actual binary -
yet the screensaver module will fail to load with the following error:
Error loading /Users/someuser/Library/Screen Savers/MyScreenSaver.saver/Contents/MacOS/MyScreenSaver: dlopen(/Users/someuser/Library/Screen Savers/MyScreenSaver.saver/Contents/MacOS/MyScreenSaver, 265): Library not loaded: #executable_path/../Frameworks/BusinessBase.framework/Versions/A/BusinessBase
Referenced from: /Users/someuser/Library/Screen Savers/MyScreenSaver.saver/Contents/MacOS/MyScreenSaver
Reason: image not found
Looks like the screen saver (loaded as a plugin) cannot find the frameworks referenced by itself.
I've tried setting the screen savers Framework Search Path to both #loader_path/../Frameworks and #executable_path/../Frameworks.
No luck.
Any ideas what else to try..?
FWIW I've managed to fix this issue with some install_name_tool magic in a post build script:
The key was to change executable_path to loader_path and use the correct relative paths for the binary calling the respective framework.
For a screensaver plugin, #executable_path is the path to the ScreenSaverEngine executable that's loading your screensaver, or to System Preferences if it's running as a preview. It is not the path to your screensaver module! For that, you will need to use #loader_path.

106 duplicate symbols for architecture armv7

Working on my iPhone app and trying to build for debug and I get "106 duplicate symbols for architecture armv7"?
I am using the .workspace file because I am trying to use CocoaPods. If I don't use the .workspace and instead use the .xcodeproj I don't get the error, but then I get missing -lPods .
In my project I have the following targets in the Project Navigator.
Pods (blue icon)
MyProject (blue icon)
Restkit.xcodeproj (blue icon)
... all my files
The issue is that Restkit is making reference to "AFHTTPClient.h" and all the other AF code, but I included it via CocoaPods. I tried deleting the AFNetworking folder from the RestKit library, but apparently the Restkit library can't find the Pods version of AFNetworking?
Is there a way to get RestKit to use the Pods version? If not how do I go about removing Pods from my project?
There is a line in one of your .h files where your wrote
#include "___.m"
instead of
#include "___.h"
So I fixed it. After removing the RestKit version of AFNetworking, from the vendor folder, I added it back by dragging into Xcode. It asks which project I want it used/copied to and this time I selected RestKitTest (or whatever the RestKitTesting is named). It works now. Maybe I selected both RestKit and RestKitTest before, which was wrong?
I also came up with same error. Generally this kind of error occurs due to duplicate classes and xibs in project folder. For Example in my project I had these classes twice ServiceRequest.h/.m. Get rid of duplicate ones and you are good to go.
In Build Phases -> Compile Sources, make sure you don't have the same file added twice.
"Duplicate symbols for architecture" issue occurs in two situations:
You added a .m file twice into your project
You're using a static library (.a file) which already includes some classes that you include into the project.
For fixing any of those cases, check the linker error and look for the .o files that are duplicated (sample: Reachability.o).
Then go to the build phases -> compile sources and search the specified files, if any one appears twice delete one of them, if only appears once it means that the file is also included in one of the static libraries added to your project. Delete it from your list of sources to be compiled and try again.
I saw this error when, I did drag and drop my calabash framework onto xcode and selected add to targets option in the window thats shown. Basically there were two references to files added
I had to remove the calabash framework manually
Right way of doing it
copy to calabash framework to project directory
then go to xcode project
Choose target -> Build phases -> Link Binary With Libraries and add the frame work using + button
I have noticed that duplicate symbols are caused for Google analytics after installing cocoaPods as well. Once I removed one of archives, either libGoogleAnalytics_debug.a or libGoogleAnalytics.a duplication has gone. But obviously if I removed debug one I will not be able to run os simulator and vica versa. I know its not the solution, but at least it could give an idea what could be a solution. Will come back to this thread if I will figure out how to have both a files in this case.
Edit:
I was able to solve the issue by upgrading from G analytics version 2 to 3. It has only one library file and I guess this is the reason why we don't get duplicated symbols anymore. I hope it makes sense.