Kotlin Compiler error e: error: cannot access Hide - android-gradle-plugin

I tried to add MLKit to my gradle and I get the error:
error: cannot access Hide
class file for com.google.android.gms.common.internal.Hide not found
Gradle:
implementation "com.google.firebase:firebase-perf:12.0.1"
implementation "com.google.android.gms:play-services-ads:12.0.1"
implementation "com.google.firebase:firebase-messaging:12.0.1"
implementation "com.google.firebase:firebase-config:12.0.1"
implementation "com.google.firebase:firebase-invites:12.0.1"
implementation "com.google.firebase:firebase-core:12.0.1"
implementation "com.crashlytics.sdk.android:crashlytics:2.9.5"
implementation "com.google.firebase:firebase-ml-vision:18.0.2"

Related

Cannot access Authentication plugin in KTOR, kotlin project

I am trying out KTOR for building backend server application. When I try to include implementation("io.ktor:ktor-auth:1.6.8") dependency, it gives me an error
Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
class io.ktor.auth.Authentication.Feature, unresolved supertypes: io.ktor.application.ApplicationFeature
Adding -Xextended-compiler-checks argument might provide additional information.
Type mismatch: inferred type is Authentication.Feature but Plugin<TypeVariable(P), TypeVariable(B), TypeVariable(F)> was expected
Here is the error
fun Application.authentication() {
install(Authentication) { // here is the error
jwt {
}
}
}
I looked at the Authentication.kt file and it does not have any plugin in it.
how to correct this?
I took the version from mvnrepository https://mvnrepository.com/artifact/io.ktor/ktor-auth/1.6.8
EDIT. I was able to resolve it by adding different dependencies
implementation("io.ktor:ktor-server-auth-jvm:$ktor_version")
implementation("io.ktor:ktor-server-auth-jwt-jvm:$ktor_version")

Gradle annotation processor order (Android)

I'm writing a library based on code generation.
This library generating dagger's module via annotations. How do I run my annotation processor before dagger's code generation?
Now it crashes on build because dagger trying to build the component before modules was generated.
Error:
.ktC:\Users\syncended\AndroidStudioProjects\Daggerblade\app\build\tmp\kapt3\stubs\debug\dev\syncended\daggerblade\AppComponent.java:6: error: cannot find symbol
#dagger.Component(modules = {BookModule.class})
^
symbol: class BookModuleC:\Users\syncended\AndroidStudioProjects\Daggerblade\app\build\tmp\kapt3\stubs\debug\dev\syncended\daggerblade\AppComponent.java:7: error: [ComponentProcessor:MiscError] dagger.internal.codegen.ComponentProcessor was unable to process this interface because not all of its dependencies could be resolved. Check for compilation errors or a circular dependency with generated code.
public abstract interface AppComponent {
^Attempt to reopen a file for path C:\Users\syncended\AndroidStudioProjects\Daggerblade\app\build\generated\source\kapt\debug\dev\syncended\blade\BookModule.kt
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
> java.lang.reflect.InvocationTargetException (no error message)
* Try:

After infinispan 10.1.8 update: class file for org.infinispan.factories.scopes.Scopes not found

I just tried to update my application to Infinspan 10.1.8.Final. I am using Infinispan as a level-2 hibernate (5.4.18.Final) cache via this dependency in build.gradle:
compile group: 'org.infinispan', name: 'infinispan-hibernate-cache-v53', version: '10.1.8.Final'
The application compiles and starts, but the following is logged when I run the test suite:
warning: unknown enum constant Scopes.GLOBAL
reason: class file for org.infinispan.factories.scopes.Scopes not found
warning: unknown enum constant DataType.TRAIT
reason: class file for org.infinispan.jmx.annotations.DataType not found
Why is this happening? Do I need to include another dependency?
Try adding compileOnly 'org.infinispan:infinispan-component-annotations:10.1.8.Final' to the dependencies in your build.gradle file.
Both enums aren't required at runtime. They are using in compile time to generate metadata required by Infinispan.

Invisible compilation errors in running developing an eclipse plugin

Trying to run my eclipse plugin from within eclipse, I get error messages to the console, which make the nested eclipse fail to run the plugin:
org.osgi.framework.BundleException: Error starting module.
at org.eclipse.osgi.container.Module.doStart(Module.java:590)
...
Caused by: java.lang.Error: Unresolved compilation problems:
The import org.eclipse cannot be resolved
The import org.eclipse cannot be resolved
The import org.eclipse cannot be resolved
The import org.eclipse cannot be resolved
The import org.osgi cannot be resolved
AbstractUIPlugin cannot be resolved to a type
IStartup cannot be resolved to a type
The method earlyStartup() of type Plugin must override or implement a supertype method
BundleContext cannot be resolved to a type
BundleContext cannot be resolved to a type
Suggesting that my plugin has compilation errors to it, but:
The plugin has not compilation errors
It seems a bit surprising that running a plugin would cause a compilation.
There was indeed no compilation error: the problem lies elsewhere. The main
Plugin class was to be a singleton, which was implemented like so:
public class Plugin extends AbstractUIPlugin implements IStartup {
public static Plugin plugin;
/ ** an empty c'tor. creates an instance of the plugin. */
public Plugin() {
plugin = this;
}
....
}
Now, other classes were referring to this public field, which not initialized; for some reason, eclipse thought this was a compilation
error. It was not. using a getter for that field solved the problem.

Compiling error when generating moles for System.dll, System.Xml.dll in .NET4

There are compiling errors when generating moles for .NET4 System.dll (build 4.0.30310.261) and System.Xml.Dll(build 4.0.30319.233). The errors for System.Dll are:
m.g.cs(251449,33): error CS0115: 'System.Net.Moles.SFileWebResponse.Dispose(bool)': no suitable method found to override [c:\jin\moles\tmp\s\m.g.csproj]
m.g.cs(251650,30): error CS0115: 'System.Net.Moles.SFileWebResponse.SupportsHeaders': no suitable method found to override [c:\jin\moles\tmp\s\m.g.csproj]
m.g.cs(255339,33): error CS0115: 'System.Net.Moles.SHttpWebResponse.Dispose(bool)': no suitable method found to override [c:\jin\moles\tmp\s\m.g.csproj]
m.g.cs(255540,30): error CS0115: 'System.Net.Moles.SHttpWebResponse.SupportsHeaders': no suitable method found to override [c:\jin\moles\tmp\s\m.g.csproj]
m.g.cs(303198,33): error CS0115: 'System.Net.Moles.SWebResponse.Dispose(bool)': no suitable method found to override [c:\jin\moles\tmp\s\m.g.csproj]
m.g.cs(303399,30): error CS0115: 'System.Net.Moles.SWebResponse.SupportsHeaders': no suitable method found to override [c:\jin\moles\tmp\s\m.g.csproj]
Done Building Project "c:\jin\moles\tmp\s\m.g.csproj" (default targets) -- FAILED.
The errors for System.Xml.Dll are:
m.g.cs(113977,17): error CS0205: Cannot call an abstract base member: 'System.Xml.XmlReader.Close()' [c:\jin\moles\tmp\s\m.g.csproj]
m.g.cs(116149,21): error CS0205: Cannot call an abstract base member: 'System.Xml.XmlResolver.Credentials.set' [c:\jin\moles\tmp\s\m.g.csproj]
m.g.cs(130559,17): error CS0205: Cannot call an abstract base member: 'System.Xml.XmlWriter.Close()' [c:\jin\moles\tmp\s\m.g.csproj]
I'm using Moles 0.94 with VS2010. The errors only happen for newer version of the two DLLs, after .NET 4 service pack is installed. Moles are generated fine for version 4.0.30319.1 of the two DLL, before .NET 4 service packs.
It seems the code generated by Moles is not compatible with latest .NET4 assemblies.
See these questions:
Moling System.dll
http://social.msdn.microsoft.com/Forums/en/pex/thread/446669dd-1d69-4020-9174-dc259a55b4b4
Basically, update System.moles as follows:
<Moles xmlns="http://schemas.microsoft.com/moles/2010/">
<Assembly Name="System" ReflectionOnly="true"/>
</Moles>