John Raptis
John Raptis

Reputation: 197

Upgraded Android Studio... now when I try to run my apps, I get "No implementation found" for my main activity

Upgraded Android studio (stupid, right?). Now not only can I not hit alt-E, C to do a copy, but some older apps of mine, that I need to support, no longer run. These are apps that were put together with Android Studio 1.x.

First off, when I tried to compile, it demanded that I put "-keepattributes InnerClasses" in my proguard rules. Just including that in case it's some kind of hint.

The program compiles fine, but then it runs and quits instantly. Looking at Logcat, I see this:

2021-03-18 22:02:34.960 6147-6147/com.mycompany.myapp E/ycompany.myapp: No implementation found for java.lang.String com.mycompany.myapp.myappActivity.d() (tried Java_com_mycompany_myapp_myappActivity_d and Java_com_mycompany_myapp_myappActivity_d__)

Here's the weird part, though... in myactivity onCreate, I output a line of text. It gets there. That happens. It prints out ">>>>>CREATED APP<<<<<"

Can anyone explain what's happening? What do I need to do to fix this???

Upvotes: 1

Views: 61

Answers (1)

Crispert
Crispert

Reputation: 1167

A lot has changed since ASs 1.x especially with the gradle / android gradle plugin. These are very finicky even after minor updates. Nevertheless you're more or less forced to update to a newer (not necessarily the newest) IDE version. Not finding java.lang.String suggests some major incompatibility issue.

First you should check your JDK version (and ensure you have the full kit not just a JRE). Not all IDE versions work with all JDKs and again use an older one (10, 12) , not the absolute bleeding edge as the newest might not be supported (and android does not support newer java features anyway). I use JDK 12 and Ass 3.6.1. Also check the gradle version you're using since gradle also has its incompatibilities. Remember to also inspect the contents of JAVA_HOME and GRADLE_HOME environment variables (if they exist and are used by your project) since they may override the build tool versions that are used.

Your safest bet would be to create a new empty project and copy all your sources in it. That might take less time then trying to clean the existing project, migrate the plugins, gradle and so on.

Until you fix the project setup you can disable proguard to get rid of one more hassle by setting minifyEnabled false in your app/ build.gradle # buildTypes # release. Note that proguard is usually disabled for debug builds.

Upvotes: 1

Related Questions