IOS Build fails with annotations -


my ios builds fail if i´m using custom annotation (very simple one) following message:

error while working class: java/lang/annotation/annotation file:com_we4it_aveedo_testanno no class definition 

and snipped build log annotation class:

/var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/t/build5199219966381817658xxx/dist/myapplication-src/com_we4it_aveedo_testanno.m:2:73: error: use of undeclared identifier 'class__java_lang_annotation_annotation'; did mean 'class__java_lang_instantiationexception'? const struct clazz *base_interfaces_for_com_we4it_aveedo_testanno[] = {&class__java_lang_annotation_annotation};                                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                     class__java_lang_instantiationexception in file included /var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/t/build5199219966381817658xxx/dist/myapplication-src/com_we4it_aveedo_testanno.m:1: in file included /var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/t/build5199219966381817658xxx/dist/myapplication-src/myapplication-prefix.pch:20: in file included /var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/t/build5199219966381817658xxx/dist/myapplication-src/java_lang_class.h:8: /var/folders/zh/kb_4hqhn4kg1h0r5dp_6htcm0000gn/t/build5199219966381817658xxx/dist/myapplication-src/java_lang_instantiationexception.h:7:21: note: 'class__java_lang_instantiationexception' declared here extern struct clazz class__java_lang_instantiationexception; 

annotation code:

import java.lang.annotation.elementtype; import java.lang.annotation.retention; import java.lang.annotation.retentionpolicy; import java.lang.annotation.target;  @retention(retentionpolicy.runtime) @target(elementtype.type) public @interface testanno {     public string kuchen(); } 

using in application following code enough break build.

class forname = class.forname("justfortest"); testanno classnameannotation = (testanno) forname.getannotation(testanno.class); 

the problem second line causes error. approach, failed, following code:

class forname = class.forname("justfortest"); annotation[] annotation = forname.getannotations(); (annotation : annotation) {     if (a instanceof testanno)     {         testanno testanno = (testanno) a;      } } 

getting annotations works fine, casting explicit annotation breaks build there.

is there approach work annotations or bug or isnt supported ios?

since don't support reflection supporting runtime annotations doesn't make sense see: https://www.codenameone.com/blog/why-we-dont-support-the-full-java-api.html

since mobile apps static , compiled ahead of time isn't necessary , won't save anything.


Comments

Popular posts from this blog

unity3d - Rotate an object to face an opposite direction -

angular - Is it possible to get native element for formControl? -

javascript - Why jQuery Select box change event is now working? -