几天来我一直在尝试构建此Cordova应用程序,但无法正常工作。它会不断出错,并发出与firebase有关的相同错误。 Cordova版本:cordova --version 9.0.0(cordova-lib@9.0.1)。 Gradle:distributionUrl = http://services.gradle.org/distributions/gradle-2.14.1-all.zip
我尝试在构建之前删除所有插件。我曾尝试删除android和ios平台,然后重新添加它们。我尝试修改build.gradle文件和project.properties文件。什么都没有。
D:\billaway\mobile\freeup\platforms\android\src\org\apache\cordova\firebase\FirebasePluginInstanceIDService.java:7: error: cannot find symbol
public class FirebasePluginInstanceIDService extends FirebaseInstanceIdService {
^
symbol: class FirebaseInstanceIdService
D:\billaway\mobile\freeup\platforms\android\src\org\apache\cordova\firebase\FirebasePluginMessagingService.java:3: error: cannot find symbol
import android.app.NotificationChannel;
^
symbol: class NotificationChannel
location: package android.app
D:\billaway\mobile\freeup\platforms\android\src\org\apache\cordova\tapjoy\TapjoyPlugin.java:16: error: cannot find symbol
import org.apache.cordova.PermissionHelper;
^
symbol: class PermissionHelper
location: package org.apache.cordova
D:\billaway\mobile\freeup\platforms\android\src\org\apache\cordova\firebase\FirebasePluginInstanceIDService.java:16: error: method does not override or implement a method from a supertype
@Override
^
D:\billaway\mobile\freeup\platforms\android\src\org\apache\cordova\firebase\FirebasePluginMessagingService.java:187: error: cannot find symbol
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
^
symbol: variable O
location: class VERSION_CODES
D:\billaway\mobile\freeup\platforms\android\src\org\apache\cordova\firebase\FirebasePluginMessagingService.java:188: error: cannot find symbol
NotificationChannel channel = new NotificationChannel(channelId, channelName, NotificationManager.IMPORTANCE_HIGH);
^
symbol: class NotificationChannel
location: class FirebasePluginMessagingService
D:\billaway\mobile\freeup\platforms\android\src\org\apache\cordova\firebase\FirebasePluginMessagingService.java:188: error: cannot find symbol
NotificationChannel channel = new NotificationChannel(channelId, channelName, NotificationManager.IMPORTANCE_HIGH);
^
symbol: class NotificationChannel
location: class FirebasePluginMessagingService
D:\billaway\mobile\freeup\platforms\android\src\org\apache\cordova\tapjoy\TapjoyPlugin.java:87: error: cannot find symbol
PermissionHelper.requestPermissions(this, 0, permissions);
^
symbol: variable PermissionHelper
location: class TapjoyPlugin
D:\billaway\mobile\freeup\platforms\android\src\org\apache\cordova\tapjoy\TapjoyPlugin.java:368: error: cannot find symbol
if(!PermissionHelper.hasPermission(this, p))
^
symbol: variable PermissionHelper
location: class TapjoyPlugin
D:\billaway\mobile\freeup\platforms\android\src\org\apache\cordova\tapjoy\TapjoyPlugin.java:383: error: cannot find symbol
PermissionHelper.requestPermissions(this, requestCode, permissions);
^
symbol: variable PermissionHelper
location: class TapjoyPlugin
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
10 errors
:compileReleaseJavaWithJavac
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
FAILED
BUILD FAILED
这是我的config.xml文件:
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.freeup.rewards" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Rewards</name>
<description>
Earn credits for free mobile service when you share your opinion and fill out surveys
</description>
<author email="dev@cordova.apache.org" href="http://billawayglobal.com">
Billaway Team
</author>
<content src="index.html" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<preference name="SplashScreen" value="splash" />
<preference name="SplashScreenDelay" value="3000" />
<access origin="*" />
<allow-navigation href="*" />
<platform name="android">
<allow-intent href="market:*" />
<icon density="xxhdpi" src="res/icon/android/drawable-xxhdpi-icon.png" />
<splash density="land-xxhdpi" src="res/screen/android/drawable-land-xxhdpi-screen.png" />
<splash density="port-xxhdpi" src="res/screen/android/drawable-port-xxhdpi-screen.png" />
</platform>
<platform name="ios">
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
<icon height="57" platform="ios" src="res/icon/ios/icon.png" width="57" />
<icon height="114" platform="ios" src="res/icon/ios/icon@2x.png" width="114" />
<icon height="40" platform="ios" src="res/icon/ios/icon-40.png" width="40" />
<icon height="80" platform="ios" src="res/icon/ios/icon-40@2x.png" width="80" />
<icon height="50" platform="ios" src="res/icon/ios/icon-50.png" width="50" />
<icon height="100" platform="ios" src="res/icon/ios/icon-50@2x.png" width="100" />
<icon height="60" platform="ios" src="res/icon/ios/icon-60.png" width="60" />
<icon height="120" platform="ios" src="res/icon/ios/icon-60@2x.png" width="120" />
<icon height="180" platform="ios" src="res/icon/ios/icon-60@3x.png" width="180" />
<icon height="72" platform="ios" src="res/icon/ios/icon-72.png" width="72" />
<icon height="144" platform="ios" src="res/icon/ios/icon-72@2x.png" width="144" />
<icon height="76" platform="ios" src="res/icon/ios/icon-76.png" width="76" />
<icon height="152" platform="ios" src="res/icon/ios/icon-76@2x.png" width="152" />
<icon height="29" platform="ios" src="res/icon/ios/icon-small.png" width="29" />
<icon height="58" platform="ios" src="res/icon/ios/icon-small@2x.png" width="58" />
<icon height="87" platform="ios" src="res/icon/ios/icon-small@3x.png" width="87" />
<splash height="1136" platform="ios" src="res/screen/ios/Default-568h@2x~iphone.png" width="640" />
<splash height="1334" platform="ios" src="res/screen/ios/Default-667h.png" width="750" />
<splash height="2208" platform="ios" src="res/screen/ios/Default-736h.png" width="1242" />
<splash height="1242" platform="ios" src="res/screen/ios/Default-Landscape-736h.png" width="2208" />
<splash height="1536" platform="ios" src="res/screen/ios/Default-Landscape@2x~ipad.png" width="2048" />
<splash height="768" platform="ios" src="res/screen/ios/Default-Landscape~ipad.png" width="1024" />
<splash height="2048" platform="ios" src="res/screen/ios/Default-Portrait@2x~ipad.png" width="1536" />
<splash height="1024" platform="ios" src="res/screen/ios/Default-Portrait~ipad.png" width="768" />
<splash height="960" platform="ios" src="res/screen/ios/Default@2x~iphone.png" width="640" />
<splash height="480" platform="ios" src="res/screen/ios/Default~iphone.png" width="320" />
</platform>
<plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
<plugin name="cordova-plugin-inappbrowser" spec="~1.7.1" />
<plugin name="cordova-plugin-market" spec="https://github.com/xmartlabs/cordova-plugin-market" />
<plugin name="cordova-plugin-tapjoy" spec="~1.0.0" />
<plugin name="cordova-plugin-tapjoyba" spec="https://github.com/billAway/TapjoyCordova.git" />
<plugin name="cordova-plugin-firebase" spec="^2.5.0" />
</widget>