I am having failures to compile on app.component.ts, park-data.ts, and park-list.page.ts. I am following the national park tabs app in Mobile App Development with Ionic by Griffin. I am having trouble translating it into Ionic 4.
Followed steps in book, have attempted to use new Ionic 4. Worked until I got to the parks tab and providers. Most issues come from park-data.ts. I tried commenting out that pages code to see if I can get it to compile, only throws more errors.
Full code on https://github.com/Blen6035/TabsParksHaberman
resetList(event) {
this.parkData.getParks().then(theResult => {
this.parks = theResult;
})
}
I expect this to compile so I can proceed with styling. Parks tab should sho a list of national parks with search bar. When a park is clicked on more details about the park should open. Currently app will not compile when served.
Related
I'm updating an old Ionic app:
Angular: 8.2.9 => 11.2.12
Angular CLI: 8.3.8 => 11.2.11
Ionic: 4.10.0 => 5.6.6
Ionic CLI: 5.4.16 => 6.14.0
The app starts when i run it locally (using ionic serve), but the SVG-icons does not show.
If I look at one particular icon, I find two versions of the icon in the source files:
\src\assets\custom-ion-icons\md-br-home.svg
\src\assets\custom-ion-icons\ios-br-home.svg
The place where the icon is used looks lite this:
<ion-icon name="br-home"></ion-icon>
When running the old version of the app, the icon gets fetched and shown with this url:
http://localhost:8100/svg/md-br-home.svg
However, running after the update, the app requests this url:
http://localhost:8100/svg/br-home.svg
I'm not sure how the "md-" part is added in the old version of the app, but somehow this have disappeared.
If I change the filename of md-br-home.svg to br-home.svg, it works. Maybe that's the solution? But will this mess something up when I build and distribute this app? I'd like to get a better understanding of how this i supposed to work.
Just found the answer to my question.
Updating Ionic from 4 to 5 changes how icons (ionicons) are handled. Platform specific variants are no longer used, thus "md-" and "ios-" in filenames are no longer used.
https://github.com/ionic-team/ionicons/releases/tag/5.0.0
I just changed the names of the SVG-files beginning with "md-" (e.g. md-br-home.svg to br-home.svg), and then deleted the ones beginning with "ios-".
I also used some standard ionicons icons that had been removed or renamed, so I had to fix that too. A list of all changes is available on the page linked above.
GPG service does not work
It shows the native GPG window, but when it’s closed the PlayGamesPlatform.Instance.Authenticate() callback returns NetworkError
In the Google Play Console:
Created "Game service”.
In the “Game details” section, added a description 512x512 and 1024x500 icons.
In the “Linked apps” section, added an android application and completed authentication (OAuth 2.0 key was automatically created)
In the “Achievements” section, created an achievement with a description and a 512x512 icon.
In the "Testing" section added a gmail account for testing
In the “Publishing” section, clicked Publish.
In the Google API:
Activated Google Drive API and Google Play Android developer API (without creating any keys)
Checked the SHA-1 in the OAuth key for Android and in “Release management”> ”App singing”> ”App signing certificate”
In Unity:
Downloaded the latest release from https://github.com/playgameservices/play-games-plugin-for-unity
In Window> Google Play games> Setup> Android setup, copied the xml format text from the “Achievements” section of the Google Play Console using the “Get resources” link, the ClientID format is 123456789123456-fffffffffffffffffffffffff.apps.googleusercontent.com
The test build was signed with the same key as the application posted on Google Play with the same Company name and Product Name
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
.RequestIdToken()
.Build();
PlayGamesPlatform.DebugLogEnabled = true;
PlayGamesPlatform.InitializeInstance(config);
PlayGamesPlatform.Activate();
PlayGamesPlatform.Instance.Authenticate(SignInInteractivity.CanPromptAlways, ((SignInStatus status) =>
{
if (status == SignInStatus.Success)
{
print( $"Welcome {PlayGamesPlatform.Instance.GetUserDisplayName()}\n");
}
else
{
print($"Fail:{status}");
}
}));
On debugging in Unty Console I have
<i>AndroidPlayer(ADB#127.0.0.1:34999)</i> Returning an error code.
#0 0x443df5a (libunity.so) GetStacktrace(int) 0x25
#1 0x4e788b6 (libunity.so) DebugStringToFile(DebugStringToFileData const&) 0x169
#2 0x49875fe (libunity.so) DebugLogHandler::Internal_Log(LogType, LogOption, core::basic_string<char, core::StringStorageDefault<char> >, Object*) 0x65
#3 0x498754e (libunity.so) DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*) 0xb5
I just saw this. I had the same error. What I did to fix it was I toned down the bytecode stripping in the project settings. When I checked the unity developer console, I noticed the error stating that my game couldn't find the library for GooglePlayGames.
While this is not the IDEAL answer, it's a temporary fix. The Ideal answer is creating a Link.xml file that tells the compiler not to strip out library .so file.
(Which, I am searching for at the moment, and how I came across your question.)
I came across this post while trying to find the answer myself and now that I know the answer I thought I would add it in here.... so that I can no doubt discover it the next time I forget how to do this. The issue is caused by the minification as #CherryCoke stated.
The solution can be found here: https://github.com/playgameservices/play-games-plugin-for-unity/blob/master/README.md#decreasing-apk-size
You have two options: either turn off the minification or tell the minify process what to ignore when doing the minification.
If you want to minify your build (which makes sense to me for a release) then you can do so by selecting "Custom Proguard File" in the Publishing Settings area of the Android build in the Player Settings.
Once you have added this in you will need to update the proguard-user.txt file that is specified. The path is displayed under "Custom proguard File".
For google play services then the entries you need to add can be found at: https://github.com/playgameservices/play-games-plugin-for-unity/blob/master/scripts/proguard.txt
I'm having trouble with navCtrl.push. The flow is as follows:
n pages' 1.1, 1.2 and 1.3` I can go back and forth as many times as I want, but when I click the back button I need to return on page 1.
To go to the next page I use the button click event like this:
(Click) = "quickAccess ('Page1.1')"
And to go back I add navPop to my navbar` button.
THE MISTAKE
When I click on the back, you are returning parts for the pastes of pages 1.2, 1.2 and 1.3 if I have navigated 10 times between these pastes it will return the 10 times.
ATTEMPTS
I'm trying to follow the following thinking when I navigate for example from page 1.1 to1.2 I should remove '1.1and so on, but I'm having this problem, how do I do this, already tried to index byView name` but none of them work.
PLEASE NOTE
It is important to know that there are other pages prior to PAGE 1 the flow with problem is only in this case, in the rest everything goes as expected.
I found the problem!
According to this inssue no ionic team:
https://github.com/ionic-team/ionic/issues/12238
An error is occurring in the structure, a solution for installing the fix via npm as reported in inssue:
npm install ionic-angular # night
So my .remove () works perfectly now.
In our company, we've set up the Fiori launchpad. In it, we have configured a tile that is linked to a custom developed SAPUI5 app, which is deployed as a BSP on the server. It took us a long while, yet using the router pattern within that application, we managed to make the navigation from the launchpad tile to the custom UI5 application work.
The thing we are struggling with, however, are these 2 other navigation paths:
From the application back to the Fiori launchpad (back home)
From the application to another application (tile to tile)
Ideally, this out of application navigation is in the UI5 way, including a transition, so not just a window.replace in JS. After a long search, the only hint I've found in support for this scenario is in this class:
https://ui5.sap.com/#/api/sap.ushell.services.CrossApplicationNavigation
However, I don't understand how to use it. The example isn't even correct and has syntax errors. I've found two forum posts elsewhere asking about how to use it, but they lack any meaningful answer.
Assuming you are using Semantic Objects for in-place navigation configured in your Launchpad to navigate to UI5 Applications you can navigate from one Application to another using the CrossApplicationNavigation service you already mentioned. However, the documentation about it is slightly confusing. This is how it works for me:
// Step 1: Get Service for app to app navigation
var navigationService = sap.ushell.Container.getService("CrossApplicationNavigation");
// Step 2: Navigate using your semantic object
navigationService.toExternal({
target : { semanticObject : "<YourObject>", action: "<YourAction>" },
params : { A : "B" } // optionally
})
If you want to go back to your launchpad after in-place navigation you simply need to call
window.history.go(-1)
This still triggers the correct transition.
I've created a basic application (virtually no content, just a blank page) to test the SSO functionality. It doesn't work, when I test on the TV it gives the error error_cp_001.
The config.xml contains, among other things:
<cpauthjs>Authorization8888.js</cpauthjs>
<login>y</login>
The Authorization8888.js file contains:
var Authorization8888 = {};
Authorization8888.checkAccount = function(id, pw, cb) {
cb("TRUE");
};
I have already tried with <cpauthjs>Authorization8888</cpauthjs>. I have also tried with Authorization without 8888 for the filename and vars. It always shows that error.
I also tried in the SDK simulator, same error as on the real TV. On the simulator I see these extra debug lines:
[JS ALERT]: ####################22222eval(accountCheckFunc) error
[JS ALERT]: Fail to load Account check moudule.
Error : Can't find variable: Authorization8888
I can share the zip file containing the whole application, but it's really simple to reproduce since it has nothing except this basic SSO-related code.
I found the answer, posting it in case someone else hits the same problem.
The problem was deploying via USB. Apparently, an application deployed with the USB stick has limited functionality. Deploying the application via a web server fixed a lot of issues, including this one.