0

I have the exact same issue as the following: dex file does not contain MainActivity class

Since I cant ask for extra help on that thread I have to recreate one.

My comment: "I still have the same issue. Its an copy older Cordova project (which I recently updated for one client, without any issues). I renamed the project; changed up some resource files, and now I keep getting the same issue as the initial thread creator. I tried all the suggestions, None seem to work for me. Any clues on what is happening, would I need to change around more then just the name and bundle id's. The main activity is linked to the correct name, but when the APK is build and I go open the apk in android studio, it does not show me the folder for the app 'name' where the mainactivity should be.

I do not have the 'gen' folder. So I cannot remove that, unless these are special folders you can only see at some point?"

Im getting fairly frustrated, I checked all the project files for the build that is not working and a working build [2]. I tried to reproduce the issue with the old build, but that one just seems to work. If I make an exact copy of that build, change up the bundle id's [1]. It just doesnt work.

[1][2]: https://i.stack.imgur.com/OJVy7.jpg

EDIT: The fix that worked for me was: Changing the bundle ID; I assume that the name contained something ilegal? The thing I changed in the bundle id was: 'com.companyname.cvs' The thing that broke it was the 'cvs'. As soon as I renamed it, and reproduced the steps I did before, it fixed it.

Tim D
  • 21
  • 3
  • Stupid, but in some cases i also get this error. Try to run cordova rebuild ( or build if you wish ) then open Android project and try to launch. If doesn't help - Clean project - Rebuild – Developer Jul 02 '19 at 19:13
  • @Cheese See my Edit. With me it was an issue with bundle id naming... No good explanation for how or what. But that solved it for me. – Tim D Jul 03 '19 at 09:28
  • Interesting, would be glad to hear why is that. Maybe because CVS is a registered app name already? – Developer Jul 03 '19 at 16:38

0 Answers0