Answer the question
In order to leave comments, you need to log in
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
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
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.
<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>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question