I came across this strange problem while testing my app on a Galaxy S III. It works fine on other devices.
The subject class goes like this:
public class MyClass extends Service {
public void onCreate() {
super.onCreate();
// do stuff
}
}
Other people have had the same problem and it seems to be related to the built of the source code. However, I don't know how to solve this on Android Studio.
SOLVED
It appears that the cause of the problem where the camera2 APIs which were used in that class. Those APIs target Lollipop and above and for that reason the app was crashing trying to resolve the imports,even if at runtime I wasn't using any unavailable method (checking the build version of the device).
I'm not sure about the reason of this, but anyway moving the Camera2 implementation to another class fixed the problem.