Reputation: 79
Please help resolving this issue. I was able to build app in android studio after command "ionic capacitor build android". Android works fine until I added the plugin cordova-plugin-advanced-http, the error stated as follows:
D:\temp\myApp4\android\capacitor-cordova-android-plugins\src\main\java\org\apache\cordova\file\FileUtils.java:39: error: cannot find symbol import org.apache.cordova.CordovaPluginPathHandler; ^ symbol: class CordovaPluginPathHandler location: package org.apache.cordova
[capacitor] [info] Found 5 Cordova plugins for android:
[capacitor] [email protected]
[capacitor] [email protected]
[capacitor] [email protected]
[capacitor] [email protected]
[capacitor] [email protected]
[capacitor] √ copy android in 4.44s
[capacitor] √ Updating Android plugins in 25.69ms
[capacitor] [info] Found 4 Capacitor plugins for android:
[capacitor] @capacitor/[email protected]
[capacitor] @capacitor/[email protected]
[capacitor] @capacitor/[email protected]
[capacitor] @capacitor/[email protected]
[capacitor] [info] Found 5 Cordova plugins for android:
[capacitor] [email protected]
[capacitor] [email protected]
[capacitor] [email protected]
[capacitor] [email protected]
[capacitor] [email protected]```
Upvotes: 7
Views: 11773
Reputation: 513
You should upgrade the version of the cordova android.
For the file android/variables.gradle
Change the cordovaAndroidVersion = '7.0.0'
to cordovaAndroidVersion = '10.1.2'
In the meantime, you should change the minSdkVersion
to >= 22
Upvotes: 27
Reputation: 525
As a temporary solution, I downgraded the version of cordova-plugin-file to 6.0.2, it works for me
Upvotes: 10
Reputation: 61
To ensure this works, do following;
<android\capacitor-cordova-android-plugins\src\main\java\org\apache\cordova\file>
the location houses plugins to make your app work. /*
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;
}
}
Upvotes: 6