Closed borodiliz closed 7 years ago
Hi @borodiliz, thanks for reporting this bug. I forgot to test for AoT, my bad. I will look into it. Thanks!
any update? I am getting it too.
Can you check the patch with version 2.3.1
I have just uploaded? I tried building locally with the --prod
flag and it seems to work. I needed to make a small refactor of the module config for it to work.
This is the setup now from your app.module.ts
:
import { IonicAudioModule, AudioProvider, WebAudioProvider, audioProviderFactory } from 'ionic-audio/dist';
/**
* Sample custom factory function to use with ionic-audio
*/
export function myCustomAudioProviderFactory() {
return new WebAudioProvider();
}
@NgModule({
declarations: [
MyApp,
AboutPage,
ContactPage,
HomePage,
TabsPage
],
imports: [
IonicModule.forRoot(MyApp),
IonicAudioModule.forRoot({ provide: AudioProvider, useFactory: audioProviderFactory }),
// this uses the default built-in factory function,
// or use your custom function above to force a specific provider
// { provide: AudioProvider, useFactory: myCustomAudioProviderFactory }
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
AboutPage,
ContactPage,
HomePage,
TabsPage
],
providers: [{provide: ErrorHandler, useClass: IonicErrorHandler}],
schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
})
export class AppModule {}
Worked 👍 , but without passing any object to IonicAudioModule.forRoot()
. Thanks for the amazing plugin.
@patwaswapnil It should also work if you pass a provider object like this:
IonicAudioModule.forRoot({ provide: AudioProvider, useFactory: audioProviderFactory })
Have you tried that too?
@arielfaur , Yes i have tried that but while doing this a run time error occurs during init (.create is not a function)
, i don't have that exact error.
OK, I will look into that later. Thanks!
Hi all,
After upgrading to 2.3.1:
ionic build android --dev
ionic build android --prod --release
but my application does not starts. I'm getting the following error on adb console02-27 13:12:33.840 18931 18931 I chromium: [INFO:CONSOLE(45)] "Uncaught Error: Module build failed: Error: ENOENT: no such file or directory, open '/datos/borja/proyectos/my-app-v2/node_modules/ionic-audio/dist/ionic-audio-interfaces.js'
02-27 13:12:33.840 18931 18931 I chromium: at Error (native)", source: file:///android_asset/www/build/main.js?ionicCachebuster=74117 (45)
Any ideas? Thanks in advance!
Get hint from here- https://github.com/driftyco/ionic-app-scripts/issues/632
Workaround for your issue-
make directory (eg. external) inside src
directory. Copy ionic-audio
directory from npm_module
and paste inside created directory(external).
Edit tsconfig.json
"include": [ "src/**/*.ts", "external/**/*.ts" ],
Thanks @patwaswapnil but unfortunately your workaround is not working for me. @arielfaur maybe the right solution for this could be #97 ?
Hey! I am sorry for this but there is a total lack of documentation regarding component development. This lack of documentation and support is so discouraging sometimes. I don't have time now to keep trying different approaches but I will do as soon as I find some time.
@borodiliz @arielfaur fixed it, Please confirm
I am having a related issue with the latest ionic version:
"@angular/common": "2.4.8",
"@angular/compiler": "2.4.8",
"@angular/compiler-cli": "2.4.8",
"@angular/core": "2.4.8",
"@angular/forms": "2.4.8",
"@angular/http": "2.4.8",
"@angular/platform-browser": "2.4.8",
"@angular/platform-browser-dynamic": "2.4.8",
"@angular/platform-server": "2.4.8",
"@ionic/storage": "2.0.0",
"ionic-angular": "2.2.0",
"ionic-audio": "2.3.4"
"@ionic/app-scripts": "1.1.4"
Error:
[13:08:43] build prod failed: Error encountered resolving symbol values statically. Calling function 'makeParamDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol Injectable in
C:/dev/git/test/app/node_modules/ionic-audio/node_modules/@angular/core/src/di/metadata.d.ts,
resolving symbol OpaqueToken in
C:/dev/git/test/app/node_modules/ionic-audio/node_modules/@angular/core/src/di/opaque_token.d.ts,
resolving symbol OpaqueToken in
C:/dev/git/test/app/node_modules/ionic-audio/node_modules/@angular/core/src/di/opaque_token.d.ts
@Geroo for temporary workaround is to replace with "ionic-audio": "2.3.4"
with "ionic-audio": "git://github.com/sfaizanh/ionic-audio.git#2.0"
until @arielfaur merge #102 or fixes it
@Geroo this for ionic 2.2.0 otherwise for ionic 2.1.0 use "ionic-audio": "2.3.4"
it's working fine
[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of date. Error: Error encountered resolving symbol values statically. Calling function 'providers', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol IonicAudioModule.forRoot in /Users/burhanuddinlokhandwala/Documents/office/illusion/pickup/node_modules/ionic-audio/dist/ionic-audio.module.d.ts, resolving symbol AppModule in /Users/burhanuddinlokhandwala/Documents/office/illusion/pickup/src/app/app.module.ts, resolving symbol AppModule in /Users/burhanuddinlokhandwala/Documents/office/illusion/pickup/src/app/app.module.ts
I have tried the above solution still getting this error.
@bhlokhandwala which ionic version are you using and what version of ionic-audio also
@bhlokhandwala @sfaizanh I appear to have the same error these are my version numbers:
"@angular/common": "4.1.2",
"@angular/compiler": "4.1.2",
"@angular/compiler-cli": "^4.1.2",
"@angular/core": "4.1.2",
"@angular/forms": "4.1.2",
"@angular/http": "4.1.2",
"ionic-angular": "3.3.0",
"ionic-audio": "^3.0.2",
[16:24:36] ngc started ... [WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of date. Error: Error encountered resolving symbol values statically. Calling function 'providers', .....
I have tried looking around but haven't found anything that doesn't seem to be fixed in 3.0.2.
Ionic-audio version: [ X] 2.3.0
I'm submitting a ... [ X] bug report (probably but not sure if there is any workarround to solve this)
Current behavior:
When trying to compile using AoT I get the following error:
Expected behavior:
An application compiled with AoT
Steps to reproduce:
Just execute:
ionic build android --prod --release
This is not happening when using
ionic build android --dev
Related code:
I suspect the problem is on the dynamic initialization on
ionic-audio.module.ts
but I have no idea about how to fix this.Other information:
Ionic info:
Thanks man for this amazing plugin!