-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BuildHelper provokes ClassNotFoundException when applicationid is not same as manifest package name #513
Comments
having problem with the camera too in 7.1.1, it wont work anymore. |
@freddycrugger, if you're getting the java.lang.ClassNotFoundException error try manually editing the execute method in CameraLauncher.java (in folder platform\android\app\src\main\java\org\apache\cordova\camera) to use the value returned by If that fixes the problem you might want to set up a hook to copy the patched version of CameraLauncher.java to platform\android\app\src\main\java\org\apache\cordova\camera to prevent losing the changes if the plugin is reinstalled (be careful too if you update the plugin - you may need to update the patched file too.) |
I reverted to 7.0.0 as I was getting too many issues(not just with the camera), thanks anyway. |
@cdmahoney You seem to have a good grasp of the problem, are you up to submitting a PR fixing this maybe? Thanks. |
@janpio OK, I'll submit a PR to fix the problem in the camera plugin. Will be doing it from home though, so may take a few days to get it done. |
@janpio - I just created pull request: Hope it's all in order - let me know if any changes required! |
Closing as PR #751 has been merged. |
Error occurs when trying to take picture with camera plugin. Abbreviated stack trace:
Error can be reproduced by defining applicationIdSuffix in build-extras.gradle, for example with
The problem is caused by BuildHelper calling 'context.getPackageName', which returns the application id, not the package name.
Ironically, the application id is what CameraLauncher is trying to get in the first place, so I've been able to fix the problem modifying code in CameraLauncher:
But I think this should really work out of the box... (maybe add a method to CordovaInterface to return BuildConfig, which could be informed optionally from the application's CordovaActivity implementation?)
The text was updated successfully, but these errors were encountered: