I recently buy one ionic project, i had tried a lot to generate APK file but unable to successful.
First i download the file and run cmd.goto the files directory.
i run the command ionic platform add android , bit it says
After Executing ionic platform add android
if i rename ionic.project to ionic.config.json and again execute ionic platform add android it says * Looks like a fresh checkout! No ./node_modules directory found. Would you like to install proj
ect dependencies?*
After installing npm i execute ionic build --release android but it does nothing and gives me warning
[WARN] Not performing Ionic build for project type: ionic1.
[WARN] Error with .\www\lib\ionic\version.json file: FILE_NOT_FOUND, trying .\bower.json.
Warning
Please help me out i am badly stuck.
Had the same problem after updating.
ionic lib update does not work if there is no www/lib/ionic.
You can create it though by copying manually from node_modules/ionic-sdk/release.
This removed the FILE_NOT_FOUND errors for me.
Related
I have a problem several days ago, I work in ubuntu and I would appreciate it very much if you help me :( I have a personal project that is finished and I want to get the apk, when I create the apk with ionic cap build I don't get any error, just a warn of Plugins are missing dependencies which I don't think is a problem, worse when I run ionic cap run and select the device either external or emulator I get Running Gradle build - failed! and at the end An error occurred while running thread capacitor. ionic cap build warning ionic cap run ERROR Also when I create the apk android studio opens automatically and I get this message: Error: Android Studio
WARNING
ERROR BUILD
Error Android Studio
I already tried deleting the node_modules folder, installing android studio, node, java,
gradle although I don't know if it installed correctly, etc.
1st image: You're missing the es6-promise-plugin. you need to install it
2nd and 3rd image: you are using an old version of gradle, which it is making it incompatible with what the compiler uses (8+). You need to install new version of gradle.
I've created a Vue project and add a cordova plugin, like this:
vue create app-test
vue add cordova
npm run cordova-serve-android
Everything works up to this point.
Then I've tried to do this:
vue add vuetify
When I run:
npm run cordova-serve-browser
Everything fine, but when I run
npm run cordova-serve-android
Just a blank screen was rendered
Examining the code with the debugger, there's no App.vue, nor HelloWorld.vue instantiated.
I've just find a lot of errors on console:
Failed to load resource: net::ERR_CONNECTION_REFUSED
https://localhost:8080/sockjs-node/info?t=1570409595173
Please suggest.
How It worked for me (without using vue cordova plugin)
Remove and install new version nodejs and cordova
Created a cordova project and added platform android (don't build or run android from the command prompt.. it will create lot of errors)
Then open the created android project (\platforms\android) in android studio (use the latest version of android studio),on open it will ask for gradle upgrade, then "Ok" to update the build gradle and wait for the update finish.
then run the project from android studio,
if the cordova hellworld project is working, then replace the content of 'platforms\android\app\src\main\assets\www\' with the content in 'dist' folder created by using the vuejs build command.
Then run the project from the android again, Now you can view your app
(optional) if you are sending non https requests from the app, then android:usesCleartextTraffic="true" in the AndroidManifest.xml file
Note : You have to build the vuetify project every time to generate 'dist' folder and need replace the files in www folder
I tried to update android in an existing phonegap project, told me fetching 7.0.0 ... completed. when I list platforms, it told me 6.3.0 was installed. So I did
phonegap platform remove android
phonegap platform add android
and copied my jks into platforms/android again.
phonegap build android (--release) is both telling me:
[phonegap] executing 'cordova build android' ...
[phonegap] completed 'cordova build android --no-telemetry'
But I cant find my outputs folder. Neither in platforms/android/build (I only have folder "android-profile" with a json and a rowproto file for every build) nor in platforms/android/app/build (there are folders "intermediate" and "generated"). I already searched for android-release-unsigned.apk and app-release-unigned.apk - nothing found.
Anybody an idea where to search or find out why it isn't created although there are no errors?
Thanks in advance
The answer can be found by adding "-d" to the build command. Then phonegap gives detailed information on build problems. In my case it could not find google-services.json
I faced the same issue and found that the output directory has been changed from ..platforms\android\build to ..\platforms\android\app\build\outputs\apk\debug
You could check the above directory.
While trying to do a release using the following command:
code-push release-cordova myApp android
I'm getting the following error in the terminal:
Running "cordova prepare" command:
[Error] Unable to prepare project. Please ensure that this is a Cordova project and that platform "android" was added with "cordova platform add android"
Any one knows what might be wrong? The project is a cordova project created using the command:
cordova create myApp
And also has android platform added.
UPDATE :
Running cordova prepare android --verbose returns the following output :
Executing "before_prepare" hook for all plugins.
Searching PlatformJson files for differences between project vs. platform installed plugins
No differences found between project and android platform. Continuing...
Generating config.xml from defaults for platform "android"
Wrote out Android application name to "HelloCordova"
Wrote out Android package name to "io.cordova.hellocordova"
This app does not have launcher icons defined
updated project successfully
Executing "after_prepare" hook for all plugins.
Make sure your Nodejs is the last version.
code-push-cli required "child_process"
That error indicates that the current working directory didn't represent the root of a Cordova project at the time that you ran the release-cordova command. Can you make sure that you CD into the directory that contains the www, platforms, plugins, etc. directories, and then run the release-cordova command? That should do the trick for you
So I've tried posting some of these issues on the Phonegap forum but have not heard from anyone regarding my issues...
I recently upgraded from PG 2.9 to 3.3 and am having trouble adjusting my project to the change... it should be as easy as installing phonegap 3.3 and creating a new project and dragging my /www to the root of the project and calling the cordova CLI commands to build and update my project-- both of which say that they complete successfully.
But it's not that easy! Instead, building and updating my project deletes the cordova2.9.jar and does not create a 3.3.0 jar... so I build it myself which goes fine. I stick it in my /libs folder and my app loads on my phone finally... The problem now is that running in PG 3 requires a change in how API calls are handled-- they are all plugins which you have to install before using them... so I installed all of the needed plugins...
The problem now is this message in logcat within Eclipse:
Unable to open asset URL: file:///android_asset/www/cordova/lib/cordova_plugins.js
so I find this cordova_plugins.js file in the root of my assets/www/ directory (Why is it here?! Shouldn't this be automated by cordova build & update to the correct location?!) So I try to copy the file to /www/cordova/lib/ where the error reports it is trying to find it.
When I do this, I get all of these errors:
Unable to open asset URL:file:///android_asset/www/cordova/lib/plugins/org.apache.cordova.file/www/DirectoryEntry.js
Unable to open asset URL:file:///android_asset/www/cordova/lib/plugins/org.apache.cordova.file/www/DirectoryReader.js
Unable to open asset URL:file:///android_asset/www/cordova/lib/plugins/org.apache.cordova.file/www/File.js
Unable to open asset URL:file:///android_asset/www/cordova/lib/plugins/org.apache.cordova.file/www/Entry.js
...etc (basically every plug-in that I had installed in the project.)
I am clearly missing something here... relocating these javascript files to the correct directory manually should not be what I need to do...
I should mention that this original error occurred when I was running the application in PG2.9 but the only plugins that I needed to use were included by default so I could still use the needed API functionalities.
Any ideas here?
You must need to create and deploy any phonegap project/application using Phonegap Command Line Interface
To Create any project write following command on command line:
$ phonegap create <path> <package_name> <project_name>
i.e.
$ phonegap create hello com.example.hello HelloWorld
To add any platform to your project:
cd <path_to_project>
$ phonegap build <platform>
i.e.
cd hello
$ phonegap build ios
$ phonegap build android
To add any plugin feature to your project:
cd <path_to_project>
$ phonegap local plugin add <path_to_plugin>
i.e.
cd hello
$ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git