Repository navigation
Compatible with Instant app? #2017
Description
Activity
I have not tested it yet, but I'm pretty sure it should be compatible. You have to add the AndroidAnnotations processor and dependencies to each module that should use generated files.
@ealden i quickly read through the doc, and instant app module is pretty much the same as a library module. AA should work out of the box. Can you share an example project?
- What do you mean?…On Jul 20, 2017 05:20, "thanhthein" ***@***.***> wrote: sdsdsd — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#2017 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AAdU5Rr0vdS6Nr6z7JSmMpkZacaP6H1cks5sPseUgaJpZM4N9hv-> .
The instant app config requires the app to be separated into 3 modules
- The feature module (with the base code) - com.android.feature
- The application module - com.android.application
- The instant app module - com.android.instantapp
Now, since we moved the code from application -> feature module, Android Annotations is not working at all.
I am having the same issue. If someone could help, it would be great.
So the question again : Is there an android annotations version which supports instant app ?
@jaswanthm AndroidAnnotations fully support library projects. Please try to configure these as library projects.
Reacted by JaswanthHi, I've followed google's instructions with example project to learn migrating ordinary project to instant-apps project, here's the link: https://codelabs.developers.google.com/codelabs/android-instant-apps
And it works fine.
But when I add AA dependency and kotlin in
build.gradle:apply plugin: 'com.android.feature' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' ... kapt "org.androidannotations:androidannotations:4.4.0" implementation "org.androidannotations:androidannotations-api:4.4.0"And adding a simple annotation
@EViewin one of its classes, it won't compile, it says:e: error: Could not find the AndroidManifest.xml file, using generation folder [/Users/mrhabibi/Projects/android-topeka/topeka-base/build/generated/source/kapt/debugFeature]) :topeka-base:kaptDebugFeatureKotlin FAILEDI've been struggling for days and got stuck, actually I have other project that uses AA too and get the same problem, can anyone help me with this? Thanks.
I'm currently working on Android instant apps by using the android-topeka example project.
Everything works as expected, after I'm using AndroidAnnotations on my Activity:
@EActivity(resName = "activity_start") public class StartActivity extends AppCompatActivity { ... }If I want to start the application(
:installed) one, everything works, but for the instant-app(:instant), I get the following error::base:javaPreCompileDebugFeature UP-TO-DATE error: The generated <applicationId>.R class cannot be found 1 error :base:compileDebugFeatureJavaWithJavac FAILEDAdditional Info:
If I remove the
application project(':installed')in the base
build.gradle I can start the instant-app but with the wrong
application-id (configured in the:installedproject).@ManuelSchmitzberger this only happens when AndroidAnnotations is added to the project? Looks strange to me, as from what you have posted as errors I'm not sure how AA could be involved in the issue. 🤔
Can you provide an up to date demo project (ready for AS 3.2.1 and latest tooles)? then I can try to check what is worng or needs to be done.
@dodgex Thx for your response!
@ManuelSchmitzberger this only happens when AndroidAnnotations is added to the project? Looks strange to me, as from what you have posted as errors I'm not sure how AA could be involved in the issue.
yes.
Can you provide an up to date demo project (ready for AS 3.2.1 and latest tooles)? then I can try to check what is worng or needs to be done.
Here you can download the project setup.
How you can reproduce:
- run the :instant configuration -> everything fine
- add the
@EActivity(resName = "activity_start")annotation to theStartActivityclass (base-project) - change
android:name="com.test.StartActivity"toandroid:name="com.test.StartActivity_"in the Manifest (also in the base-project) - run the :instant configuration again
- now you can see the error:
error: The generated com.test2.R class cannot be found
@ManuelSchmitzberger not sure how you got to the r class error...
I updated the project to AS 3.2.1 - as requested - and with latest AA i get AndroidManifest cant be found, as mrhabibi posted in april.
i'll see if i find a way to fix the manifest finder issue and see if the build works then.
I think i got a working build with instant app. not yet tested if the result runs, and if it works with split/flavours. so i have to do some more testing and cleanup but i'm confident to get it fully working. :)
@ManuelSchmitzberger can you test for your version of the project configuration if it works with the following config in your
base\build.gradleI migrated my project to gradle build plugin 3.2.1 and after fixing the Manifest Finder issues i got the
error: The generated com.test2.R class cannot be founderror but the given option fixed it for me. :)android { // ... defaultConfig { // ... javaCompileOptions { annotationProcessorOptions { arguments = ["resourcePackageName": "com.test"] } } } }Reacted by Manuel Schmitzberger@dodgex Thank you very much! It's so strange, I've tested that several times and now it seems to work.
you saved my day!
hi, i'm refering to instant app codelab from google i/o, i moved the files from application module to base feature module (no feature module for now), but several times as i tried, the file is not generated. I'd like to know is there anyway i can make it work?
Thx