Have someone encountered problem when after prepare some data removes from AndroidManifest?
I add platform with android, when I prepare android platform, some values get lost from the AndroidManifest.
If i delete android.json and make prepare againg, it pulls the correct values.
Have someone been in touch with problem like this?
I have not seen such issue myself, but I would check installed plugin's plugin.xml files for 'after_platform_add' or 'before _platform_add' hooks scripts. and if one of the plugins is not altering AndroidManifest file in wrong way after/before platform add.
Related
I would like a way to access my expansion file in Cordova.
The issue is that the plugin I've heard most people recommend;
https://github.com/agamemnus/cordova-plugin-xapkreader
requires a bit more effort to get it working, namely modifying boilerplate Cordova files. I don't get to see or access these files with PhoneGap Build as it generates and compiles these files, along with my www files, into an apk in one go.
Is there a way to get this plugin working with PhoneGap Build, and if not, is there an alternative that I could perhaps use?
I eventually figured it out. I'll leave the answer here for anyone that may have a the same problem I did.
So this plugin: https://github.com/agamemnus/cordova-plugin-xapkreader
Works just fine with Phonegap Build. The issue was actually with the methods I was trying to use in setting it up correctly. The correct steps to take are as follows:
In your root/config.xml file, add the following:
<plugin name="com.flyingsoftgames.xapkeader" spec="https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0">
<variable name="XAPK_EXPANSION_AUTHORITY" value="YOUR_APP_NAME" />
<variable name="XAPK_PUBLIC_KEY" value="YOUR_GOOGLE_KEY"/>
</plugin>
Wherever you want a file to access the apk expansion file, use the following syntax:
content://YOUR_APP_NAME/path/to/file.jpg
This is fairly clear about it in the documentation, but it's worth noting that you set the path correctly. A lot of tutorials online will have you write something like:
content://YOUR_APP_NAME/main_expansion/path/to/file.jpg
This made me believe that the main_expansion portion of the path was a syntax meant for the plugin to access the main expansion file and not the patch expansion file, but this is resolved by the plugin as it prefers files in the patch to the main automatically.
The main_expansion portion is there because that's the file path that the tutorials online created. So their actual file path would be
main_expansion/images/funny_image.jpg
whereas mine was something like
audio_files/dialog/hello.mp3
It sounds so simple but this caused me an unnecessary amount of trouble.
Also, it's worth noting that it didn't work when I was using Cordova cli 6.2.0, but worked when I upgraded to 6.5.0. This is done in your root/config.xml file:
<preference name="phonegap-version" value="cli-6.5.0" />
I'm struggling for some days to do that. Without success.
I've found two ways that I think reasonably to follow:
1: Plugin cordova-sftp-plugin.
I see that it is writted to deal with 'secure ftp', but why wouldn't work in an ordinary non secure ftp? Nothing was metioned about it.
I've tried so, applying the 'Use Example' from the official page, the code fells in the success callback function, but when I list the local directory, nothing was changed! It gives me no clue about what goes wrong! In true, the software does not detect nothing wrong.
Before the previous steps, I did not forget to precautionally install and enable the 'cordova-plugin-file', 'cordova-plugin-file-transfer' and 'cordova-plugin-network-information' and to add the <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> in the AndroidManifest.xml. Tryied to save files in cordova.file.externalRootDirectory and cordova.file.externalRootDirectory + "/Downloads/. Nothing worked.
2. The macdonst FtpClient plugin.
Searching for my issue, one of the first pages that appears is How to ftp a file over to a server from PhoneGap/webapp?, and beyond some further search I've found another one in a relatively old post mentioned the successful use this plugin in a Cordova application. So I can consider this plugin as a stable choice.
The problem with this method comes earlier: I coundn't even build the application after a manual installation proccess. May it is a problem in the manual installation proccess.
The official plugin documentation teachs to install it in a PhoneGap application, and not a Cordova. The steps was not replicable to Cordova, due to some differences in paths and configuration, and some others links also supports the plugin installation solely in Phonegap, not Cordova.
I also tryied follow the steps in the http://antonylees.blogspot.com.br/2015/01/how-to-manually-add-cordova-plugins-to.html and Manually install Device plugin (and others) into cordova 3.0 to manually add the plugin. The steps in the first link also was not well replicable, and although the second one are more straitfoward, also does not solved the issue.
Building it gives me a java error compilation. The first error output (what uses to cause all the following errors are):
E:\danilo\Documentos\projetos_cordova\ftpDownload3\platforms\android\src\com\phonegap\plugins\ftpclient\FtpClient.java:27:
error: package org.apache.cordova.api does not exist
import org.apache.cordova.api.CallbackContext;
Very strange. May I have to search for the org.apache.cordova.api jar file and put in the lib folder? Also, I did not forget to put the commons-net-2.2.jar in the project libs folder.
Can anyone have some suggestion to succeed this? I just want to download a file through ftp protocol and save locally and so, if there's an alternative method to succeed, it will be appreciated too.
Thanks in advance.
I am working on a Visual Studio Cordova project which works on Windows, iOS and Android, and looking for AndroidManifest.xml or a build settings file and couldn't find any. I tried building it with no errors, but still couldn't find the file. Any suggestions, where/what I should be looking for?
It should be in your project root inside platforms/android.
Cordova generates a AndroidManifest.xml in platforms/android, but it's going to be reseted with each rebuild. If you need to add some data to it, you will have to create your own AndroidManifest.xml in res/native/android that will be automatically merged to the one in platforms/android.
You can read (a bit) more in the official documentation: https://msdn.microsoft.com/en-us/library/Dn757053.aspx
I have a unity project with multiple android plugins.
The plugins are placed in the recommended folders /Assets/Plugins/Android/NameOfPlugin and each have their own AndroidManifest.xml and .project file.
I also have an AndroidManifest.xml in /Assets/Plugins/Android
When building out a .apk from any of the dev machines in studio, the AndroidManifest is correctly compiled into a single .xml file containing all required activities.
However, when building on a Mac Mini via commandline this does not happen. The AndroidManifest.xml is missing required code and the app doesn't work.
I have done fresh installs of everything, tried different configurations, loads of things but to no avail. Anyone have any ideas as to what might be going wrong?
One of Dan's colleagues here, and after doing a straight up text diff on the two "Editor.log" files of Unity's editor, there was one glaring line that was missing from the broken builder,
DisplayProgressbar: Android Library Support
Googling that lead me to http://answers.unity3d.com/questions/792979/android-library-support-build-issue.html who had already discovered the answer, which was damn near exactly the same as what we had suffered,
It appears having a "." in the name of a directory on the build path results in failure of the android-libraries to be correctly found and added to the StagingArea.
Moving our repository on the Autobuilder from ~/.jenkins/workspace/game_project to ~/game_project fixed the issue.
We've just done the same ourselves, and it's solved the issue.
I am working on an android app with Phonegap and Jquery Mobile which I will compile with build.phonegap.com.
I first want to know the difference between Manifest.xml and config.xml files, and also whether it is required to add androidManifest.xml when i am uploading the files to build.phonegap.com.
Secondly i will like to know if there will a device problem assuming i add three different Manifest.xml for three difference devices eg, android, ios and blackberry when i upload the files to phonegap build.
Thank you
First Answer: Diff between manifest.xm and config.xml files .... now manifest is where u declare stuff like
1> Package
2>version
3> install location and many more btw i just finish one of my phongap and there is not config in my files though ...
second question .. i dont know about that david ... you can probly go to google !!
First of all manifest.xml is using only for your android application. It defines permissions, services, broadcastresivers ,activities and intents. This file will be using by JVM to register your application on device.
Config.xml is using for cordova library, to define all plugins(interfaces between js and jsvs layer).