0

a while ago I made a little app. Unfortunately this was one year ago and something seems to have changed in my IDE or project again.

I can hit assembleDebug and end up with an apk file of my app. No errors show up in the log. When I try to open it on my device it will always say: a problem occurred when parsing the package. When I take a look into my build.grade I see that the appcompat dependency is underlined red.

If anyone can give a hint on how to have a good workflow I'd really appreciate it. Unfortunately I always get those and similar problems. I don't even risk updating my IDE anymore and am very frustrated. I am yet more a hobby developer and not concerned about having my apps always up to date with the lates android,gradlde version what so ever since I am still far away from releasing anything. I just want to code and open my project and be able to continue. I really don't understand what is always corrupting my setup, since my phone wasn't updated in the meanwhile either.

Any help is appreciated! enter image description here

yesyoor
  • 96
  • 8

2 Answers2

1

Support Libraries are no longer supported starting API Level 29. You need to replace the dependency to following :

implementation 'androidx.appcompat:appcompat:1.0.0'

Hope that helps :)

Roshan
  • 753
  • 5
  • 14
  • Nice, it worked, changed to 1.1.0 My mistake was setting min sdk version to 29 but my phone uses 25.... :D – yesyoor Nov 27 '19 at 01:01
0

Migration to Android X would solve the issue. Here are the steps based on the recent talk at Android Dev Summit '19 :

  1. Make sure your minSdkVersion is at least 28.
  2. Enable Jetifier by putting these lines to your gradle.properties file:

android.useAndroidX=true

android.enableJetifier=true

  1. Check whether your dependencies of third-party libraries you use are up-to-date.
  2. Use Android Studio tool for migrating by clicking on Refactor - Migrate to Android X...

This way, you may avoid a lot of headache by following the first 3 steps right before using that tool.

Community
  • 1
  • 1
Andrii Artamonov
  • 622
  • 8
  • 15
  • My min sdk version is 29, I added the two lines to my empty gradle.properties file. I don`t use any third-party libs. When I hit Migrate to Android X it ends saying "no usages found in this project" – yesyoor Nov 26 '19 at 23:39
  • @yesyoor Try to run your app on emulator or another real device. Your underlining is rather a warning than an error. I assume you need to enable app installation from unknown sources on your device which faced the issue – Andrii Artamonov Nov 27 '19 at 00:03
  • I am trying to run it on my phone. unknown sources are allowed there. Android version7.0. the parsing error appears on my phone – yesyoor Nov 27 '19 at 00:09
  • okay it was my own bad. my phone uses sdk25 and I had minsdk version set to 29... – yesyoor Nov 27 '19 at 01:02