WordPress LMS for Web and mobile Forums WPLMS Student App typescript: src/components/question/question.ts, line: 26

typescript: src/components/question/question.ts, line: 26

Back to course
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #16147

    yasas
    Participant
    I'm setting up walks student app in ionic 3.12.o,8.1.2 ([email protected]) alos I install but I'm getting bellow errors. pls advice me npm install ng2dragula dragula save

    npm install videogular2 --save

    npm install @types/core-js --save-dev

    [20:57:19] typescript: src/components/question/question.ts, line: 26

    Cannot find name 'DragulaService'.

    L25: constructor(private config:ConfigService,

    L26: private dragulaService: DragulaService) {

    [20:57:19] typescript: src/services/imageCache.ts, line: 75

    Property 'applicationStorageDirectory' does not exist on type 'File'.

    L74: private normalizeURlWKWview(url: string) {

    L75: const urlIos = ${normalizeURL(this.file.applicationStorageDirectory)}Library/files/${normalizeURL(url)};

    L76: return urlIos.replace('/localhost/persistent', '');

    #16151

    admin
    Member

    Rename the node_modules folder in your ionic project from node_modules  to ” [email protected]@@@  ” and then :

    In your ionic project folder replace the package.json file with the one given in below link

     https://bit.ly/2I2F732

    and in command prompt or terminal run this command :

    npm install

    after that please follow :

    First remove the android platform :

    cordova platform rm android

    Please also make sure you have installed  these plugins in your ionic setup :

    cordova-plugin-camera 2.4.1 “Camera”

    cordova-plugin-compat 1.2.0 “Compat”

    cordova-plugin-console 1.0.5 “Console”

    cordova-plugin-device 1.1.7 “Device”

    cordova-plugin-facebook4 1.7.4 “Facebook Connect”

    cordova-plugin-file 4.3.3 “File”

    cordova-plugin-file-transfer 1.6.3 “File Transfer”

    cordova-plugin-googleplus 5.3.2 “Google SignIn”

    cordova-plugin-inappbrowser 1.7.2 “InAppBrowser”

    cordova-plugin-inapppurchase 1.1.0 “In App Purchase”

    cordova-plugin-splashscreen 4.1.0 “Splashscreen”

    cordova-plugin-statusbar 2.4.2 “StatusBar”

    cordova-plugin-whitelist 1.3.3 “Whitelist”

    cordova-sqlite-storage 2.0.4 “Cordova sqlite storage plugin”

    ionic-plugin-keyboard 2.2.1 “Keyboard”

    Please check for the corodova plugins .

    Install the cordova plugins with their versions mentioned above .

    first remove plugin :

    cordova plugin rm {cordova plugin name}

    the add

    cordova plugin add {cordova plugin name}@{version} 

     example :

    cordova plugin add [email protected]

    then re -add platform :

    cordova platform add [email protected]

    #16169

    yasas
    Participant
    Thanks Alex, Now Im getting bellow error but Application stated with gray color landing page. [05:21:39] tslint: src/models/user.ts, line: 1 All imports on this line are unused. L1: import { Course } from './course'; [05:21:39] tslint: src/services/activity.ts, line: 28 'observable' is declared but never used. L27: private lastpushed:number=0; L28: private observable: Observable; //Tracks request in progress [05:21:39] tslint: src/services/activity.ts, line: 32 Property 'platform' is declared but never used. L31: private http:Http, L32: private platform : Platform, L33: private storage: Storage, ............. Please advice me.
    #16179

    admin
    Member
    Well all of these are just simple warnings for the variables that were initialized but never used . I guess the app should be working fine ?   If not then please share the whole error that you get in cmd or terminal in txt file to get hint about it .
    #16257

    yasas
    Participant
    Dear Alex, Thank you for your support. When I ran Ionic serve command. Im getting bellow errors and I already added bellow lines to .htacess file in the web server. Please advice. <IfModule mod_headers.c> Header set Access-Control-Allow-Origin "*" </IfModule> <IfModule mod_headers.c> Access-Control-Allow-Methods "*" </IfModule> </FilesMatch>   Access to fetch at 'http://www.learningpal24by7.com/wp-json/wplms/v1/course/featured?per_view=5' from origin 'http://localhost:8100' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
    #16282

    admin
    Member
    Well please tell if you are getting this warming in app or in browser itself ? If you are getting it in browser then please try adding this extension and enable CORS .   IF its in app then please try replacing your config.xml file with config.xml file given in this zipped  file : https://bit.ly/2zdnGZc  
    #16358

    yasas
    Participant
    Dear Alex, Thanks for the support. That problem was resolved. Now I can logging to the app and when I try to access my courses. it is giving bellow error. But I can access same through website. Please advice. Swiped main.js:8381 YAY ! www.learningpal24by7.com/wp-json/wplms/v1/user/subscribe:1 POST http://www.learningpal24by7.com/wp-json/wplms/v1/user/subscribe 401 (Unauthorized) vendor.js:1395 ERROR Response {_body: "{"code":"rest_forbidden","message":"Sorry, you are not allowed to do that.","data":{"status":401}}", status: 401, ok: false, statusText: "Unauthorized", headers: Headers, …}  
    #16359

    Scott Lang
    Keymaster

    put this line in your .htaccess file at the end (.htaccess can be found in root of your site ):

    SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0

    IF above does not works then please change the above line to :

    SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$1

    #16376

    yasas
    Participant
    Dear Scott, Thanks for quick support. that problem also resolved. But when I access course contents bellow run time error is display. Please advice. ERROR TypeError: Cannot read property 'progress' of undefined at Object.eval [as updateDirectives] (CourseStatusPage.ngfactory.js:3816) at Object.updateDirectives (core.es5.js:12618) at checkAndUpdateView (core.es5.js:12144) at callViewAction (core.es5.js:12507) at execComponentViewsAction (core.es5.js:12439) at checkAndUpdateView (core.es5.js:12150) at callViewAction (core.es5.js:12507) at execEmbeddedViewsAction (core.es5.js:12465) at checkAndUpdateView (core.es5.js:12145) at callViewAction (core.es5.js:12507) defaultErrorLogger @ core.es5.js:1084 ErrorHandler.handleError @ core.es5.js:1144 IonicErrorHandler.handleError @ ionic-error-handler.js:63 ApplicationRef_.tick @ core.es5.js:5082 (anonymous) @ core.es5.js:4955 t.invoke @ polyfills.js:3 onInvoke @ core.es5.js:4149 t.invoke @ polyfills.js:3 r.run @ polyfills.js:3 NgZone.run @ core.es5.js:4017 next @ core.es5.js:4955 schedulerFn @ core.es5.js:3851 SafeSubscriber.__tryOrUnsub @ Subscriber.js:242 SafeSubscriber.next @ Subscriber.js:189 Subscriber._next @ Subscriber.js:129 Subscriber.next @ Subscriber.js:93 Subject.next @ Subject.js:55 EventEmitter.emit @ core.es5.js:3837 NgZone.checkStable @ core.es5.js:4114 NgZone.onLeave @ core.es5.js:4190 onInvokeTask @ core.es5.js:4143 t.invokeTask @ polyfills.js:3 r.runTask @ polyfills.js:3 invoke @ polyfills.js:3 load (async) invokeAddFunc @ polyfills.js:3 c @ polyfills.js:2 t.scheduleTask @ polyfills.js:3 onScheduleTask @ polyfills.js:3 t.scheduleTask @ polyfills.js:3 r.scheduleTask @ polyfills.js:3 r.scheduleEventTask @ polyfills.js:3 (anonymous) @ polyfills.js:2 r.(anonymous function) @ polyfills.js:2 (anonymous) @ http.es5.js:1276 Observable._trySubscribe @ Observable.js:172 Observable.subscribe @ Observable.js:160 MapOperator.call @ map.js:56 Observable.subscribe @ Observable.js:157 webpackJsonp.109.CourseStatusPage.onSlideChanged @ course-status.ts:303 (anonymous) @ CourseStatusPage.ngfactory.js:3735 handleEvent @ core.es5.js:11914 handleEvent @ core.es5.js:12617 dispatchEvent @ core.es5.js:8814 (anonymous) @ core.es5.js:10742 schedulerFn @ core.es5.js:3863 SafeSubscriber.__tryOrUnsub @ Subscriber.js:242 SafeSubscriber.next @ Subscriber.js:189 Subscriber._next @ Subscriber.js:129 Subscriber.next @ Subscriber.js:93 Subject.next @ Subject.js:55 EventEmitter.emit @ core.es5.js:3837 (anonymous) @ swiper.js:808 t.invoke @ polyfills.js:3 onInvoke @ core.es5.js:4149 t.invoke @ polyfills.js:3 r.run @ polyfills.js:3 NgZone.run @ core.es5.js:4017 onTransitionEnd @ swiper.js:805 (anonymous) @ swiper.js:763 onTransitionEnd @ platform.js:675 t.invokeTask @ polyfills.js:3 onInvokeTask @ core.es5.js:4140 t.invokeTask @ polyfills.js:3 r.runTask @ polyfills.js:3 invoke @ polyfills.js:3 core.es5.js:1084 ERROR TypeError: Cannot read property 'courseitems' of undefined at CourseStatusPage.webpackJsonp.109.CourseStatusPage.get_progress (course-status.ts:200) at SafeSubscriber._next (course-status.ts:307) at SafeSubscriber.__tryOrUnsub (Subscriber.js:242) at SafeSubscriber.next (Subscriber.js:189) at Subscriber._next (Subscriber.js:129) at Subscriber.next (Subscriber.js:93) at MapSubscriber._next (map.js:85) at MapSubscriber.Subscriber.next (Subscriber.js:93) at XMLHttpRequest.onLoad (http.es5.js:1229) at t.invokeTask (polyfills.js:3)
    #16398

    admin
    Member
    okay please make sure that there is some curriculum set in the course and all its units has atlease some content .Unit or quiz contents should not be blank . check this topic : https://wplms.io/forums/topic/course-progress/
    #16532

    yasas
    Participant
    Dear Alex, Thank you for your extended support. I was able to build "android-debug.apk" but when I try to build production version it is giving bellow error.

    $ ionic cordova run android --prod

    [INFO] Running app-scripts build: --prod --platform android --target cordova

    [14:59:59] build prod started ...

    [14:59:59] clean started ...

    [14:59:59] clean finished in 3 ms

    [14:59:59] copy started ...

    [14:59:59] ngc started ...

    Error: Metadata version mismatch for module /Users/yasas/Documents/Ionic_build/LearningPALV1.3/LearningPAL/node_modules/@ionic-native/core/decorators.d.ts, found version 4, expected 3

    at StaticSymbolResolver.getModuleMetadata (/Users/yasas/Documents/Ionic_build/LearningPALV1.3/LearningPAL/node_modules/@angular/compiler/bundles/compiler.umd.js:24474:34)

    at StaticSymbolResolver._createSymbolsOf (/Users/yasas/Documents/Ionic_build/LearningPALV1.3/LearningPAL/node_modules/@angular/compiler/bundles/compiler.umd.js:24260:46)

    at StaticSymbolResolver.getSymbolsOf (/Users/yasas/Documents/Ionic_build/LearningPALV1.3/LearningPAL/node_modules/@angular/compiler/bundles/compiler.umd.js:24241:14)

    at /Users/yasas/Documents/Ionic_build/LearningPALV1.3/LearningPAL/node_modules/@angular/compiler/bundles/compiler.umd.js:23023:30

    at Array.forEach ()

    at extractProgramSymbols (/Users/yasas/Documents/Ionic_build/LearningPALV1.3/LearningPAL/node_modules/@angular/compiler/bundles/compiler.umd.js:23022:79)

    at AotCompiler.compileAll (/Users/yasas/Documents/Ionic_build/LearningPALV1.3/LearningPAL/node_modules/@angular/compiler/bundles/compiler.umd.js:22720:47)

    at CodeGenerator.codegen (/Users/yasas/Documents/Ionic_build/LearningPALV1.3/LearningPAL/node_modules/@angular/compiler-cli/src/codegen.js:30:14)

    at Function.NgTools_InternalApi_NG_2.codeGen (/Users/yasas/Documents/Ionic_build/LearningPALV1.3/LearningPAL/node_modules/@angular/compiler-cli/src/ngtools_api.js:61:30)

    at Object.doCodegen (/Users/yasas/Documents/Ionic_build/LearningPALV1.3/LearningPAL/node_modules/@ionic/app-scripts/dist/aot/codegen.js:6:51)

    $ ionic info

    cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils : 1.12.0

    ionic (Ionic CLI) : 3.12.0

    global packages:

    cordova (Cordova CLI) : 8.1.2 ([email protected])

    local packages:

    @ionic/app-scripts : 2.1.4

    Cordova Platforms : android 6.3.0

    Ionic Framework : ionic-angular 3.6.1

    System:

    Android SDK Tools : 26.1.1

    Node : v10.11.0

    npm : 6.4.1

    OS : macOS High Sierra

    Misc:

    backend : pro

     

    $ gradle --version

    ------------------------------------------------------------

    Gradle 4.10.2

    ------------------------------------------------------------

    Build time: 2018-09-19 18:10:15 UTC

    Revision: b4d8d5d170bb4ba516e88d7fe5647e2323d791dd

    Kotlin DSL: 1.0-rc-6

    Kotlin: 1.2.61

    Groovy: 2.4.15

    Ant: Apache Ant(TM) version 1.9.11 compiled on March 23 2018

    JVM: 1.8.0_191 (Oracle Corporation 25.191-b12)

    OS: Mac OS X 10.13.6 x86_64

      Please advice me to move forward
    #16609

    admin
    Member
    Please try to run this command : ionic cordova build --release android to build release apk file . refer this link : https://ionicframework.com/docs/v1/guide/publishing.html
    #16663

    yasas
    Participant
    Thanks Alex, Bytheway I need to add few findings to solve this issue need to change bellow line in "project.properties" file.
    cordova.system.library.3=com.google.android.gms:play-services-auth:11.0.4
    cordova.system.library.4=com.google.android.gms:play-services-identity:11.0.4
    
    #16690

    admin
    Member
    I guess you might need to change it in build.gradle also in your platforms/android folder .  
Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘typescript: src/components/question/question.ts, line: 26’ is closed to new replies.