Set application name in build.gradle for Flutter - flutter

I have a Flutter application in which I add the following redirect scheme and appliaction name in app/build.gradle
manifestPlaceholders = [ 'appAuthRedirectScheme': 'com.sgha.sdx_user_portal://login-callback', 'applicationName': 'com.sgha.sdx_user_portal.main']',
But I get the following error
java.lang.RuntimeException: Unable to instantiate application com.sgha.sdx_user_portal.main: java.lang.ClassNotFoundException: Didn't find class "com.sgha.sdx_user_portal.main" on path: DexPathList[[zip file "/data/app/~~ykU08tRWMZaLJ6MdKgUIEw==/com.sgha.sdx_user_portal-fCB4qyKngsCd56CC_1ADZQ==/base.apk"],nativeLibraryDirectories=[/data/app/~~ykU08tRWMZaLJ6MdKgUIEw==/com.sgha.sdx_user_portal-fCB4qyKngsCd56CC_1ADZQ==/lib/x86, /data/app/~~ykU08tRWMZaLJ6MdKgUIEw==/com.sgha.sdx_user_portal-fCB4qyKngsCd56CC_1ADZQ==/base.apk!/lib/x86, /system/lib, /system_ext/lib]]
main.dart is my entry point. How should I set the application name? Without stting the application name in gradle I get an error saying that the applicaton name is not set:
/home/igharib/IdeaProjects/sdx-user-portal/android/app/src/main/AndroidManifest.xml:5:9-42 Error:
Attribute application#name at AndroidManifest.xml:5:9-42 requires a placeholder substitution but no value for <applicationName> is provided.
/home/igharib/IdeaProjects/sdx-user-portal/android/app/src/debug/AndroidManifest.xml Error:
Validation failed, exiting

this must be application's name

Related

General error during semantic analysis: Transform org.codehaus.groovy.macro.transform.MacroTransformation cannot be run

I am facing the error message when running the Gradle-> Build on groovy file. Can you please help in resolving the issue.
Description Resource Path Location Type
Groovy: compiler error: Missing implementation of resolved method 'abstract java.lang.String getDisablePropertyName()' of abstract class org.codehaus.groovy.transform.stc.AbstractExtensionMethodCache.
SongTexGenerator.groovy /src/project2/generator line 1 Java Problem
Description Resource Path Location Type
Groovy:General error during semantic analysis: Transform org.codehaus.groovy.macro.transform.MacroTransformation cannot be run
SongDSlParsingGroovyTest.groovy /src/test/java/project2/tests

Fatal Exception: java.lang.RuntimeException: Unable to destroy activity {com.example.app.MainActivity}: java.lang.IllegalArgumentException:

My flutter application keeps on crashing and logging this error on firebase crash analytics
Fatal Exception: java.lang.RuntimeException: Unable to destroy activity {com.aims.covidsurvey/com.example.app.MainActivity}: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter activity
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4463)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4482)
at android.app.ActivityThread.-wrap6(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1640)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6617)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)
Have tried to debug the app, am not getting much information what is causing the error, anyone know what could be causing this and how to fix it? Have tried to research am not getting much information
the Kotlin code generated by the app
package com.example.app
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
And another crash error
Caused by java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter activity
at com.lyokone.location.FlutterLocationService.setActivity(FlutterLocationService.kt)
at com.lyokone.location.LocationPlugin.deinitialize(LocationPlugin.java:121)
at com.lyokone.location.LocationPlugin.detachActivity(LocationPlugin.java:56)
at com.lyokone.location.LocationPlugin.onDetachedFromActivity(LocationPlugin.java:69)
at io.flutter.embedding.engine.FlutterEngineConnectionRegistry.detachFromActivity(FlutterEngineConnectionRegistry.java:389)
at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onDetach(FlutterActivityAndFragmentDelegate.java:556)
at io.flutter.embedding.android.FlutterActivity.release(FlutterActivity.java:587)
at io.flutter.embedding.android.FlutterActivity.onDestroy(FlutterActivity.java:608)
at android.app.Activity.performDestroy(Activity.java:7136)
at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1158)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4450)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4482)
at android.app.ActivityThread.-wrap6(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1640)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:156)
at android.app.ActivityThread.main(ActivityThread.java:6617)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:942)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:832)
My solution was to change the component location to geolocator
https://pub.dev/packages/geolocator

exist.db Error during trigger prepare

If I'm trying to modify or even create a file in a project folder inside my exist-db (Version 3.4.1) the following error appears.
Message:
XMLDBException: Failed to invoke method parse in class org.exist.xmlrpc.RpcConnection:
org.exist.collections.triggers.TriggerException: Error during trigger prepare
org.exist.xquery.XPathException: err:XQST0048 It is a static error if a
function or variable declared in a library module is not in the target namespace of the
library module. [source: /db/apps/ediarum/routinen/trigger/set-permissions-for-document.xql]
Exception Stacktrace:
org.xmldb.api.base.XMLDBException: Failed to invoke method parse in class
org.exist.xmlrpc.RpcConnection:
org.exist.collections.triggers.TriggerException: Error during trigger prepare
org.exist.xquery.XPathException: err:XQST0048 It is a static error if a function or variable declared in a library module is not in the target namespace of the library module. [source: /db/apps/ediarum/routinen/trigger/set-permissions-for-document.xql]
at org.exist.xmldb.RemoteCollection.store(RemoteCollection.java:528)
at org.exist.xmldb.RemoteCollection.storeResource(RemoteCollection.java:502)
at org.exist.xmldb.RemoteCollection.storeResource(RemoteCollection.java:471)
at org.exist.client.DocumentView$2.run(DocumentView.java:361)
Caused by: org.apache.xmlrpc.XmlRpcException: Failed to invoke method parse in class org.exist.xmlrpc.RpcConnection:
org.exist.collections.triggers.TriggerException: Error during trigger prepare
org.exist.xquery.XPathException: err:XQST0048 It is a static error if a function or variable declared in a library module is not in the target namespace of the library module. [source: /db/apps/ediarum/routinen/trigger/set-permissions-for-document.xql]
at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:197)
at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:156)
at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:143)
at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69)
at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:158)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:147)
at org.exist.xmldb.RemoteCollection.store(RemoteCollection.java:524)
... 3 more
Caused by: org.apache.xmlrpc.XmlRpcException: Failed to invoke method parse in class org.exist.xmlrpc.RpcConnection:
org.exist.collections.triggers.TriggerException: Error during trigger prepare
org.exist.xquery.XPathException: err:XQST0048 It is a static error if a function or variable declared in a library module is not in the target namespace of the library module. [source: /db/apps/ediarum/routinen/trigger/set-permissions-for-document.xql]
at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:197)
at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:156)
at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:143)
at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69)
at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:158)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:147)
at org.exist.xmldb.RemoteCollection.store(RemoteCollection.java:524)
at org.exist.xmldb.RemoteCollection.storeResource(RemoteCollection.java:502)
at org.exist.xmldb.RemoteCollection.storeResource(RemoteCollection.java:471)
at org.exist.client.DocumentView$2.run(DocumentView.java:361)
Maybe a locking problem? In another folder in the same project all ressources can be edited. And the files where the error appears were initially created by me... so it worked before already.
After a fresh install it works for a while and then suddenly the error appears again.
The permissions are set correctly!
THe explanation for your problem is in this part of the error message:
err:XQST0048 It is a static error if a function or variable declared in a library module is not in the target namespace of the library module. [source: /db/apps/ediarum/routinen/trigger/set-permissions-for-document.xql]
The trigger on your collection contains an error, so when it fires and you are trying to store a document, the error caused by the trigger prevents the document from being stored.
You need to edit /db/apps/ediarum/routinen/trigger/set-permissions-for-document.xql and fix the error in your XQuery.

Connecting to secured remote AEM repository

In order to create JCR nodes, We are trying to programmatically connect to a remote AEM instance using the JcrUtils.getRepository(...) method to acquire the handle to the repository instance.
This instance is secured and checks for a cookie in the request to let the user in.
Is there a way to pass the cookie to JcrUtils (or other methods of connecting to an AEM repository)?
Right now, when running the code JcrUtils.getRepository("http://host:port/crx/server"); it just throws the following exception:
javax.jcr.RepositoryException: Unable to access a repository with the following settings:
org.apache.jackrabbit.repository.uri: https://<host>:<port>/crx/server
The following RepositoryFactory classes were consulted:
org.apache.jackrabbit.jcr2dav.Jcr2davRepositoryFactory: declined
org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory: declined
org.apache.jackrabbit.commons.JndiRepositoryFactory: declined
org.apache.jackrabbit.core.RepositoryFactoryImpl: declined
org.apache.jackrabbit.rmi.repository.RmiRepositoryFactory: failed
because of RemoteRuntimeException: java.rmi.RemoteException: Failed to read the resource at URL https://<host>:<port>/crx/server; nested exception is:
java.io.StreamCorruptedException: invalid stream header: 3C21444F
because of RemoteException: Failed to read the resource at URL https://<host>:<port>/crx/server; nested exception is:
java.io.StreamCorruptedException: invalid stream header: 3C21444F
because of StreamCorruptedException: invalid stream header: 3C21444F
Perhaps the repository you are trying to access is not available at the moment.
at org.apache.jackrabbit.commons.JcrUtils.getRepository(JcrUtils.java:223)
at org.apache.jackrabbit.commons.JcrUtils.getRepository(JcrUtils.java:263)
...
There is no way to pass cookie via JcrUtils.getRepository(...) it accepts URI as a string.
In your logs looks like org.apache.jackrabbit.jcr2dav.Jcr2davRepositoryFactory doesn't exist in application classpath.
Make sure you added to dependencies following libs
jackrabbit-jcr-commons
jackrabbit-jcr2dav
in case you are using Maven:
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-jcr-commons</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-jcr2dav</artifactId>
<version>2.10.1</version>
</dependency>
I am getting similar issue as #user3239244 but only in case of https.
I am trying to access repository from standalone java application
repository = JcrUtils.getRepository(url)
Works for http and fails for https
From logs:
javax.jcr.RepositoryException: Unable to access a repository with the
following settings:
org.apache.jackrabbit.repository.uri: https://localhost:5433/crx/server The following RepositoryFactory
classes were consulted:
org.apache.jackrabbit.jcr2dav.Jcr2davRepositoryFactory: declined
org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory: declined
org.apache.jackrabbit.commons.JndiRepositoryFactory: declined
org.apache.jackrabbit.core.RepositoryFactoryImpl: declined
org.apache.jackrabbit.rmi.repository.RmiRepositoryFactory: failed
because of RepositoryException: Failed to read the resource at URL https://localhost:5433/crx/server
because of SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to
find valid certification path to requested target
because of ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to
find valid certification path to requested target
because of SunCertPathBuilderException: unable to find valid certification path to requested target

glassfish invalid resource

I am creating a simple JPA project in eclipse to run on glassfish. I get the following error:
cannot Deploy GuardApplicationEAR
Deployment Error for module: GuardApplicationEAR: Error occurred during deployment: Exception while preparing the app : Invalid resource : jdbc/_default__pm. Please see server.log for more details.
Exception while invoking class org.glassfish.persistence.jpa.JPADeployer prepare method : java.lang.RuntimeException: Invalid resource : jdbc/_default__pm
Invalid resource : jdbc/_default__pm
I do not have jdbc/default_pm defined anywhere in my project. Can somebody please help out. Thanks.