My target is run my application using aapt2 and build aab (for me aapt1 was as workaround) - i made app for testing… I need to run my aps in new f… google way
This project built ok whit aapt2 always but crashed after start - did you run in physically on any device or emualtor ?? (didn’t find class codescanner which is used in main window) - on aapt1 all worked - problem was only here in aapt2.
Should i download and testing something - because I back to office…
That part should be fixed by mynchanges today, then
I did not try running at all. I only made it compile.
With aapt2 now after compiling and running I get :
Resource not found…
I need aapt2 compiling and running (here is problem)
AApt1 works ok now.
I looked into R.java x7f090002 identifier doesn’t exists so as I wrote new aapt2 identifiers are broken but I don’t know how it is correlated to dex files, source files etc… I can’t help you here…
This seems to be progress; it’s no longer failing on the missing R class, but now it cant find one of the resources. Who k owes why, though, as the message is a bit cryptic…
Marc how this R.Java file is generated and linked with code ? as I know R.layout.main for example is used in Acictivity for example (is this linked to dex later) ?
the R.java files get generated as part off the build (when processing the .aar), and they get passed to the compiler to be compiled into the ,jar and eventually .dex. This is the part I fixed. Note that the R classes merely have constants with IDs that match to resources. The actual resources are handled by aapt(2).
Now that I think of it though, the way the R.java gets generated not by aapt but by myself, these IDs might not match what aapt2 generates internally. This “fix” probably isn’t good enough, and we really need the R.java files from aapt2 — I dont understand why we dont get them, as I pass the --java parameter…
Marc in R.java r.layout.main
public static final class layout {
public static final int main=0x7f040000;
}
is declared but apk is looking for #0x7f090002
I got the same problem using command line when was the problem with duplicated resources…
You have to try to compile this resources using of course aapt2 and try to link them - the process should be without errors - maybe here is the hint …
Do you try with codescanner simple app I gave you ? Appcompat is more complex with many aars and resources… this one is simpler.
Thats the one I have been using, yes
I looked into aapt2 did you look into
–no-resource-deduping
–non-final-ids or
–stable-ids?? In linking mode?
I think the problem is that aapt2 link
generates one R.java with all the resources in the apps namespace. if I look at
/Users/mh/Library/Application Support/RemObjects Software/EBuild/Obj/org.me.androidapplication5-95718CDD32B3A7C8EC42E7AECFCBAE7BF73B7026/Debug/Cooper-Android/java/org/me/androidapplication5/R.java
it is huge and has all the resources, but they are all in
package org.me.androidapplication5;
public final class R {
it’s almost as if I should link each .aar
’s resources individually, maybe? but I’m not sure if/how we could combine this afterwards…
Can you compare ebuild steps with this one:
It is directed to appcompatactivity but maybe it helps… They compile resources with 2 zips and linked them and generate r. Java it works for me too but i dont know what to do to use proper ids in apk and hiw in dex?
I played with apk generated using apt, used this option and to compile and link resources zipalign and sign and when identifies were. Ok app starts and run properly but as you know my kniwledge about connection with code was poor…
Nope. linking per ear doesnt work, as link wants a manifest, and then it fails on
AndroidManifest.xml, line 7 — aapt2 link: resource drawable/icon (aka inprax.pl.testapp:drawable/icon) not found.
AndroidManifest.xml, line 7 — aapt2 link: resource string/app_name (aka inprax.pl.testapp:string/app_name) not found.
AndroidManifest.xml, line 12 — aapt2 link: resource string/app_name (aka inprax.pl.testapp:string/app_name) not found.
But these resources are from apk folder/res not.from library
Exactly
Think I got something…
I cant wait…