Phonegap Build Second App Replaces first app - mobile

Good morning.
Ive been developing 2 different apps (HTMLs, CSS3, Javascript etc etc), I can develop one app, and install it on iOS Device (iPad), but when i try to install the second app, that is completely different to the 1st App, in both style and build, it replaces the first app.
Ive have been racking my brain for days over this.
Ive checked the config.xml file and all the app IDs are different.
<widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "uk.org.ebids-fueller"
versionCode = "10"
version = "1.0.0" >
And then in my other Config.xml file it shows the following:
<widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "uk.org.ebids-controller"
versionCode = "10"
version = "1.0.0" >
Even with a Third App it still replaces the previous builds:
<widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "uk.org.ebids-passengers"
versionCode = "10"
version = "1.0.0" >
Yet the second app will completely wipe the first app and replace it with the second app. This has never happened before, Ive been able to install multiple apps on a device and its never been a problem.
Can anybody help with this, what am i doing wrong? What am i missing? Any help is appreciated, Im not expecting people to write Code for me, im quite capable of doing that. I just don't understand where im going wrong or whats change or am i doing something different.
I have searched this forum for other peoples issues with this, i found one, but it did not resolve the situation for me.
Many thanks for any help.

Basically just change the android:package attribute in your manifest, and then refactor your src/ folders to follow that same package name.
As a command above, just 3 steps:
Remove platform cordova platform remove android
Edit config.xml (main folder) find & replace widget id
<widget id="com.foobar.mynewname" version="1.0.0" android-versionCode="1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
...
Add platform again cordova platform add android

Related

New Module connected with a Host App but Route to the module pages gives me a 404 error

I'm trying to get started with module development using Abp framework, the potential of using the framework is huge with the community and the abp.commercial support if it's needed, but it's not always easy to up and running the application. Let me explain...
I have created a new module: abp new sample.module -t module. ABP CLI version 3.3.1
After that, I have added a new entity in Domain (member.cs) and using AbpHelper.GUI to auto-generate all the code.
๐ŸŽ‰My module works correctly using Hosts/*.web.unified test project. Well done! :).๐ŸŽ‰
NOTE: see here if you want to know how to solve a tricky issue for me at this point.
Next, I have added assemblies one by one to the Host App. I have mapped:
Module.Application --> Host.Application
Module.Application.Contracts --> Host.Application.Contracts
Module.Domain --> Host.Domain
Module.Domain.Shared --> Host.Domain.Shared
Module.EntityFrameworkCore --> Host.EntityFrameworkCore
Module.HttpApi --> Host.HttpApi
Module.HttpApi.Client --> Host.HttpApi.Client
Module.Web --> Host.Web
Finally, I added Module Dependencies and Configurations, following this post.
๐ŸŽ‰ Restore, build, dotnet ef migrations, and *.HostApp.DbMigrator work like a charm and the database is updated based on the entities in the module. Cool! ๐ŸŽ‰
But... when I run my Host App and click on the new module menu contributor the route doesn't work ๐Ÿ˜’ but it seems to be correct based on the page structure of the module and it worked fine using Hosts/*.web.unified test project inside the module.
I tried several times with no lucky ๐Ÿคฆโ€โ™‚๏ธ
Something is missing in the code that I cannot see.
Any help is really appreciated.
Because the Host application and Module are in different solutions. I was missing to include an assembly (Module.Web.Views.dll) into the Host web project.

reactjs service worker not found .license file

I'm working on two React projects.
In both projects, the manifest.json file is set up correctly and The serviceworker is also registered.
In one of the projects, the question of adding to the home screen is not asked.
From the research I've done, I've found that a project that doesn't work properly can't find a file in .license format, but in a project that works properly, it's a file with a .license.txt format.
What makes the difference between the two files when it is taken from the building project? How can this problem be solved?
Photo of the project that works properly and displays the install app prompt
The project photo does not work properly and does not show the install app prompt
error message in console
Finally I found the solution to the problem. If you have ejected the project, you can add a field called extractComments with a false value in the webpack.config.js file in the TerserPlugin section. If you have not ejected the project, you can solve this problem by creating a webpack.config.js file and adding the Terser module with the default settings and adding the extractComments field with a false value. The following links may be helpful in understanding and resolving the issue.
license-to-kill-your-PWA
terser-plugin

request.getContextPath in React

I am building an Single-Page-Application where the front end is using ReactJS, and React Router.
The application shall be hosted with conventional app server either Tomcat or Weblogic (just due to whatever reason as required by our client).
My question is straight forward: in React, how could I get the application context path which is equivalent to request.getContextPath() as in jsp? I did many searching in google, but none of it could just give me a straight to the point answer. Whether react having such equivalent function? Or if I could grab this path from JSP? If so, how to grab it?
Thanks.
I had this problem as well and solved it like this:
In reactjs, when you are building your app for production, you need to run "npm run build".
To build it correctly, you need to set the homepage property in package.json to the main url of your site.
In my case I am using http://localhost:3000 for local development, and http://localhost:8080/myapp for stage testing.
That app needs to know if there is a "myapp" in the url or not. This is basically the problem of this post.
My answer is, because you need to specify the homepage property in package.json anyway, I am using this value to find my context path.
I am doing this like this:
{packageJson.homepage.substring(packageJson.homepage.lastIndexOf("/"))+"/login"}
For my test environment this returns: /login
For my stage environment this returns: /myapp/login
Maybe this helps.

built ExtJs 4.2, app doesn't run without old classes

I minified/built my app that uses ExtJS 4.2.0 (free version) using Sencha SDK Tools 2.0.0 beta3, and the app was built successfully. However, when I try deleting the old "app" folder containing my old classes, the app no longer works.
I also tried generating a new app using Sencha CMD 4.0.1.45 and then adding my classes, but the results are the same.
I am confused why this happens, because as I understood it, your old classes are not needed to deploy production app. In fact, the only javascript files you need to include in your "index.html" file are "ext.js" and "app-all.js".
I used Firebug and saw in the DOM that the app, along with my classes, are loaded.
I also noticed that "app-all.js" defines classes like this:
Ext.define("MyApp.view.MyClass"...
Is this really how it is supposed to behave? or am I missing something?
Thanks in advance!
Okay, I got it. A .js file in my application calls Ext.require on itself, causing the app wiring go crazy.

Sencha touch app remains on blue loading screen when viewing on Android device or emulator

I just created a basic sencha app by
sencha generate app --name AndroidDemo --path ../demo
and I viewed it in browser and everything is perfect.
I then followed the instructions here: http://www.sencha.com/blog/android-setup-for-sencha-touch/
and compiled the app with Sencha Cmd and when the emulator opens I only get a blue loading screen.
I also tried compiling/building the app with phonegap on phonegap build site and the build finishes successfully and after loading the app in my andoid device, again I only see the loading page and it stays on this page and the app does not launch.
I'm completely clueless. Need your help friends.
Thanks,
In your app code may be miner syntax error or other error so while app run in emulator check log cat or other option run or app in chrome and check console log. Because loading screen display in case of error as my expression with this.
i'm having the exact same problem..
(currently on windows, btw)
while it's not exactly a solution,
a workaround that i did (out of desperation to see the rest of my app on the emulator):
is to just install it directly to the emulator using the "adb" command.
haven't tried this on a mac, but i'm guessing it's almost the same thing?
after building the app using "sencha" cmd, open cmd/terminal to the build directory.
-assuming you did not change the output location, the apk will be created in your
project root folder under this folder:
"build\native-package-mobile\MYAPPNAME\packager.json\"
make sure the emulator is already running
run the following in command/terminal at the folder where the apk is located:
adb install -r MYAPPNAME.apk
wait for awhile and it should say successfully installed.
run the app in the emulator and hopefully it will go beyond the loading screen.
I don't know why this issue is happening though.
(only started tinkering with android dev/sencha yesterday and it seems to be doing all in it's power to prevent me from running my app. haha)
please share if you find the correct fix for this :)
This usually happens when you build your version and you did not imbed all needed components.
For example, when you use ...
Ext.Image
... in your code.
While running without ...
Sencha app build xxx
... Sencha will grab the component from the touch/src components folder.
But at the time you build the app, it cannot reference to that folder any longer and Sencha will stall.
Please open the console and look out for a warning like this:
[WARN][Anonymous] [Ext.Loader] Synchronously loading 'Ext.MessageBox';
consider adding 'Ext.MessageBox' explicitly as a require of the
corresponding class
You need to add these to the requires section of either App.js or a class where you use the item (here Ext.Messagebox).
Another way to find out what is happening is to run the build code inside the browser and look into the console (so instead of localhost/myapp/index.html you run localhost/myapp/build/{package}/{myapp}/index.html).
There is one other thing that might happen. Itโ€™s the scope of async operations.
Like this:
Ext.defer(function() {this.log(โ€˜all goodโ€™);}, 500);
this is not the scope of your class.
You need to use:
Ext.defer(function() {this.log(โ€˜all goodโ€™);}, 500, this);
Or you might even use ...
Ext.bind()
...to bind the scope to the function.

Resources