-
Notifications
You must be signed in to change notification settings - Fork 9
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
Android Built failed #36
Comments
Is android error. |
No actually that's not the case, I'm able to build standalone cordova or anyother android app |
This is for cordova standalone everything is working fine.BUILD SUCCESSFUL in 5s |
That you can try to init new project with |
Still getting same errors in new projects, npm start works fine but npm run build and cordova run android gives error. |
I resolved those android issues, navigation plugin was causing all of that so I removed it. But now npm start is working fine on browser but showing blank screen on android. |
Already tried everything mentioned in Issue#13, it isn't resolved. |
I just went through the same, I also just removed the notification plugin. The blank screen is because 'deviceready' never fires because the cordova.js can't be loaded because cordova or reco isn't listening/serving anything on port 8597. I circumvented this by altering 'node_modules\cordova_script\dist\index.js' to always use the PUBLIC_URL and never ':8597/browser/www'. I just copy 'platforms\android\platform_www' to 'public' to make the necessary cordova.js and plugin js files available. Just my 2 ct. |
Great, Thanks, do you want access to the edit the code and help this project? |
Hi Or, I might, though honestly, time is very scarce. I see that current plain Cordova just copies cordova.js etc. to the platform www, as does your current react.cordova implementation. So it seems that actually the only thing that's needed is to just not use 'cordova_script' and add <script src="cordova.js"></script> to the public\index.html head in your template (as Cordova does). Works for me (on the browser and android platforms). |
Ah, one addition; npm run reactstart still requires the cordova.js scripts and fails without. |
Sorry for the intermittent updates; I see 'reco serve' does call bundleServe and therefore serves the current cordova.js, etc. on 8597 just fine and should therefore work with cordova_script. npm run reactstart can then be fixed by changing package.json reactstart to "reco serve", since that also provides live reloads. A Fast Refresh option would also be nice. ; ) Wouldn't a copy_dir (ie. from browser platform to public) in serve.js instead of 'cordova serve' be simpler, removing the need for cordova_script? Not super-elegant I guess. Just trying to help and I may very well be cutting corners here though. |
You're right. |
PS E:\repo-sync\hello_world> cordova run android
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=undefined (DEPRECATED)
Using Android SDK: C:\Users\afici\AppData\Local\Android\sdk
Subproject Path: CordovaLib
Subproject Path: app
FAILURE: Build failed with an exception.
Execution failed for task ':app:compileDebugJavaWithJavac'.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1s
25 actionable tasks: 1 executed, 24 up-to-date
Command failed with exit code 1: E:\repo-sync\hello_world\platforms\android\gradlew cdvBuildDebug -b E:\repo-sync\hello_world\platforms\android\build.gradle
The text was updated successfully, but these errors were encountered: