我正在创建一个Ionic App,在浏览器中模拟它工作正常,但是一旦我尝试在android上构建它就失败了.看起来像AATP的一些错误,但我无法弄清楚,为什么会发生这种情况......这是错误日志:
Running app-scripts build: --platform android --target cordova
[00:03:39] build dev started ...
[00:03:39] clean started ...
[00:03:39] clean finished in 36 ms
[00:03:39] copy started ...
[00:03:39] deeplinks started ...
[00:03:39] deeplinks finished in 46 ms
[00:03:39] transpile started ...
[00:03:43] transpile finished in 4.22 s
[00:03:43] preprocess started ...
[00:03:43] preprocess finished in 1 ms
[00:03:43] webpack started ...
[00:03:43] copy finished in 4.49 s
[00:03:50] webpack finished in 6.46 s
[00:03:50] sass started ...
Without `from` …Run Code Online (Sandbox Code Playgroud) 我尝试从api下载图像(png).我的问题是,由于某种原因,只有json文件被ionic/angular接受.
return this.http.get(this.authKeys.serverURL, {headers: this.header, responseType: ResponseContentType.Blob});
Run Code Online (Sandbox Code Playgroud)
发生以下错误:
Argument of type '{ headers: any; responseType: ResponseContentType.Blob; }' is not assignable to parameter of type '{ headers?: HttpHeaders | { [header: string]: string | string[]; }; observe?: "body"; params?: Ht...'. Types of property 'responseType' are incompatible. Type 'ResponseContentType.Blob' is not assignable to type '"json"'.
Run Code Online (Sandbox Code Playgroud)
出于某种原因,只允许json类型的响应......