-
Notifications
You must be signed in to change notification settings - Fork 441
bug: Crashlytics + Android Runtime 5.0 incompatible #1023
Comments
Yeah I see a startup crash on Android with NativeScript 5.0.0 as well, when using the demo-ng app. |
https://github.com/NativeScript/android-runtime/pull/1209/files I haven't looked at it, and was about to do similar myself as previously mentioned, but this PR may be the solution. |
I've just tried 3.2.1 but it doesn't help, unfortunately. Appreciate the tip though. |
@EddyVerbruggen it seems that the latest android gradle plugin has changed the location of the folder that contains the metadata. The |
Thanks a million, @NickIliev! It's indeed the exact same problem I tackled before in #549 (but totally forgot about it). That |
@EddyVerbruggen during the investigation of the issue we ended up with a modified version of the task copyMetadata {
doLast {
copy {
from "$projectDir/src/main/assets/metadata"
def destination;
def configuration = project.hasProperty("release") ? "release" : "debug";
def toDir = configuration;
def assetsFolder = new File("$projectDir/build/intermediates/assets");
def mergedAssetsFolder = new File("$projectDir/build/intermediates/merged_assets");
def assetFiles = assetsFolder.exists() ? assetsFolder.listFiles() : mergedAssetsFolder.listFiles();
if (assetFiles != null) {
toDir = assetFiles[0].name
if (toDir != 'debug' && toDir != 'release') {
toDir += "/release"
}
}
if(assetsFolder.exists()) {
destination = "$projectDir/build/intermediates/assets/" + toDir + "/metadata"
} else {
destination = "$projectDir/build/intermediates/merged_assets/$toDir/merge" + configuration.capitalize() + "Assets/out/metadata"
}
into destination
}
}
} |
Hey @KristianDD thanks! I actually created something very similar on the flight home today. Will bump the version shortly. |
@EddyVerbruggen |
I'm still narrowing this one down, but since the RC and even up to the full release of {N} 5.0, I have been unable to get the app to run consistently with the 5.0 Android Runtime enbaled.
Essentially when live-syncing with Crashlytics enabled on the app (even with 0 actual calls to any of its methods) and when using the Android Runtime 5.0, the app will launch and then will just sit on the launch screen, with the emulator or device still expending significant processing (and getting warm).
The {N} CLI will never actually attach, and will then timeout.
If you then open
adb shell
thenlogcat
you will see this loop (not sure where it "starts" but you can see where it will repeat;p.client.mobil
is the app package name, that gets truncated for some reason):Considering how vague that all is, it took me a while to narrow down the exact cause, and I hadn't suspected the Firebase plugin, and even when I did, I didn't suspect the Crashlytics (which in its basic usage is just some Gradle plugins).
This can be repro reduced by creating an new {N} project (I'm using {N}+Angular, but I suspect the same would happen with the other flavours: JS/TS/Vue).
CLI also has no difference (4.2 or 5.0 have same result), nor does tns-core-modules or its widgets (either 4.2 or 5.0).
Repro:
tns create xxx --ng
(as mentioned previously, I doubt the NG has any impact here, but I haven't tested otherwise.cd xxx && npm i nativescript-plugin-firebase
y
for onlyusing_android
andcrashlytics
package.json
nativescript.id
to match that too.tns run android
Result:
App will launch and get stuck in a boot/crash loop and your PC/Device will get very warm.
Since there was no complaint in that crash loop about Crashlytics (if anything it says several things about its success), I had even tried before narrowing it down to the plugin to build a custom runtime between 4.2 and 5.0 changes, leaving a number of things but reverting other. However, I hadn't tried reverting to many changes to the gradle stuff, other than the order that App/Plugin gradles are applied now, and still no result.
Now that I know its crashlytics build process that is to blame, I suspect it has something to do with the slight bumps of
'com.android.tools.build:gradle'
in some of the portions, but not to the same and not fully.The text was updated successfully, but these errors were encountered: