Wednesday 15 February 2012

android - Can't make project in AndroidStudio with AndroidAnnotations library -



android - Can't make project in AndroidStudio with AndroidAnnotations library -

i've looked @ several discussions , blogs compiling android applications in android studio androidannotations framework specially this one, none of them helped me started.

i using android studio 0.8.9 , pointing on downloaded gradle 2.1 binary. using ubuntu 14.04 .

the gradle compilation process says missing re-create of androidmanifest.xml @ given location (please, see output below) though i've found when navigating folder file explorer.

please notice in order remove warnings, replaced

variant.processresources.manifestfile

by

variant.outputs.processresources.manifestfile

in gradle script.

here gradle build script :

buildscript { repositories { mavencentral() } dependencies { classpath 'com.android.tools.build:gradle:0.13.2' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.3' } } apply plugin: 'android' repositories { mavencentral() } configurations { apt } dependencies { compile filetree(include: '*.jar', dir: 'libs') compile files('libs/androidsvg-1.2.1.jar') compile 'com.android.support:appcompat-v7:20.0.0' compile 'org.androidannotations:androidannotations-api:3.0' apt 'org.androidannotations:androidannotations:3.0' } android { compilesdkversion 20 buildtoolsversion "20.0.0" defaultconfig { minsdkversion 9 targetsdkversion 20 } sourcesets { main { manifest.srcfile 'androidmanifest.xml' java.srcdirs = ['src'] resources.srcdirs = ['src'] aidl.srcdirs = ['src'] renderscript.srcdirs = ['src'] res.srcdirs = ['res'] assets.srcdirs = ['assets'] } // move tests tests/java, tests/res, etc... instrumenttest.setroot('tests') // move build types build-types/<type> // instance, build-types/debug/java, build-types/debug/androidmanifest.xml, ... // moves them out of them default location under src/<type>/... // conflict src/ beingness used main source set. // adding new build types or product flavors should accompanied // similar customization. debug.setroot('build-types/debug') release.setroot('build-types/release') } } def getsourcesetname(variant) { homecoming new file(variant.dirname).getname(); } android.applicationvariants.all { variant -> def aptoutputdir = project.file("${project.builddir}/source/apt/") def aptoutput = new file(aptoutputdir, variant.dirname) println "****************************" println "variant: ${variant.name}" println "manifest: ${variant.outputs.processresources.manifestfile}" println "aptoutput: ${aptoutput}" println "****************************" android.sourcesets[getsourcesetname(variant)].java.srcdirs+= aptoutput.getpath() variant.javacompile.options.compilerargs += [ '-processorpath', configurations.apt.getaspath(), '-aandroidmanifestfile=' + variant.outputs.processresources.manifestfile, '-s', aptoutput ] variant.javacompile.source = variant.javacompile.source.filter { p -> homecoming !p.getpath().startswith(aptoutputdir.getpath()) } variant.javacompile.dofirst { aptoutput.mkdirs() } }

here gradle console output :

information:gradle tasks [:compiledebugsources] **************************** variant: debug manifest: [<my_home>/androidstudioprojects/chesspositionmanagerandroid/build/intermediates/manifests/full/debug/androidmanifest.xml] aptoutput: <my_home>/androidstudioprojects/chesspositionmanagerandroid/build/source/apt/debug **************************** **************************** variant: release manifest: [<my_home>/androidstudioprojects/chesspositionmanagerandroid/build/intermediates/manifests/full/release/androidmanifest.xml] aptoutput: <my_home>/androidstudioprojects/chesspositionmanagerandroid/build/source/apt/release **************************** :prebuild :predebugbuild :checkdebugmanifest :prereleasebuild :preparecomandroidsupportappcompatv72000library up-to-date :preparecomandroidsupportsupportv42000library up-to-date :preparedebugdependencies :compiledebugaidl up-to-date :compiledebugrenderscript up-to-date :generatedebugbuildconfig up-to-date :generatedebugassets up-to-date :mergedebugassets up-to-date :generatedebugresvalues up-to-date :generatedebugresources up-to-date :mergedebugresources up-to-date :processdebugmanifest up-to-date :processdebugresources up-to-date :generatedebugsources up-to-date :compiledebugjava note: resolve log file <my_home>/androidstudioprojects/chesspositionmanagerandroid/build/source/apt/androidannotations.log note: 18:29:17.724 [daemon thread 16] info o.a.androidannotationprocessor:86 - initialize androidannotationprocessor options {androidmanifestfile=[<my_home>/androidstudioprojects/chesspositionmanagerandroid/build/intermediates/manifests/full/debug/androidmanifest.xml]} note: 18:29:17.869 [daemon thread 16] info o.a.androidannotationprocessor:117 - start processing 1 annotations on 8 elements error:18:29:17.885 [daemon thread 16] error o.a.h.androidmanifestfinder:95 - not find androidmanifest.xml file in specified path : [<my_home>/androidstudioprojects/chesspositionmanagerandroid/build/intermediates/manifests/full/debug/androidmanifest.xml] note: 18:29:17.886 [daemon thread 16] info o.a.p.timestats:81 - time measurements: [whole processing = 17 ms], [extract annotations = 13 ms], [extract manifest = 3 ms], note: 18:29:17.887 [daemon thread 16] info o.a.androidannotationprocessor:131 - finish processing note: 18:29:17.954 [daemon thread 16] info o.a.androidannotationprocessor:117 - start processing 0 annotations on 0 elements note: 18:29:17.954 [daemon thread 16] info o.a.p.timestats:81 - time measurements: [whole processing = 0 ms], note: 18:29:17.955 [daemon thread 16] info o.a.androidannotationprocessor:131 - finish processing warning:unclosed files types '[dummy1412872157721]'; these types not undergo annotation processing 1 warning error:execution failed task ':compiledebugjava'. > compilation failed; see compiler error output details. information:build failed information:total time: 3.981 secs information:2 errors information:1 warning information:see finish output in console

i apologize if ever error obvious, i've been seeking hours, without success.

have tried adding config apt:

dependencies { ... classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4' } apply plugin: 'android-apt' apt { arguments { androidmanifestfile variant.processresources.manifestfile resourcepackagename '<your package>' } }

android gradle android-studio android-annotations

No comments:

Post a Comment