gpt4 book ai didi

android - 添加 oneSignal 插件 cordova - Ionic 2

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:12:25 25 4
gpt4 key购买 nike

我很好地将 onesignal-cordova-plugin 添加到我的项目中,但是当我想要构建 (ionic cordova run android) 时,我遇到了这个错误:

Observed package id 'build-tools;26.0.0-rc1' in inconsistent location 'E:\SDK\build-tools\26.0.0-preview' (Expected 'E:\SDK\build-tools\26.0.0-rc1')
Errors during XML parse:
White spaces are required between publicId and systemId.
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 62; White spaces are required between publicId and systemId.
javax.xml.bind.UnmarshalException
- with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 62; White spaces are required between publicId and systemId.]
Additionally, the fallback loader failed to parse the XML.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugApkCopy'.
> Could not resolve com.android.support:support-v4:[26.0.0,26.1.0).
Required by:
project : > com.onesignal:OneSignal:3.6.1
> Could not resolve com.android.support:support-v4:[26.0.0,26.1.0).
> Failed to list versions for com.android.support:support-v4.
> Unable to load Maven meta-data from https://jcenter.bintray.com/com/android/support/support-v4/maven-metadata.xml.
> Could not GET 'https://jcenter.bintray.com/com/android/support/support-v4/maven-metadata.xml'.
> Connect to jcenter.bintray.com:443 [jcenter.bintray.com/108.168.243.150] failed: Connection timed out: connect
> Could not resolve com.android.support:support-v4:[26.0.0,26.1.0).
> Failed to list versions for com.android.support:support-v4.
> Unable to load Maven meta-data from https://maven.google.com/com/android/support/support-v4/maven-metadata.xml.
> org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 62; White spaces are required between publicId and systemId.
> Could not resolve com.android.support:customtabs:[26.0.0,26.1.0).
Required by:
project : > com.onesignal:OneSignal:3.6.1
> Could not resolve com.android.support:customtabs:[26.0.0,26.1.0).
> Failed to list versions for com.android.support:customtabs.
> Unable to load Maven meta-data from https://jcenter.bintray.com/com/android/support/customtabs/maven-metadata.xml.
> Could not GET 'https://jcenter.bintray.com/com/android/support/customtabs/maven-metadata.xml'.
> Connect to jcenter.bintray.com:443 [jcenter.bintray.com/108.168.243.150] failed: Connection timed out: connect
> Could not resolve com.android.support:customtabs:[26.0.0,26.1.0).
>

BUILD FAILED

问题是什么?我看到了同样的错误 here

可能是相关的:

找不到请求的路径:

https://jcenter.bintray.com/com/android/support/support-v4/maven-metadata.xml

ionic 信息:

cli packages: 
@ionic/cli-utils : 1.9.2
ionic (Ionic CLI) : 3.9.2

global packages:
Cordova CLI : 7.0.1
Gulp CLI : CLI version 3.9.1
Local version 3.9.1

local packages:
@ionic/app-scripts : 2.1.4
Cordova Platforms : android 6.2.3
Ionic Framework : ionic-angular 3.5.0

System:
Android SDK Tools : 25.2.5
Node : v8.1.3
npm : 5.0.3
OS : Windows 10

已编辑:所以我将文件夹名称从 26.0.0-preview 更改为 26.0.0-rc1 并且我收到了一个新错误:

Errors during XML parse:
White spaces are required between publicId and systemId.
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 62; White spaces are required between publicId and
systemId.
javax.xml.bind.UnmarshalException
- with linked exception:
[org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 62; White spaces are required between publicId and
systemId.]
Additionally, the fallback loader failed to parse the XML.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugApkCopy'.
> Could not resolve com.android.support:support-v4:[26.0.0,26.1.0).
Required by:
project : > com.onesignal:OneSignal:3.6.1
> Could not resolve com.android.support:support-v4:[26.0.0,26.1.0).
> Failed to list versions for com.android.support:support-v4.
> Unable to load Maven meta-data from
https://maven.google.com/com/android/support/support-v4/maven-metadata.xml.
> org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 62; White spaces are required
between publicId and systemId.
> Could not resolve com.android.support:customtabs:[26.0.0,26.1.0).
Required by:
project : > com.onesignal:OneSignal:3.6.1
> Could not resolve com.android.support:customtabs:[26.0.0,26.1.0).
> Failed to list versions for com.android.support:customtabs.
> Unable to load Maven meta-data from
https://maven.google.com/com/android/support/customtabs/maven-metadata.xml.
> org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 62; White spaces are required
between publicId and systemId.

最佳答案

终于找到解决办法了!首先最好看onesignal-plugin-versions ;

据此:

2.2.0 Release :

Dropped Android 2.3 (API 9) support, minimum is now 4.0.3 (API 15).

所以我们有两个选择:

  1. 增加config.xml中的minSdkVersion

  2. 降低onesignal-cordova-plugin版本(ionic cordova plugin add onesignal-cordova-plugin@2.1.2)

关于android - 添加 oneSignal 插件 cordova - Ionic 2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46153845/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com