Unexpected failure during lint analysis since `androidx-livedata` update 2.3.0 - android

While running lint a strange error occurred. This appears to happen after a androidx.lifecycle update from 2.2.0 to 2.3.0:
../../src/main/java/my/project/MyService.kt: Unexpected failure during lint analysis of MyService.kt
(this is a bug in lint or one of the libraries it depends on)
Message: org.jetbrains.uast.UastErrorType cannot be cast to com.intellij.psi.PsiClassType
The crash seems to involve the detector androidx.lifecycle.lint.NonNullableMutableLiveDataDetector.
You can try disabling it with something like this:
android {
lintOptions {
disable "NullSafeMutableLiveData"
}
}
Stack: ClassCastException:NonNullableMutableLiveDataDetector.visitMethodCall(NonNullableMutableLiveDataDetector.kt:103)
←UElementVisitor$DelegatingPsiVisitor.visitMethodCallExpression(UElementVisitor.kt:1079)
←UElementVisitor$DelegatingPsiVisitor.visitCallExpression(UElementVisitor.kt:1059)
←UCallExpression$DefaultImpls.accept(UCallExpression.kt:85)
←UCallExpressionEx$DefaultImpls.accept(UCallExpression.kt:-1)
←KotlinUSimpleReferenceExpression$KotlinAccessorCallExpression.accept(KotlinUSimpleReferenceExpression.kt:129)
←KotlinUSimpleReferenceExpression.visitAccessorCalls(KotlinUSimpleReferenceExpression.kt:116)
←KotlinUSimpleReferenceExpression.accept(KotlinUSimpleReferenceExpression.kt:83)
You can set environment variable LINT_PRINT_STACKTRACE=true to dump a full stacktrace to stdout.
This issue type represents a problem running lint itself. Examples include failure to find bytecode for source files (which means certain detectors could not be run), parsing errors in lint configuration files, etc.
These errors are not errors in your own code, but they are shown to make it clear that some checks were not completed.
To suppress this error, use the issue id "LintError" as explained in the Suppressing Warnings and Errors section.
When I disable NullSafeMutableLiveData - as suggested - the error doesn't occur anymore, great! But I wonder where this issue comes from and if there's a better solution than simply ignoring that specific check completely. Is it a bug in the androidx.lifecycle dependency I could report, or is it possible to somehow conflict with an error in my project I could fix? (if so, any advice finding out where?)
Note: this only happened when lint was run on Bitrise, I didn't encounter this when running lint in Android Studio. Not sure if this is somehow related though.

Related

How do i resolve this warning junit5 throws when i run Parameterized tests?

I get this warning in my test console when i run test cases annotated with #ParameterizedTest
"org.junit.platform.launcher.core.InternalTestPlan add
WARNING: Attempt to modify the TestPlan was detected. A future version of the JUnit Platform will ignore this call and eventually even throw an exception. Please contact your IDE/tool vendor and request a fix (see https://github.com/junit-team/junit5/issues/1732 for details)."
How do i fix it?
According to the link in the error message, it would seem that:
IntelliJ IDEA is affected, fix is on its way: JetBrains/intellij-community#1030
Following that link, it seems that it should be fixed in the 2019.1 release of IntelliJ.

Is there a way to make DexGuard exit with an error condition if an error occurs?

I'm currently building an android application using ANT on a Jenkins server.
DexGuard is set to run on release in the custom_rules.xml.
Currently there is an issue when DexGuard tries to convert a method:
[dexguard] Unexpected error while converting:
[dexguard] Class = [o/?]
[dexguard] Method = [?(Ljava/lang/String;)Lo/?;]
[dexguard] Exception = [java.lang.IllegalStateException] (Variable v17 too large for instruction [neg-int v17, v17])
[dexguard] java.lang.IllegalStateException: Variable v17 too large for instruction [neg-int v17, v17]
...
Stack trace
...
[dexguard] Not converting this method
My question is, is there a way to get DexGuard to exit with an error status so that either ANT or Jenkins can mark the build as failed?
At the moment it simply prints the stack trace and continues.
I am currently using the Text-finder plugin for Jenkins as a post build step to match a DexGuard exception. If found it downgrades the build to failed.
DexGuard currently ignores methods that it can't convert from Java bytecode to Dalvik bytecode, for any reason -- notably corrupt input code. In this case, it looks more like a bug in DexGuard itself. We'll fix it as soon as possible, and we'll consider adding a flag to stop with an error status.
(I am the lead developer of ProGuard and DexGuard)

Error while trying to apportable iOS app to Android

I have been trying to port my first iOS app to Android with apportable.
I have solved alot of warnings and errors but cannot get rid of this last one.
The App I made is a fitness application for jogging so it uses CoreLocation.
Everything looks good when I run apportable now except this last error:
Build/android-armeabi-debug/com.apptonix.easyrunner/testTabbedWithCore/libtestTabbedWithCore.a(DetailViewController.m.o):/Users/peterbodlund/Documents/xcodeprojects/Training/inlamning5/testTabbedWithCore/testTabbedWithCore/DetailViewController.m:function L_OBJC_CLASSLIST_REFERENCES_$_114: error: undefined reference to 'OBJC_CLASS_$_MKPinAnnotationView'
scons: * [Build/android-armeabi-debug/EasyRunner/apk/lib/armeabi/libverde.so] Error 1
scons: building terminated because of errors.
Exception AttributeError: "'NoneType' object has no attribute 'pack'" in > ignored
Usually this is an indicator that there were link errors. Check your output higher up and look for missing symbol errors.
The build log is confusing because the build is parallel by default.
Add the option -j1 to cause the build to stop immediately after the first error.

XMLVM Android to iPhone Errors

The conversion of my Android application to the iPhone ObjectX environment as described in the XMLVM user manual works almost fine on my MAC, but I end up with 3 errors in the resulting XCode:
The first two errors simply relate to missing files, namely:
org_w3c_dom_Node.h
android_app_DatePickerDialog_OnDateSetListener.h
These are clearly not files from the converted Android application. Where can I get these from?
The third is an error that keeps coming up in the file
java_lang_String.h
The error message is:
typedef NSMutableString java_lang_String: redefinition as different kind of symbol
This error has been reported before in the XMLVM user group but as far as I know has never been answered sufficiently.
About the first error:
this is part of the Android API that has not yet been implemented.
This is the reason why it can't find the files.
Now, the second problem is not actually an error, but a warning and shouldn't stop you form compiling.
If it does, it means that in your project you have set the option to make errors from these types of warnings.
You can safely turn this off and completely ignore this warning.

Odd compiler error, Davlik error 1 from java.net.DatagramPacket.class

I suddenly started getting an unusual compiler error and is it making impossible to do any testing, I am running Eclipse with the plugin and compiling on the 2.1 version.
[2010-08-11 00:29:38 - PeriodTrackerv2]
trouble processing "java/net/DatagramPacket.class":
[2010-08-11 00:29:38 - PeriodTrackerv2]
Attempt to include a core class (java.* or javax.*) in something other
...
[2010-08-11 00:29:38 - PeriodTrackerv2] 1 error; aborting
[2010-08-11 00:29:38 - PeriodTrackerv2] Conversion to Dalvik format failed with error 1
I verified that this class does exist in the standard Android2.1 jar file, so I find it highly unusual a class in the actual base Jar file would be problematic. I am not using this class in any fashion in my program.
I updated to version 2.2 and still get same error, this completely baffles me and just appeared tonight after zero issues for months.
Any ideas on how to fix this?
Cheers,
Tom
Alright!
I reviewed the build path and somehow the Android.jar was added twice. Problem solved.

Categories

Resources