简体   繁体   English

包android.support.v4.app不存在(Android 17)

[英]package android.support.v4.app does not exist (Android 17)

I'm trying to compile my cordova application for Android but I'm getting this error: 我正在尝试为Android编译我的cordova应用程序,但我收到此错误:

[javac] Compiling 104 source files to /Volumes/Work/workspace/android/poc/CordovaLib/bin/classes
[javac] /Volumes/Work/workspace/android/poc/CordovaLib/src/com/plugin/gcm/CordovaGCMBroadcastReceiver.java:5: package com.google.android.gcm does not exist
[javac] import com.google.android.gcm.GCMBroadcastReceiver;
[javac]                              ^
[javac] /Volumes/Work/workspace/android/poc/CordovaLib/src/com/plugin/gcm/CordovaGCMBroadcastReceiver.java:6: package com.google.android.gcm does not exist
[javac] import static com.google.android.gcm.GCMConstants.DEFAULT_INTENT_SERVICE_CLASS_NAME;
[javac]                                     ^
[javac] /Volumes/Work/workspace/android/poc/CordovaLib/src/com/plugin/gcm/CordovaGCMBroadcastReceiver.java:6: static import only from classes and interfaces
[javac] import static com.google.android.gcm.GCMConstants.DEFAULT_INTENT_SERVICE_CLASS_NAME;
[javac] ^
[javac] /Volumes/Work/workspace/android/poc/CordovaLib/src/com/plugin/gcm/CordovaGCMBroadcastReceiver.java:12: cannot find symbol
[javac] symbol: class GCMBroadcastReceiver
[javac] public class CordovaGCMBroadcastReceiver extends GCMBroadcastReceiver {
[javac]                                                  ^
[javac] /Volumes/Work/workspace/android/poc/CordovaLib/src/com/plugin/gcm/GCMIntentService.java:5: package com.google.android.gcm does not exist
[javac] import com.google.android.gcm.GCMBaseIntentService;
[javac]                              ^
[javac] /Volumes/Work/workspace/android/poc/CordovaLib/src/com/plugin/gcm/GCMIntentService.java:18: package android.support.v4.app does not exist
[javac] import android.support.v4.app.NotificationCompat;
[javac]                              ^
[javac] /Volumes/Work/workspace/android/poc/CordovaLib/src/com/plugin/gcm/GCMIntentService.java:22: cannot find symbol
[javac] symbol: class GCMBaseIntentService
[javac] public class GCMIntentService extends GCMBaseIntentService {
[javac]                                       ^
[javac] /Volumes/Work/workspace/android/poc/CordovaLib/src/com/plugin/gcm/PushPlugin.java:18: package com.google.android.gcm does not exist
[javac] import com.google.android.gcm.*;
[javac] ^
[javac] /Volumes/Work/workspace/android/poc/CordovaLib/src/com/plugin/gcm/CordovaGCMBroadcastReceiver.java:16: cannot find symbol
[javac] symbol  : variable DEFAULT_INTENT_SERVICE_CLASS_NAME
[javac] location: class com.plugin.gcm.CordovaGCMBroadcastReceiver
[javac]         return "com.plugin.gcm" + DEFAULT_INTENT_SERVICE_CLASS_NAME;
[javac]                                   ^
[javac] /Volumes/Work/workspace/android/poc/CordovaLib/src/com/plugin/gcm/CordovaGCMBroadcastReceiver.java:14: method does not override or implement a method from a supertype
[javac]     @Override
[javac]     ^
[javac] /Volumes/Work/workspace/android/poc/CordovaLib/src/com/plugin/gcm/GCMIntentService.java:31: method does not override or implement a method from a supertype
[javac]     @Override
[javac]     ^
[javac] /Volumes/Work/workspace/android/poc/CordovaLib/src/com/plugin/gcm/GCMIntentService.java:57: method does not override or implement a method from a supertype
[javac]     @Override
[javac]     ^
[javac] /Volumes/Work/workspace/android/poc/CordovaLib/src/com/plugin/gcm/GCMIntentService.java:62: method does not override or implement a method from a supertype
[javac]     @Override
[javac]     ^
[javac] /Volumes/Work/workspace/android/poc/CordovaLib/src/com/plugin/gcm/GCMIntentService.java:88: cannot find symbol
[javac] symbol  : method getSystemService(java.lang.String)
[javac] location: class com.plugin.gcm.GCMIntentService
[javac]         NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
[javac]                                                                          ^
[javac] /Volumes/Work/workspace/android/poc/CordovaLib/src/com/plugin/gcm/GCMIntentService.java:89: getAppName(android.content.Context) in com.plugin.gcm.GCMIntentService cannot be applied to (com.plugin.gcm.GCMIntentService)
[javac]         String appName = getAppName(this);
[javac]                          ^
[javac] /Volumes/Work/workspace/android/poc/CordovaLib/src/com/plugin/gcm/GCMIntentService.java:91: cannot find symbol
[javac] symbol  : constructor Intent(com.plugin.gcm.GCMIntentService,java.lang.Class<com.plugin.gcm.PushHandlerActivity>)
[javac] location: class android.content.Intent
[javac]         Intent notificationIntent = new Intent(this, PushHandlerActivity.class);
[javac]                                     ^
[javac] /Volumes/Work/workspace/android/poc/CordovaLib/src/com/plugin/gcm/GCMIntentService.java:95: cannot find symbol
[javac] symbol  : method getActivity(com.plugin.gcm.GCMIntentService,int,android.content.Intent,int)
[javac] location: class android.app.PendingIntent
[javac]         PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
[javac]                                                    ^
[javac] /Volumes/Work/workspace/android/poc/CordovaLib/src/com/plugin/gcm/GCMIntentService.java:97: package NotificationCompat does not exist
[javac]         NotificationCompat.Builder mBuilder =
[javac]                           ^
[javac] /Volumes/Work/workspace/android/poc/CordovaLib/src/com/plugin/gcm/GCMIntentService.java:98: package NotificationCompat does not exist
[javac]             new NotificationCompat.Builder(context)
[javac]                                   ^
[javac] /Volumes/Work/workspace/android/poc/CordovaLib/src/com/plugin/gcm/GCMIntentService.java:137: method does not override or implement a method from a supertype
[javac]     @Override
[javac]     ^
[javac] /Volumes/Work/workspace/android/poc/CordovaLib/src/com/plugin/gcm/PushPlugin.java:67: cannot find symbol
[javac] symbol  : variable GCMRegistrar
[javac] location: class com.plugin.gcm.PushPlugin
[javac]                 GCMRegistrar.register(getApplicationContext(), gSenderID);
[javac]                 ^
[javac] /Volumes/Work/workspace/android/poc/CordovaLib/src/com/plugin/gcm/PushPlugin.java:84: cannot find symbol
[javac] symbol  : variable GCMRegistrar
[javac] location: class com.plugin.gcm.PushPlugin
[javac]             GCMRegistrar.unregister(getApplicationContext());
[javac]             ^
[javac] 22 errors[Error] AndroidPackager::build : Impossible de compiler le projet

I'm compiling against Android 17 (4.2.2). 我正在编译Android 17(4.2.2)。 The file android-support-v4.jar exists in libs directory. android-support-v4.jar文件存在于libs目录中。

I'm using just command lines to compile my projects. 我只使用命令行来编译我的项目。

Any ideas about this issue ? 关于这个问题的任何想法?

I've figured this out: I've copied android-support-v13.jar in CordovaLib\\libs directory. 我已经想到了这一点:我在CordovaLib \\ libs目录中复制了android-support-v13.jar。 It works fine now. 它现在工作正常。

只需将android-support-v4.jar$ANDROID_HOME/extras/android/support/v4/复制到${project}/platforms/android/libs/你还必须从gradle脚本${project}/platforms/android/project.properties删除依赖项${project}/platforms/android/project.propertiesbuild.gradle

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 包 android.support.v4.app 不存在 - Package android.support.v4.app does not exist Qt-包android.support.v4.app不存在 - Qt - package android.support.v4.app does not exist android.support.v4.app不存在 - android.support.v4.app does not exist Visual Studio-Ionic:包android.support.v4.app不存在 - Visual Studio - Ionic: package android.support.v4.app does not exist 如何修复androidx项目中不存在的包android.support.v4.app? - how to fix package android.support.v4.app not exist in androidx projects? 命名空间“Android.Support.V4.App”中不存在类型或命名空间名称“TaskStackBuilder”(您是否缺少程序集引用?) - The type or namespace name 'TaskStackBuilder' does not exist in the namespace 'Android.Support.V4.App' (are you missing an assembly reference?) 没有android.support.v4.app的SwipeView - SwipeView without android.support.v4.app Android.app或Android.support.v4.app? - Android.app or Android.support.v4.app? 示例目前无法用于:android工作室中的{Symbol:Fragment,Package:android.support.v4.app} - Samples are currently unavailable for: {Symbol: Fragment, Package: android.support.v4.app} in android studio Android:程序类型已存在:android.support.v4.app - Android: Program type already present: android.support.v4.app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM