We are currently using greenDAO3 in this project. I believe we were using the greenDAO2 at some point because it seems that we were using the legacy generator class.
So I am attempting to add a new table to the database for a new feature in our application. I am not very familiar with greenDAO, but I figured it would be easier to have it auto-generate the file at build time with Gradle.
Everything works fine, but after adding some stuff to my root.gradle and app.gradle, I get this error.
ERROR: Found 1 problem(s) parsing "/Users/Dustin/Projects/project/app/src/main/java/com/package1/package2/db/MyClassTest.java". First problem:
Pb(96) The serializable class MyClassTest does not declare a static final serialVersionUID field of type long (536871008 at line 18).
These are the changes I made.
diff --git a/app/build.gradle b/app/build.gradle
index 40b3b80d..60f2a688 100644
--- a/app/build.gradle
+++ b/app/build.gradle
## -1,4 +1,7 ##
apply plugin: 'com.android.application'
+apply plugin: 'com.google.gms.google-services'
+apply plugin: 'org.greenrobot.greendao'
+apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'
android {
## -234,4 +237,7 ## dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
}
-apply plugin: 'com.google.gms.google-services'
\ No newline at end of file
+greendao {
+ schemaVersion 24
+}
+
When I suppress warnings it proceeds to the next serializable class in the db folder. I really don't want to suppress warnings, because that seems like bad practice in this case.
Add a serialVersionUID field in your MyClassTest.java
A good pratice might be to set the last modification date
public class MyClassTest {
private static final long serialVersionUid = 6082019L;
}
More informations available on this post
Related
I am trying to connect to a database using Spring. Unfortunately, it always gives me the error message, can that it could not find a certain method.
Incidental information that may not hurt. The program is complied with Java 8 . Accordingly, the server also runs on Java 8
Thanks for the help!
Error
build.gradle:
plugins {
id 'com.github.johnrengelman.shadow' version '7.1.2'
id 'java'
}
group = 'io.github.rysefoxx'
version = '1.0-SNAPSHOT'
repositories {
mavenCentral()
mavenLocal()
maven {
url "https://repo.codemc.org/repository/maven-public/"
}
}
dependencies {
compileOnly files('lib/spigot.jar')
compileOnly 'org.projectlombok:lombok:1.18.24'
implementation 'io.github.rysefoxx:RyseInventory-Plugin:1.1.9-SNAPSHOT'
implementation 'io.github.rysefoxx:Hologram:1.0-SNAPSHOT'
implementation 'net.wesjd:anvilgui:1.5.3-SNAPSHOT'
implementation 'org.hibernate:hibernate-core:5.6.5.Final'
implementation 'org.hibernate:hibernate-envers:5.6.5.Final'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa:2.6.7'
implementation 'org.springframework.boot:spring-boot-starter-cache:2.6.7'
implementation 'org.springframework:spring-aspects:5.3.19'
implementation 'mysql:mysql-connector-java:8.0.28'
implementation 'org.reflections:reflections:0.10.2'
implementation 'com.fasterxml.jackson.core:jackson-core:2.13.2'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.2'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.13.2'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
}
shadowJar {
mergeServiceFiles()
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
spring.properties:
spring.datasource.url=jdbc:mysql://localhost:3306/home
spring.datasource.jdbc-url=jdbc:mysql://localhost:3306/home
spring.datasource.username=root
spring.datasource.password=
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
spring.jpa.properties.hibernate.jdbc.time_zone=UTC
spring.jpa.database=MYSQL
spring.jpa.hibernate.ddl-auto=none
hibernate.hbm2ddl.auto=none
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
spring.jpa.show-sql=false
spring.datasource.initialization-mode=always
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
spring.factories:
org.springframework.data.repository.core.support.RepositoryFactorySupport=org.springframework.data.jpa.repository.support.JpaRepositoryFactory
org.springframework.data.util.ProxyUtils$ProxyDetector=org.springframework.data.jpa.util.HibernateProxyDetector
# Initializers
org.springframework.context.ApplicationContextInitializer=\
org.springframework.boot.autoconfigure.SharedMetadataReaderFactoryContextInitializer,\
org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener,\
org.springframework.boot.context.ConfigurationWarningsApplicationContextInitializer,\
org.springframework.boot.context.ContextIdApplicationContextInitializer,\
org.springframework.boot.context.config.DelegatingApplicationContextInitializer,\
org.springframework.boot.rsocket.context.RSocketPortInfoApplicationContextInitializer,\
org.springframework.boot.web.context.ServerPortInfoApplicationContextInitializer
# Application Listeners
org.springframework.context.ApplicationListener=\
org.springframework.boot.autoconfigure.BackgroundPreinitializer,\
org.springframework.boot.ClearCachesApplicationListener,\
org.springframework.boot.builder.ParentContextCloserApplicationListener,\
org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor,\
org.springframework.boot.context.FileEncodingApplicationListener,\
org.springframework.boot.context.config.AnsiOutputApplicationListener,\
org.springframework.boot.context.config.ConfigFileApplicationListener,\
org.springframework.boot.context.config.DelegatingApplicationListener,\
org.springframework.boot.context.logging.ClasspathLoggingApplicationListener,\
org.springframework.boot.context.logging.LoggingApplicationListener,\
org.springframework.boot.liquibase.LiquibaseServiceLocatorApplicationListener
# Auto Configuration Import Listeners
org.springframework.boot.autoconfigure.AutoConfigurationImportListener=\
org.springframework.boot.autoconfigure.condition.ConditionEvaluationReportAutoConfigurationImportListener
# Auto Configuration Import Filters
org.springframework.boot.autoconfigure.AutoConfigurationImportFilter=\
org.springframework.boot.autoconfigure.condition.OnBeanCondition,\
org.springframework.boot.autoconfigure.condition.OnClassCondition,\
org.springframework.boot.autoconfigure.condition.OnWebApplicationCondition
# Auto Configure
org.springframework.boot.autoconfigure.EnableAutoConfiguration=io.github.rysefoxx.spring.SpringSpigotAutoConfiguration,\
org.springframework.boot.autoconfigure.admin.SpringApplicationAdminJmxAutoConfiguration,\
org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration,\
org.springframework.boot.autoconfigure.batch.BatchAutoConfiguration,\
org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration,\
org.springframework.boot.autoconfigure.cassandra.CassandraAutoConfiguration,\
org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration,\
org.springframework.boot.autoconfigure.context.LifecycleAutoConfiguration,\
org.springframework.boot.autoconfigure.context.MessageSourceAutoConfiguration,\
org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration,\
org.springframework.boot.autoconfigure.couchbase.CouchbaseAutoConfiguration,\
org.springframework.boot.autoconfigure.dao.PersistenceExceptionTranslationAutoConfiguration,\
org.springframework.boot.autoconfigure.data.cassandra.CassandraDataAutoConfiguration,\
org.springframework.boot.autoconfigure.data.cassandra.CassandraReactiveDataAutoConfiguration,\
org.springframework.boot.autoconfigure.data.cassandra.CassandraReactiveRepositoriesAutoConfiguration,\
org.springframework.boot.autoconfigure.data.cassandra.CassandraRepositoriesAutoConfiguration,\
org.springframework.boot.autoconfigure.data.jdbc.JdbcRepositoriesAutoConfiguration,\
org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration,\
org.springframework.boot.autoconfigure.hazelcast.HazelcastAutoConfiguration,\
org.springframework.boot.autoconfigure.hazelcast.HazelcastJpaDependencyAutoConfiguration,\
org.springframework.boot.autoconfigure.influx.InfluxDbAutoConfiguration,\
org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration,\
org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration,\
org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration,\
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,\
org.springframework.boot.autoconfigure.jdbc.JndiDataSourceAutoConfiguration,\
org.springframework.boot.autoconfigure.jdbc.XADataSourceAutoConfiguration,\
org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,\
org.springframework.boot.autoconfigure.jooq.JooqAutoConfiguration,\
org.springframework.boot.autoconfigure.jsonb.JsonbAutoConfiguration,\
org.springframework.boot.autoconfigure.availability.ApplicationAvailabilityAutoConfiguration,\
org.springframework.boot.autoconfigure.mustache.MustacheAutoConfiguration,\
org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration,\
org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration,\
org.springframework.boot.autoconfigure.rsocket.RSocketMessagingAutoConfiguration,\
org.springframework.boot.autoconfigure.rsocket.RSocketRequesterAutoConfiguration,\
org.springframework.boot.autoconfigure.rsocket.RSocketServerAutoConfiguration,\
org.springframework.boot.autoconfigure.rsocket.RSocketStrategiesAutoConfiguration,\
org.springframework.boot.autoconfigure.security.rsocket.RSocketSecurityAutoConfiguration,\
org.springframework.boot.autoconfigure.sendgrid.SendGridAutoConfiguration,\
org.springframework.boot.autoconfigure.session.SessionAutoConfiguration,\
org.springframework.boot.autoconfigure.solr.SolrAutoConfiguration,\
org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration,\
org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration,\
org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration,\
org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration,\
org.springframework.boot.autoconfigure.transaction.jta.JtaAutoConfiguration,\
org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration
# Failure analyzers
org.springframework.boot.diagnostics.FailureAnalyzer=\
org.springframework.boot.autoconfigure.data.redis.RedisUrlSyntaxFailureAnalyzer,\
org.springframework.boot.autoconfigure.diagnostics.analyzer.NoSuchBeanDefinitionFailureAnalyzer,\
org.springframework.boot.autoconfigure.flyway.FlywayMigrationScriptMissingFailureAnalyzer,\
org.springframework.boot.autoconfigure.jdbc.DataSourceBeanCreationFailureAnalyzer,\
org.springframework.boot.autoconfigure.jdbc.HikariDriverConfigurationFailureAnalyzer,\
org.springframework.boot.autoconfigure.session.NonUniqueSessionRepositoryFailureAnalyzer,\
org.springframework.boot.context.properties.NotConstructorBoundInjectionFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.BeanCurrentlyInCreationFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.BeanDefinitionOverrideFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.BeanNotOfRequiredTypeFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.BindFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.BindValidationFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.UnboundConfigurationPropertyFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.ConnectorStartFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.NoSuchMethodFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.NoUniqueBeanDefinitionFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.PortInUseFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.ValidationExceptionFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.InvalidConfigurationPropertyNameFailureAnalyzer,\
org.springframework.boot.diagnostics.analyzer.InvalidConfigurationPropertyValueFailureAnalyzer
# Temcensored availability providers
org.springframework.boot.autoconfigure.temcensored.TemcensoredAvailabilityProvider=\
org.springframework.boot.autoconfigure.freemarker.FreeMarkerTemcensoredAvailabilityProvider,\
org.springframework.boot.autoconfigure.mustache.MustacheTemcensoredAvailabilityProvider,\
org.springframework.boot.autoconfigure.groovy.temcensored.GroovyTemcensoredAvailabilityProvider,\
org.springframework.boot.autoconfigure.thymeleaf.ThymeleafTemcensoredAvailabilityProvider
# PropertySource Loaders
org.springframework.boot.env.PropertySourceLoader=\
org.springframework.boot.env.PropertiesPropertySourceLoader,\
org.springframework.boot.env.YamlPropertySourceLoader
# Run Listeners
org.springframework.boot.SpringApplicationRunListener=\
org.springframework.boot.context.event.EventPublishingRunListener
# Error Reporters
org.springframework.boot.SpringBootExceptionReporter=\
org.springframework.boot.diagnostics.FailureAnalyzers
# Environment Post Processors
org.springframework.boot.env.EnvironmentPostProcessor=\
org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor,\
org.springframework.boot.env.SpringApplicationJsonEnvironmentPostProcessor,\
org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor,\
org.springframework.boot.reactor.DebugAgentEnvironmentPostProcessor
# FailureAnalysisReporters
org.springframework.boot.diagnostics.FailureAnalysisReporter=\
org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter
org.springframework.beans.BeanInfoFactory=org.springframework.beans.ExtendedBeanInfoFactory
It's not unlikely to be a problem caused by the Shadow Plugin, it has a hurdle: You have to tell it how to handle file collisions, i.e. files with the same name. While this is not hard, and you already did it partially ( mergeServiceFiles()), I use it with Gradle Kotlin DSL like:
tasks.withType<ShadowJar> {
mergeServiceFiles()
append("META-INF/spring.handlers")
append("META-INF/spring.schemas")
append("META-INF/spring.tooling")
transform(
PropertiesFileTransformer().apply {
paths = mutableListOf("META-INF/spring.factories")
mergeStrategy = "append"
})
}
It doesn't tell in its current version when such a conflict occurs, so you have to waste big amounts of time finding the conflicts yourself. But there is a pull request that it tells if there is a collision: https://github.com/johnrengelman/shadow/pull/773.
Until the pull request gets merged you could use the forked branch to be always informed about file collisions: https://github.com/JD-CSTx/shadow/tree/chapmajs-collision_logging.
Maybe I'm guessing wrong, and your problem is caused by something else, but this looks definitely like it could come from file collisions.
I am trying to split my ANTLR4 grammar in multiple files so i can test them more easily, i am using gradle as a build tool in a java project.
Both grammar compile correctly by separate but when i add the import to my main grammar i get the next compilation error
error(110): kanekotic/specflow/rider/SpecflowFeature.g4:3:7: can't find or load grammar SpecflowScenario
the inherited grammar looks like:
grammar SpecflowScenario;
#header {
package kanekotic.specflow.rider;
}
scenario
: 'Scenario: ';
and the main grammar looks like:
grammar SpecflowFeature;
import SpecflowScenario;
#header {
package kanekotic.specflow.rider;
}
file returns [List<String> values]
#init { $values = new ArrayList<String>(); }
: 'Feature: ' EOF;
What am i doing wrong? is this not allowed?
edit:
the gradle.build looks like:
plugins {
id "org.jetbrains.intellij" version "0.1.10"
}
apply plugin: 'org.jetbrains.intellij'
apply plugin: 'java'
apply plugin: 'antlr'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
intellij {
version '143.2370.31'
pluginName 'Specflow Rider'
}
group 'kanekotic.specflow.rider'
version '0.1'
repositories {
mavenCentral()
jcenter()
}
dependencies {
antlr "org.antlr:antlr4:4.5"
testCompile 'junit:junit:4.12'
testCompile "org.mockito:mockito-core:2.+"
}
all the code as it is open sourced is in this next link: https://github.com/kanekotic/Specflow.Rider/tree/antlr4_multiple_grammar
The Antlr plugin uses src/main/antlr as lib directory by default. As the grammar file to include is in kanekotic/specflow/rider, use the following code in your gradle file to include this location:
generateGrammarSource {
arguments << "-lib" << "src/main/antlr/kanekotic/specflow/rider"
}
See also this gradle thread.
I have a project in Android Studio with a couple of modules.
The app module. With apply plugin: 'com.android.application'.
The androidLibrary module. With apply plugin: 'com.android.library'.
The javaLibrary module. With apply plugin: 'java'.
I want to declare some variables in the project gradle.properties file and be able to read them from the javaLibrary module.
I have declared the properties in the following ways according this documentation...
mysuperhost=superhost
systemProp.mysuperhost=superhost
ORG_GRADLE_PROJECT_mysuperhost=superhost
org.gradle.project.mysuperhost=superhost
... and tried to read them this way with no success:
System.getenv("mysuperhost");
System.getProperty("mysuperhost");
I know how to read properties from the BuildConfig class, but this is a generateed class in the app module (with apply plugin: 'com.android.application'), so this does not work for this particular case.
If you have some value inside of the your gradle.properties file like
mysuperhost=superhost
then write the following lines in the your build.gradle file (to grab property from gradle.properties file and add it into BuildConfig.java class):
// ...
// ...
android {
// Just for example
compileSdkVersion 23
// Just for example
buildToolsVersion "23.0.2"
// ...
// ...
defaultConfig {
// Just for example
minSdkVersion 14
// Just for example
targetSdkVersion 23
// This is the main idea
buildConfigField('String', 'MY_SUPER_HOST', "\"${mysuperhost}\"")
// ...
// ...
}
// ...
// ...
}
// ...
// ...
After that build your project and you are able to use your value via BuildConfig.MY_SUPER_HOST
Your statement about being unable to use BuildConfig is not entirely accurate, as you can use Java reflection to find the public static members of BuildConfig as long as you know its fully qualified package.
Say the full package name of your generated BuildConfig is com.company.app.BuildConfig. You can get its Class object with:
Class<?> klass = Class.forName("com.company.app.BuildConfig");
Then you can use that Class object to pick out the fields of it by name:
Field field = klass.getDeclaredField("BUILD_TYPE");
Then you can get its value:
String value = field.get(null);
I have this problem with the annotations for few days...
Error:(13, 26) cannot find symbol class LoginActivityAnnotations_
But the annotation class exist and the class import in my MainActivity work greate
http://imagizer.imageshack.us/v2/150x100q90/911/x8RzRM.png
The annotaitons classes were generated correctly in this directory:
http://imagizer.imageshack.us/v2/150x100q90/538/bEplNx.png
This is my build.grandle file
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.neenbedankt.gradle.plugins:android-apt:+'
}
}
apply plugin: 'android'
apply plugin: 'android-apt'
repositories {
mavenCentral()
mavenLocal()
}
apt {
arguments {
resourcePackageName "com.ar.sdocs"
androidManifestFile variant.processResources.manifestFile
}
}
dependencies {
compile 'com.android.support:appcompat-v7:20.0.0'
compile 'com.android.support:support-v4:20.0.0'
apt "org.androidannotations:androidannotations:+"
compile 'org.androidannotations:androidannotations-api:+'
compile 'com.nhaarman.listviewanimations:library:2.6.0'
compile files('libs/commons-lang3-3.3.1.jar')
compile 'com.google.android.gms:play-services:4.3.+'
compile files('libs/joda-time-2.3.jar')
compile files('libs/bcprov-ext-jdk15on-150.jar')
compile files('libs/bugsense-3.6.1.jar')
compile 'org.apache.httpcomponents:httpcore:4.3.2'
compile 'org.apache.httpcomponents:httpmime:4.3.4'
compile 'com.google.code.gson:gson:2.2.4'
compile files('libs/json-simple-1.1.1.jar')
apt "org.androidannotations:androidannotations:+"
compile 'org.androidannotations:androidannotations-api:+'
}
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName '0.1'
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
}
}
android.applicationVariants.each { variant ->
aptOutput = file("${project.buildDir}/generated/source/apt/${variant.dirName}")
println "****************************"
println "variant: ${variant.name}"
println "manifest: ${variant.processResources.manifestFile}"
println "aptOutput: ${aptOutput}"
println "****************************"
variant.javaCompile.doFirst {
println "*** compile doFirst ${variant.name}"
aptOutput.mkdirs()
variant.javaCompile.options.compilerArgs += [
'-processorpath', configurations.apt.getAsPath(),
'-AandroidManifestFile=' + variant.processResources.manifestFile,
'-s', aptOutput
]
}
variant.addJavaSourceFoldersToModel(aptOutput)
}
But every time I run a build, I get the error I mentioned before. I'm trying different configurations days ago but I can not find one that works
Thats the complete error (I only import the annotations class)
Error:(14, 26) cannot find symbol class LoginActivityAnnotations_
Note: Resolve log file to /Users/CARRY/AndroidStudioProjects/sdocs/SDocs/build/generated/source/apt/androidannotations.log
Note: Initialize AndroidAnnotations 3.0.1 with options {resourcePackageName=com.ar.sdocs, androidManifestFile=/Users/CARRY/AndroidStudioProjects/sdocs/SDocs/build/intermediates/manifests/debug/AndroidManifest.xml}
Note: Start processing for 5 annotations on 145 elements
Note: AndroidManifest.xml file found with specified path: /Users/CARRY/AndroidStudioProjects/sdocs/SDocs/build/intermediates/manifests/debug/AndroidManifest.xml
Note: AndroidManifest.xml found: AndroidManifest [applicationPackage=com.ar.sdocs, componentQualifiedNames=[com.ar.sdocs.main.MainActivity, com.ar.sdocs.login.LoginActivity, com.ar.sdocs.dashboard.DashboardActivity, com.ar.sdocs.login.registro.RegistroActivity, com.ar.sdocs.dashboard.settings.editar.SettingsUserEditActivity, com.ar.sdocs.dashboard.upload.UploadActivity, com.ar.sdocs.dashboard.materias.main.MateriaActivity, com.ar.sdocs.util.media.FilePickerActivity, com.ar.sdocs.gcm.GcmIntentService, com.ar.sdocs.gcm.GcmBroadcastReceiver], permissionQualifiedNames=[android.permission.USE_CREDENTIALS, android.permission.GET_ACCOUNTS, android.permission.READ_PROFILE, android.permission.READ_CONTACTS, android.permission.INTERNET, android.permission.WAKE_LOCK, com.google.android.c2dm.permission.RECEIVE, android.permission.CAMERA, android.permission.READ_EXTERNAL_STORAGE, com.example.gcm.permission.C2D_MESSAGE], applicationClassName=null, libraryProject=false, debugabble=false, minSdkVersion=14, maxSdkVersion=-1, targetSdkVersion=19]
Note: Found project R class: com.ar.sdocs.R
Note: Found Android class: android.R
Note: Validating elements
Note: Validating with EActivityHandler: [com.ar.sdocs.login.LoginActivityAnnotations]
/Users/CARRY/AndroidStudioProjects/sdocs/SDocs/src/main/java/com/ar/sdocs/login/LoginActivityAnnotations.java
Warning:(45, 1) The component LoginActivityAnnotations_ is not registered in the AndroidManifest.xml file.
Note: Validating with ViewByIdHandler: [emailEditText, passwordEditText]
Note: Validating with ClickHandler: [loginButtonClicked(), registerButtonClicked()]
Note: Validating with TouchHandler: [loginRelativeLayoutTouched(android.view.View,android.view.MotionEvent)]
Note: Validating with AfterViewsHandler: [verificarLogin()]
Note: Processing root elements
Note: Processing root elements EActivityHandler: [com.ar.sdocs.login.LoginActivityAnnotations]
Note: Processing enclosed elements
Note: Number of files generated by AndroidAnnotations: 1
Note: Writting following API classes in project: []
Note: Generating class: com.ar.sdocs.login.LoginActivityAnnotations_
Note: Time measurements: [Whole Processing = 148 ms], [Process Annotations = 32 ms], [Generate Sources = 31 ms], [Find R Classes = 24 ms], [Extract Annotations = 23 ms], [Validate Annotations = 16 ms], [Extract Manifest = 11 ms],
Note: Finish processing
Note: Start processing for 0 annotations on 1 elements
Note: Time measurements: [Whole Processing = 3 ms],
Note: Finish processing
Note: Start processing for 0 annotations on 0 elements
Note: Time measurements: [Whole Processing = 1 ms],
Note: Finish processing
Warning:Unclosed files for the types '[dummy1407025286017]'; these types will not undergo annotation processing
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Information:BUILD SUCCESSFUL
Information:Total time: 21.886 secs
Information:1 error
Information:4 warnings
Information:See complete output in console
I could be because you havn't included the LoginActivityAnnotations_ file where you use it - because Android Studio does not help you with that. I had that problem.
You need to make an include of the package where the LoginActivityAnnotations file.
If you were using this include, to get the file without the underscore:
com.example.LoginActivityAnnotations
Then use this one:
com.example.* //To load LoginActivityAnnotations_
(The include will be grey and you will still be left with red words but it will compile)
I want to write a Gradle function, which creates a pom.xml file with data (groupId, artifactId, version) passed as arguments.
I created following script:
apply plugin: 'maven'
apply plugin: 'java'
def createMainPom(mainDir, groupId, artifactId, version)
{
pom
{
project
{
groupId '$groupId' // Error
artifactId '$artifactId'
version '$version'
packaging 'pom'
name 'New app'
modules
{
module
{
name 'app'
}
module
{
name 'integration-tests'
}
}
}
}.writeTo('$mainDir/pom.xml');
}
[...]
When I run it, I get the error at the position marked with // Error above:
> No signature of method: java.lang.String.call() is applicable for argument typ
es: (java.lang.String) values: [a]
Possible solutions: wait(), any(), wait(long), split(java.lang.String), find(jav
a.lang.String), count(java.lang.String)
How can I fix this?
The plugin documentation states:
Note: groupId, artifactId, version, and packaging should always be set directly on the pom object.
Does moving those properties up a level, out of project, make a difference?
For strings variables resolution use double quotes:
groupId "$groupId"
artifactId "$artifactId"
version "$version"
...
}.writeTo("$mainDir/pom.xml");