3

I had a power cut, and after opening the android studio, I get this error every time I open android studio, my files- all of them are affected by this.how to fix it?

Error:resource style/Base.AlertDialog.AppCompat (akacom.example.patta.avoid:style/Base.AlertDialog.AppCompat) not found.
Error:failed linking references.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':app:processDebugResources'.

Failed to execute aapt

Ravi Kilnake
  • 175
  • 2
  • 14
  • show me your catlog or error msg – Ali Feb 17 '18 at 06:10
  • catlog? or logcat? .. i have edited the "message" which i get every time i open android studio – Ravi Kilnake Feb 17 '18 at 06:14
  • sry for my mistake but in your `style.xml` you added this style : ` – Ali Feb 17 '18 at 06:18
  • – Ravi Kilnake Feb 17 '18 at 06:20
  • this is your default `style` and error is you don't create custom `style` which u call other `xml` or `java` file so first u create custom `style` as i put in my answer and after that u call this `style` any where you want – Ali Feb 17 '18 at 06:28
  • it's happening with every project, on startup. i cant rebuild the project or clean it – Ravi Kilnake Feb 17 '18 at 06:33
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/165317/discussion-between-mohammad-ali-and-ravi-kilnake). – Ali Feb 17 '18 at 06:34

1 Answers1

2

i solved this with going to my app:gradle updating my compilesdk to 27 and compile 'com.android.support:appcompat-v7:27.0.2'

along with maven { url 'https://maven.google.com' } to my project:gradle under all projects

Ravi Kilnake
  • 175
  • 2
  • 14
  • If you had an appcompat dependency before and it compiled before the power cut, it is possible that your gradle cache got corrupted. If that's the case, try manually deleting the gradle cache (~/.gradle) and using the previous version of appcompat to confirm. – Izabela Orlowska Feb 19 '18 at 10:52
  • please guide me, the problem is still present whenever I open a new project – Ravi Kilnake Feb 20 '18 at 05:00
  • Did you try invalidating the cache and deleting the ~/.gradle directory? – Izabela Orlowska Feb 20 '18 at 15:18