S
S
sergeevpetro2019-03-02 17:57:35
Android
sergeevpetro, 2019-03-02 17:57:35

How to solve "error: resource not found" error?

Created a simple HelloWorld application in android studio 3.3.1. Everything works, there are no errors. I uploaded the sources using File->Export to Zip file... You
need to build the application on an Ubuntu server. I do according to the official manual using aapt2 .
I did the compilation like this:

aapt2 compile --dir /root/itstest/app/src/main/res/ -o /root/compile_output/compiled.zip

link like this:
aapt2 link -o /root/link_output/unsigned_app.apk -I /root/platforms/android-28/android.jar --manifest /root/itstest/app/src/main/AndroidManifest.xml -R /root/compile_output/ *.flat

gives an error message:
error: resource style/Theme.AppCompat.Light.DarkActionBar (aka com.petro.itstest:style/Theme.AppCompat.Light.DarkActionBar) not found.
/root/itstest/app/src/main/res/values/styles.xml:6: error: style attribute 'attr/colorPrimary (aka com.petro.itstest:attr/colorPrimary)' not found.
/root/itstest/app/src/main/res/values/styles.xml:7: error: style attribute 'attr/colorPrimaryDark (aka com.petro.itstest:attr/colorPrimaryDark)' not found.
/root/itstest/app/src/main/res/values/styles.xml:8: error: style attribute 'attr/colorAccent (aka com.petro.itstest:attr/colorAccent)' not found.
error: failed linking references.

I tried a bunch of different options... Including elementary Invalidate caches/Restart...
style.xml
<resources>
    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item type="attr" name="colorPrimary">@color/colorPrimary</item>
        <item type="attr" name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item type="attr" name="colorAccent">@color/colorAccent</item>
    </style>
</resources>

Tell me what's wrong?! Already ran out of ideas.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
grinat, 2019-03-02
@grinat

I suspect there is simply no android sdk or the version is not the same, so he cannot find the standard theme. Here you can look at what you need to install: https://github.com/ccplay/docker-android-aapt/blob...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question