请帮助解决这个问题。在命令“离子电容构建android”之后,我就可以在android工作室中构建应用程序了。在我添加插件cordova- plugin -advanced-http之前,Android运行良好,错误声明如下:
D:\temp\myApp4\android\capacitor-cordova-android-plugins\src\main\java\org\apache\cordova\file\FileUtils.java:39:错误:找不到符号导入org.apache.cordova.CordovaPluginPathHandler;^符号:类CordovaPluginPathHandler位置: package org.apache.cordova
[capacitor] [info] Found 5 Cordova plugins for android:
[capacitor] cordova-plugin-advanced-http@3.3.1
[capacitor] cordova-plugin-file@7.0.0
[capacitor] cordova-plugin-geolocation@4.1.0
[capacitor] cordova-plugin-nativestorage@2.3.2
[capacitor] cordova-plugin-request-location-accuracy@2.3.0
[capacitor] √ copy android in 4.44s
[capacitor] √ Updating Android plugins in 25.69ms
[capacitor] [info] Found 4 Capacitor plugins for android:
[capacitor] @capacitor/app@1.1.1
[capacitor] @capacitor/haptics@1.1.4
[capacitor] @capacitor/keyboard@1.2.2
[capacitor] @capacitor/status-bar@1.0.8
[capacitor] [info] Found 5 Cordova plugins for android:
[capacitor] cordova-plugin-advanced-http@3.3.1
[capacitor] cordova-plugin-file@7.0.0
[capacitor] cordova-plugin-geolocation@4.1.0
[capacitor] cordova-plugin-nativestorage@2.3.2
[capacitor] cordova-plugin-request-location-accuracy@2.3.0```发布于 2022-05-19 07:44:34
你应该升级cordova android的版本。
对于文件android/variables.gradle
将cordovaAndroidVersion = '7.0.0'更改为cordovaAndroidVersion = '10.1.2'
同时,您应该将minSdkVersion更改为>= 22。
发布于 2022-05-06 18:25:16
作为一种临时解决方案,我将cordova-plugin-file的版本降为6.0.2,它适用于我。
发布于 2022-04-23 20:55:18
为确保这一工作,做好以下工作;
<android\capacitor-cordova-android-plugins\src\main\java\org\apache\cordova\file> <android\capacitor-cordova-android-plugins\src\main\java\org\apache\cordova\file><android\capacitor-cordova-android-plugins\src\main\java\org\apache\cordova\file>)上的这个位置以使应用程序正常工作。。
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/
package org.apache.cordova;
import androidx.webkit.WebViewAssetLoader;
/**
* Wrapper class for path and handler
*/
public class CordovaPluginPathHandler {
private final WebViewAssetLoader.PathHandler handler;
public CordovaPluginPathHandler(WebViewAssetLoader.PathHandler handler) {
this.handler = handler;
}
public WebViewAssetLoader.PathHandler getPathHandler() {
return handler;
}
}https://stackoverflow.com/questions/71883439
复制相似问题