I'm testing reward videos from Admob and I'm getting the error bellow.
The code is correct because it works on a Samsung S7.
The error accurs when running on a Samsung S3 mini with Jelly Bean 4.3.1.
I/Ads: Starting ad request.
I/Ads: This request is sent from a test device.
I/ExoPlayerImpl: Init 1.3.1
I/dalvikvm: Could not find method android.media.MediaCodec.releaseOutputBuffer, referenced from method com.google.android.gms.ads.exoplayer1.ab.a
W/dalvikvm: VFY: unable to resolve virtual method 2135: Landroid/media/MediaCodec;.releaseOutputBuffer (IJ)V
D/dalvikvm: VFY: replacing opcode 0x6e at 0x007d
I/dalvikvm: Could not find method android.media.AudioTrack.write, referenced from method com.google.android.gms.ads.exoplayer1.l.a
W/dalvikvm: VFY: unable to resolve virtual method 2114: Landroid/media/AudioTrack;.write (Ljava/nio/ByteBuffer;II)I
D/dalvikvm: VFY: replacing opcode 0x6e at 0x01cb
I/dalvikvm: Could not find method android.media.MediaCodecInfo$CodecCapabilities.isFeatureSupported, referenced from method com.google.android.gms.ads.exoplayer1.v.a
W/dalvikvm: VFY: unable to resolve virtual method 2147: Landroid/media/MediaCodecInfo$CodecCapabilities;.isFeatureSupported (Ljava/lang/String;)Z
D/dalvikvm: VFY: replacing opcode 0x6e at 0x001a
I/OMXClient: Using client-side OMX mux.
E/dalvikvm: Could not find class 'android.media.MediaCodec$CodecException', referenced from method com.google.android.gms.ads.exoplayer1.t.<init>
W/dalvikvm: VFY: unable to resolve instanceof 508 (Landroid/media/MediaCodec$CodecException;) in Lcom/google/android/gms/ads/exoplayer1/t;
D/dalvikvm: VFY: replacing opcode 0x20 at 0x003d
W/Ads: ExoPlayer failed during precache: DecoderInitializationError Exception: Decoder init failed: [-49998], MediaFormat(audio/mp4a-latm, 16, -1, -1, -1.0, 2, 44100, 4921666, -1, -1)
E/ExoPlayerImplInternal: Internal track renderer error.
com.google.android.gms.ads.exoplayer1.d: com.google.android.gms.ads.exoplayer1.t: Decoder init failed: [-49998], MediaFormat(audio/mp4a-latm, 16, -1, -1, -1.0, 2, 44100, 4921666, -1, -1)
...
W/Ads: ExoPlayer failed during precache: PlayerError Exception: com.google.android.gms.ads.exoplayer1.t: Decoder init failed: [-49998], MediaFormat(audio/mp4a-latm, 16, -1, -1, -1.0, 2, 44100, 4921666, -1, -1)
W/Ads: Failed to preload url gcache://video/media/8744318498482049952?url=https://www.youtube.com/get_video%3Fvideo_id%3DeVoPWFDmU6A%26ts%3D1527455824%26t%3D0xl-clkGaPYoJY-TQD0kRV3-cVE%26gad%3D1%26br%3D1%26itag%3D18&tag.duration=5000&tag.check_url=https://www.youtube.com/get_video%3Fvideo_id%3DeVoPWFDmU6A%26ts%3D1527455824%26t%3D0xl-clkGaPYoJY-TQD0kRV3-cVE%26gad%3D1%26br%3D1%26itag%3D18 Exception: Abort requested before buffering finished.
W/Ads: Failed to load ad: 0
W/Ads: Failed to load ad: 3
First I thought it could be the version of Exoplayer (1.3.1) which is a bit outdated, but then I've tried to run the exoplayer demo and it looks like my device doesn't have the right decoder:
I/ExoPlayerImpl: Init 424158b8 [ExoPlayerLib/2.8.1] [golden, GT-I8190, samsung, 18]
W/IMASDK: Invalid internal message, ignoring. Please make sure the Google IMA SDK library is up to date. Message: gmsg://afma.google.com/activityMonitor?type=getPageSignals&sid=649203f5-e3fb-4dae-ae2c-e98f4a0e4a0e&dt=1527458767639
I/OMXClient: Using client-side OMX mux.
E/MediaCodecUtil: Failed to query codec OMX.ST.aac.decoder (audio/mp4a-latm)
E/ExoPlayerImplInternal: Playback error.
com.google.android.exoplayer2.ExoPlaybackException
at com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.supportsFormat(MediaCodecRenderer.java:302)
at com.google.android.exoplayer2.trackselection.MappingTrackSelector.findRenderer(MappingTrackSelector.java:435)
at com.google.android.exoplayer2.trackselection.MappingTrackSelector.selectTracks(MappingTrackSelector.java:344)
at com.google.android.exoplayer2.MediaPeriodHolder.selectTracks(MediaPeriodHolder.java:162)
at com.google.android.exoplayer2.MediaPeriodHolder.handlePrepared(MediaPeriodHolder.java:143)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handlePeriodPrepared(ExoPlayerImplInternal.java:1507)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:316)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:137)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: com.google.android.exoplayer2.mediacodec.MediaCodecUtil$DecoderQueryException: Failed to query underlying media codecs
at com.google.android.exoplayer2.mediacodec.MediaCodecUtil.getDecoderInfosInternal(MediaCodecUtil.java:281)
at com.google.android.exoplayer2.mediacodec.MediaCodecUtil.getDecoderInfos(MediaCodecUtil.java:150)
My build.gradle
compileSdkVersion 27
defaultConfig {
applicationId "com.test.app"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "test reward videos"
}
So my question is, how can I add the missing decoder?
Related
I added new project in my Firebase account like all the time and downloaded google-services.json setting file and successfully install it and the app works however not with firebase service the following is my debug , while the app crash.
please note that this error shows up when i try to add : implementation 'com.google.firebase:firebase-core:16.0.4' and in android studio it shows no error in gradle
10/08 19:55:40: Launching app
$ adb push C:\xxx\app\build\outputs\apk\debug\app-debug.apk /data/local/tmp/com.xxx.insidecartoon
$ adb shell pm install -t -r "/data/local/tmp/com.xxx.xxx"
pkg: /data/local/tmp/com.xxx.xxx
Success
APK installed in 27 s 241 ms
$ adb shell am start -n "com.xxx.xxx/com.xxx.xxx.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Waiting for application to come online: com.xxx.xxx.test | com.xxx.xxx
Connecting to com.xxx.xxx
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/System.out: Sending WAIT chunk
W/ActivityThread: Application com.xxx.xxx is waiting for the debugger on port 8100...
I/dalvikvm: Debugger is active
I/System.out: Debugger has connected
waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
Connected to the target VM, address: 'localhost:8602', transport: 'socket'
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: debugger has settled (1405)
I/dalvikvm: Could not find method android.content.Context.createDeviceProtectedStorageContext, referenced from method android.support.v4.content.ContextCompat.createDeviceProtectedStorageContext
W/dalvikvm: VFY: unable to resolve virtual method 565: Landroid/content/Context;.createDeviceProtectedStorageContext ()Landroid/content/Context;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006
I/dalvikvm: Could not find method android.content.Context.getCodeCacheDir, referenced from method android.support.v4.content.ContextCompat.getCodeCacheDir
W/dalvikvm: VFY: unable to resolve virtual method 573: Landroid/content/Context;.getCodeCacheDir ()Ljava/io/File;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006
I/dalvikvm: Could not find method android.content.Context.getColor, referenced from method android.support.v4.content.ContextCompat.getColor
W/dalvikvm: VFY: unable to resolve virtual method 574: Landroid/content/Context;.getColor (I)I
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006
I/dalvikvm: Could not find method android.content.Context.getColorStateList, referenced from method android.support.v4.content.ContextCompat.getColorStateList
W/dalvikvm: VFY: unable to resolve virtual method 575: Landroid/content/Context;.getColorStateList (I)Landroid/content/res/ColorStateList;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006
I/dalvikvm: Could not find method android.content.Context.getDataDir, referenced from method android.support.v4.content.ContextCompat.getDataDir
W/dalvikvm: VFY: unable to resolve virtual method 577: Landroid/content/Context;.getDataDir ()Ljava/io/File;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006
I/dalvikvm: Could not find method android.content.Context.getDrawable, referenced from method android.support.v4.content.ContextCompat.getDrawable
W/dalvikvm: VFY: unable to resolve virtual method 580: Landroid/content/Context;.getDrawable (I)Landroid/graphics/drawable/Drawable;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006
I/dalvikvm: Could not find method android.content.Context.getNoBackupFilesDir, referenced from method android.support.v4.content.ContextCompat.getNoBackupFilesDir
W/dalvikvm: VFY: unable to resolve virtual method 587: Landroid/content/Context;.getNoBackupFilesDir ()Ljava/io/File;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006
I/dalvikvm: Could not find method android.content.Context.isDeviceProtectedStorage, referenced from method android.support.v4.content.ContextCompat.isDeviceProtectedStorage
W/dalvikvm: VFY: unable to resolve virtual method 600: Landroid/content/Context;.isDeviceProtectedStorage ()Z
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006
I/dalvikvm: Could not find method android.content.Context.startForegroundService, referenced from method android.support.v4.content.ContextCompat.startForegroundService
W/dalvikvm: VFY: unable to resolve virtual method 615: Landroid/content/Context;.startForegroundService (Landroid/content/Intent;)Landroid/content/ComponentName;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006
I/dalvikvm: Could not find method android.content.Context.isDeviceProtectedStorage, referenced from method com.google.android.gms.internal.measurement.zzsl.init
W/dalvikvm: VFY: unable to resolve virtual method 600: Landroid/content/Context;.isDeviceProtectedStorage ()Z
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0009
V/FA: Registered activity lifecycle callback
D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
I/FirebaseInitProvider: FirebaseApp initialization successful
V/FA: onActivityCreated
W/dalvikvm: Unable to resolve superclass of Lcom/google/android/gms/ads/internal/client/zze; (3038)
Link of class 'Lcom/google/android/gms/ads/internal/client/zze;' failed
VFY: unable to find class referenced in signature (Lcom/google/android/gms/ads/internal/client/zze;)
W/dalvikvm: Unable to resolve superclass of Lcom/google/android/gms/ads/internal/client/zze; (3038)
Link of class 'Lcom/google/android/gms/ads/internal/client/zze;' failed
I/dalvikvm: Could not find method com.google.android.gms.ads.internal.client.zze.zzb, referenced from method com.google.android.gms.ads.internal.client.zzac.zzH
W/dalvikvm: VFY: unable to resolve virtual method 17122: Lcom/google/android/gms/ads/internal/client/zze;.zzb (Landroid/content/Context;Lcom/google/android/gms/ads/internal/client/AdSizeParcel;Ljava/lang/String;Lcom/google/android/gms/internal/zzew;)Lcom/google/android/gms/ads/internal/client/zzu;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x001f
I/dalvikvm: Could not find method com.google.android.gms.common.internal.zzx.zzb, referenced from method com.google.android.gms.ads.AdRequest$Builder.setContentUrl
W/dalvikvm: VFY: unable to resolve static method 21535: Lcom/google/android/gms/common/internal/zzx;.zzb (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
D/dalvikvm: VFY: replacing opcode 0x71 at 0x0002
W/dalvikvm: Unable to resolve superclass of Lcom/google/android/gms/ads/internal/client/zze; (3038)
Link of class 'Lcom/google/android/gms/ads/internal/client/zze;' failed
E/dalvikvm: Could not find class 'com.google.android.gms.ads.internal.client.zze', referenced from method com.google.android.gms.ads.internal.client.zzn.<init>
W/dalvikvm: VFY: unable to resolve new-instance 2192 (Lcom/google/android/gms/ads/internal/client/zze;) in Lcom/google/android/gms/ads/internal/client/zzn;
D/dalvikvm: VFY: replacing opcode 0x22 at 0x000a
W/dalvikvm: Unable to resolve superclass of Lcom/google/android/gms/ads/internal/client/zze; (3038)
Link of class 'Lcom/google/android/gms/ads/internal/client/zze;' failed
W/dalvikvm: Unable to resolve superclass of Lcom/google/android/gms/ads/internal/client/zze; (3038)
Link of class 'Lcom/google/android/gms/ads/internal/client/zze;' failed
VFY: unable to find class referenced in signature (Lcom/google/android/gms/ads/internal/client/zze;)
W/dalvikvm: Unable to resolve superclass of Lcom/google/android/gms/ads/internal/client/zzaf; (3038)
Link of class 'Lcom/google/android/gms/ads/internal/client/zzaf;' failed
W/dalvikvm: Unable to resolve superclass of Lcom/google/android/gms/ads/internal/client/zzaf; (3038)
Link of class 'Lcom/google/android/gms/ads/internal/client/zzaf;' failed
VFY: unable to find class referenced in signature (Lcom/google/android/gms/ads/internal/client/zzaf;)
W/dalvikvm: Unable to resolve superclass of Lcom/google/android/gms/internal/zzcv; (3038)
Link of class 'Lcom/google/android/gms/internal/zzcv;' failed
W/dalvikvm: Unable to resolve superclass of Lcom/google/android/gms/internal/zzcv; (3038)
Link of class 'Lcom/google/android/gms/internal/zzcv;' failed
W/dalvikvm: VFY: unable to find class referenced in signature (Lcom/google/android/gms/internal/zzcv;)
W/dalvikvm: Unable to resolve superclass of Lcom/google/android/gms/ads/internal/reward/client/zzf; (3038)
Link of class 'Lcom/google/android/gms/ads/internal/reward/client/zzf;' failed
W/dalvikvm: Unable to resolve superclass of Lcom/google/android/gms/ads/internal/reward/client/zzf; (3038)
Link of class 'Lcom/google/android/gms/ads/internal/reward/client/zzf;' failed
W/dalvikvm: VFY: unable to find class referenced in signature (Lcom/google/android/gms/ads/internal/reward/client/zzf;)
Unable to resolve superclass of Lcom/google/android/gms/ads/internal/client/zze; (3038)
Link of class 'Lcom/google/android/gms/ads/internal/client/zze;' failed
D/dalvikvm: DexOpt: unable to opt direct call 0x42de at 0x0c in Lcom/google/android/gms/ads/internal/client/zzn;.<init>
W/dalvikvm: Unable to resolve superclass of Lcom/google/android/gms/ads/internal/client/zzaf; (3038)
Link of class 'Lcom/google/android/gms/ads/internal/client/zzaf;' failed
D/dalvikvm: DexOpt: unable to opt direct call 0x427b at 0x1a in Lcom/google/android/gms/ads/internal/client/zzn;.<init>
W/dalvikvm: Unable to resolve superclass of Lcom/google/android/gms/internal/zzcv; (3038)
Link of class 'Lcom/google/android/gms/internal/zzcv;' failed
D/dalvikvm: DexOpt: unable to opt direct call 0x623a at 0x21 in Lcom/google/android/gms/ads/internal/client/zzn;.<init>
W/dalvikvm: Unable to resolve superclass of Lcom/google/android/gms/ads/internal/reward/client/zzf; (3038)
Link of class 'Lcom/google/android/gms/ads/internal/reward/client/zzf;' failed
D/dalvikvm: DexOpt: unable to opt direct call 0x46fd at 0x28 in Lcom/google/android/gms/ads/internal/client/zzn;.<init>
W/dalvikvm: DexOpt: resolve class illegal access: Lcom/google/android/gms/ads/internal/util/client/zza; -> Lcom/google/android/gms/common/zze;
I/dalvikvm: Could not find method com.google.android.gms.common.zze.isGooglePlayServicesAvailable, referenced from method com.google.android.gms.ads.internal.util.client.zza.zzU
W/dalvikvm: VFY: unable to resolve static method 22073: Lcom/google/android/gms/common/zze;.isGooglePlayServicesAvailable (Landroid/content/Context;)I
D/dalvikvm: VFY: replacing opcode 0x71 at 0x0000
I/dalvikvm: Could not find method com.google.android.gms.internal.zzne.zzsi, referenced from method com.google.android.gms.ads.internal.util.client.zza.zzW
W/dalvikvm: VFY: unable to resolve static method 27575: Lcom/google/android/gms/internal/zzne;.zzsi ()Z
D/dalvikvm: VFY: replacing opcode 0x71 at 0x0014
W/dalvikvm: Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lcom/google/android/gms/ads/internal/client/zzn;
Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lcom/google/android/gms/ads/internal/client/zzaa;
Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lcom/google/android/gms/ads/AdRequest;
D/AndroidRuntime: Shutting down VM
W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x417e1da0)
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.xxx.xxx, PID: 29691
java.lang.NoClassDefFoundError: com.google.android.gms.ads.internal.client.zze
at com.google.android.gms.ads.internal.client.zzn.<init>(Unknown Source)
at com.google.android.gms.ads.internal.client.zzn.<clinit>(Unknown Source)
at com.google.android.gms.ads.internal.client.zzaa.<clinit>(Unknown Source)
at com.google.android.gms.ads.AdRequest.<clinit>(Unknown Source)
at com.google.android.gms.ads.AdRequest$Builder.<init>(Unknown Source)
at com.xxx.xxx.MainActivity.requestNewInterstitial(MainActivity.java:77)
at com.xxx.xxx.MainActivity.onCreate(MainActivity.java:49)
at android.app.Activity.performCreate(Activity.java:5541)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2368)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2464)
at android.app.ActivityThread.access$900(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1308)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5653)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
at dalvik.system.NativeStart.main(Native Method)
Disconnected from the target VM, address: 'localhost:8602', transport: 'socket'
my gradle info also i run android version 3.2 and gradle wrapper gradle-4.6
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.2"
defaultConfig {
applicationId "com.xxx.xxx"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "KING-DEV"
}
buildTypes {
release {
debuggable false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.google.android.gms:play-services-ads:8.4.0'
implementation 'com.google.firebase:firebase-core:16.0.4'
}
apply plugin: 'com.google.gms.google-services'**
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.google.gms:google-services:4.1.0' // google-services plugin
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Try applying plugin of google play services
apply plugin: 'com.google.gms.google-services'
To solve this, please change the following line of code:
compile 'com.google.android.gms:play-services-ads:8.4.0'
to
implementation 'com.google.android.gms:play-services-ads:16.0.0'
And remove ** after this line of code:
apply plugin: 'com.google.gms.google-services'
I have problem with my first application in Android Studio-Cordova.
I used for my application html,css, jquery and sql.
The application is correct, because I'm attending an on-line course with related code.
It starts, but the message of creating db isn't appeared.
the log of Android Studio is this:
Client not ready yet..Waiting for process to come online
Connected to process 2679 on device Nexus_5_API_19_armeabi_v7a [emulator-5554]
I/InstantRun: Instant Run Runtime started. Android package is com.videocorsi.test, real application class is null.
W/InstantRun: No instant run dex files added to classpath
I/CordovaLog: Changing log level to DEBUG(3)
I/CordovaActivity: Apache Cordova native platform version 6.0.0 is starting
D/CordovaActivity: CordovaActivity.onCreate()
I/dalvikvm: Could not find method android.app.Activity.checkSelfPermission, referenced from method org.apache.cordova.CordovaInterfaceImpl.hasPermission
W/dalvikvm: VFY: unable to resolve virtual method 2: Landroid/app/Activity;.checkSelfPermission (Ljava/lang/String;)I
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0023
I/dalvikvm: Could not find method android.app.Activity.requestPermissions, referenced from method org.apache.cordova.CordovaInterfaceImpl.requestPermissions
W/dalvikvm: VFY: unable to resolve virtual method 136: Landroid/app/Activity;.requestPermissions ([Ljava/lang/String;I)V
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0029
V/WebViewChromium: Binding Chromium to the background looper Looper (main, tid 1) {9dd95220}
I/chromium: [INFO:library_loader_hooks.cc(112)] Chromium logging enabled: level = 0, default verbosity = 0
I/BrowserProcessMain: Initializing chromium process, renderers=0
W/chromium: [WARNING:proxy_service.cc(888)] PAC support disabled because there is no system implementation
D/dalvikvm: GC_FOR_ALLOC freed 142K, 12% free 3463K/3892K, paused 86ms, total 88ms
I/dalvikvm-heap: Grow heap (frag case) to 6.078MB for 2536936-byte allocation
D/dalvikvm: GC_FOR_ALLOC freed 0K, 7% free 5941K/6372K, paused 58ms, total 58ms
I/dalvikvm: Could not find method android.webkit.CookieManager.setAcceptThirdPartyCookies, referenced from method org.apache.cordova.engine.SystemCookieManager.<init>
W/dalvikvm: VFY: unable to resolve virtual method 953: Landroid/webkit/CookieManager;.setAcceptThirdPartyCookies (Landroid/webkit/WebView;Z)V
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0046
I/dalvikvm: Could not find method android.webkit.CookieManager.flush, referenced from method org.apache.cordova.engine.SystemCookieManager.flush
W/dalvikvm: VFY: unable to resolve virtual method 947: Landroid/webkit/CookieManager;.flush ()V
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0019
W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/webkit/ClientCertRequest;)
W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/webkit/ClientCertRequest;)
I/dalvikvm: Could not find method android.webkit.WebViewClient.onReceivedClientCertRequest, referenced from method org.apache.cordova.engine.SystemWebViewClient.onReceivedClientCertRequest
W/dalvikvm: VFY: unable to resolve virtual method 1147: Landroid/webkit/WebViewClient;.onReceivedClientCertRequest (Landroid/webkit/WebView;Landroid/webkit/ClientCertRequest;)V
D/dalvikvm: VFY: replacing opcode 0x6f at 0x0031
W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/webkit/PermissionRequest;)
I/dalvikvm: Could not find method android.webkit.PermissionRequest.getResources, referenced from method org.apache.cordova.engine.SystemWebChromeClient.onPermissionRequest
W/dalvikvm: VFY: unable to resolve virtual method 964: Landroid/webkit/PermissionRequest;.getResources ()[Ljava/lang/String;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0023
I/dalvikvm: Could not find method android.webkit.WebChromeClient$FileChooserParams.createIntent, referenced from method org.apache.cordova.engine.SystemWebChromeClient.onShowFileChooser
W/dalvikvm: VFY: unable to resolve virtual method 969: Landroid/webkit/WebChromeClient$FileChooserParams;.createIntent ()Landroid/content/Intent;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0021
D/SystemWebViewEngine: CordovaWebView is running on device made by: unknown
D/PluginManager: init()
D/CordovaWebViewImpl: >>> loadUrl(file:///android_asset/www/index.html)
D/CordovaActivity: Started the activity.
D/CordovaActivity: Resumed the activity.
D/OpenGLRenderer: Enabling debug mode 0
I/Choreographer: Skipped 81 frames! The application may be doing too much work on its main thread.
W/AwContents: nativeOnDraw failed; clearing to background color.
W/AwContents: nativeOnDraw failed; clearing to background color.
W/AwContents: nativeOnDraw failed; clearing to background color.
W/AwContents: nativeOnDraw failed; clearing to background color.
D/CordovaWebViewImpl: onPageDidNavigate(file:///android_asset/www/index.html)
D/JsMessageQueue: Set native->JS mode to EvalBridgeMode
I/chromium: [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
I/chromium: [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
I/Choreographer: Skipped 74 frames! The application may be doing too much work on its main thread.
D/SystemWebChromeClient: file:///android_asset/www/cordova_plugins.js: Line 7 : Uncaught SyntaxError: Unexpected string
I/chromium: [INFO:CONSOLE(7)] "Uncaught SyntaxError: Unexpected string", source: file:///android_asset/www/cordova_plugins.js (7)
D/CordovaWebViewImpl: onPageFinished(file:///android_asset/www/index.html)
D/SystemWebChromeClient: file:///android_asset/www/js/index.js: Line 39 : Uncaught ReferenceError: listeningElement is not defined
I/chromium: [INFO:CONSOLE(39)] "Uncaught ReferenceError: listeningElement is not defined", source: file:///android_asset/www/js/index.js (39)
D/SystemWebChromeClient: file:///android_asset/www/index.html: Line 237 : Uncaught TypeError: Cannot call method 'transaction' of undefined
I/chromium: [INFO:CONSOLE(237)] "Uncaught TypeError: Cannot call method 'transaction' of undefined", source: file:///android_asset/www/index.html (237)
What Can I do?
the problem was in this file index.js . I had commented this:
receivedEvent: function(id) { var parentElement =document.getElementById(id);
// var listeningElement = parentElement.querySelector('.listening');
//var receivedElement = parentElement.querySelector('.received');
// listeningElement.setAttribute('style', 'display:none;'); //receivedElement.setAttribute('style', 'display:block;');
console.log('Received Event: ' + id); }
Then, I had move the tag script with my js/jquery code at the end of the tag
My App has the following Parameters:
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "de.munich.myApp"
minSdkVersion 17
targetSdkVersion 23
multiDexEnabled true
}
buildTypes {
debug {
debuggable true
}
release {
minifyEnabled false
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
I included support package v7:
dependencies {
compile 'com.google.code.gson:gson:2.4'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:recyclerview-v7:23.2.0'
compile 'com.android.support:cardview-v7:23.2.0'
}
And now i try to start my App on a Galaxy Ace with Android Version 4.4.2 (API Level 19) and i get many errors because some methods referenced by the android.support.v7 could not be found:
Could not find method android.view.Window$Callback.onSearchRequested, referenced from method android.support.v7.internal.view.WindowCallbackWrapper.onSearchRequested
Could not find method android.view.Window$Callback.onWindowStartingActionMode, referenced from method android.support.v7.internal.view.WindowCallbackWrapper.onWindowStartingActionMode
Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.internal.widget.TintTypedArray.getChangingConfigurations
Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.internal.widget.TintTypedArray.getType
Ofcourse the app crashes.
Is there any way for me to fix those problems without having to increase the minSdkVersion?
EDIT
import android.app.Notification;
import android.content.Context;
import android.support.v4.app.NotificationCompat;
public class HelperNotification {
/**
*
* #param context
* #param title
* #param message
* #return
*/
public static NotificationCompat.Builder buildNotification(Context context, String title, String message) {
NotificationCompat.Builder builder = new NotificationCompat.Builder(context);
builder.setContentTitle(title);
builder.setContentText(message);
int defaults = 0;
defaults = defaults | Notification.DEFAULT_LIGHTS;
defaults = defaults | Notification.DEFAULT_VIBRATE;
defaults = defaults | Notification.DEFAULT_SOUND;
builder.setDefaults(defaults);
return builder;
}
}
EDIT 2
I/dalvikvm: Could not find method android.os.UserManager.getApplicationRestrictions, referenced from method com.google.android.gms.common.zze.zzaq
W/dalvikvm: VFY: unable to resolve virtual method 1747: Landroid/os/UserManager;.getApplicationRestrictions (Ljava/lang/String;)Landroid/os/Bundle;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0012
E/dalvikvm: Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.zze.zzb
W/dalvikvm: VFY: unable to resolve check-cast 35 (Landroid/app/AppOpsManager;) in Lcom/google/android/gms/common/zze;
D/dalvikvm: VFY: replacing opcode 0x1f at 0x000e
I/dalvikvm: Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method com.google.android.gms.common.zze.zzi
W/dalvikvm: VFY: unable to resolve virtual method 605: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x000b
I/GMPM: App measurement is starting up, version: 8487
I/GMPM: To enable debug logging run: adb shell setprop log.tag.GMPM VERBOSE
E/GMPM: GoogleService failed to initialize, status: 10, Missing an expected resource: 'R.string.google_app_id' for initializing Google services. Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin.
E/GMPM: Scheduler not set. Not logging error/warn.
E/GMPM: Uploading is not possible. App measurement disabled
D/dalvikvm: GC_CONCURRENT freed 265K, 16% free 8722K/10356K, paused 5ms+2ms, total 26ms
W/dalvikvm: VFY: unable to find class referenced in signature (Lde/hof/my_project/enums/status/images/StatusImageScale;)
W/dalvikvm: VFY: unable to resolve static field 34720 ($SwitchMap$de$hof$my_project$enums$status$images$StatusImageScale) in Lde/hof/my_project/fragments/FragmentSplash$1;
D/dalvikvm: VFY: replacing opcode 0x62 at 0x0000
E/dalvikvm: Could not find class 'de.hof.my_project.tasks.images.TaskImagesScale', referenced from method de.hof.my_project.fragments.FragmentSplash.onViewCreated
W/dalvikvm: VFY: unable to resolve new-instance 9154 (Lde/hof/my_project/tasks/images/TaskImagesScale;) in Lde/hof/my_project/fragments/FragmentSplash;
D/dalvikvm: VFY: replacing opcode 0x22 at 0x0003
D/dalvikvm: DexOpt: unable to opt direct call 0xf89d at 0x05 in Lde/hof/my_project/fragments/FragmentSplash;.onViewCreated
I added some mor log outputs. This is when i run my app on a Samsung Galaxy S3 with API 17 (my minimum required API). Last week, before i updated my libraries from 23.0 to 23.2 everything was working. Now it seems like he cant find some of the classes i defined.
Well to answer the question on the title of your question you should change Notification to NotificationCompat, i.e.:
NotificationCompat.Builder.
The regular Notification.Builder has setLocal available only since API 20.
I found the solution.
The problem was related to the 65K Methods Count.
I did what android recommended in the link and so i
was able to install the app again on devices with older
API's.
This has been asked before here and here, but there are not useful answers, so I'll try to be specific: I'm trying to implement Google Cloud Messaging on an app developed using Android Studio 1.2.2. I have installed Google Play Services as explained here, and I implemented the checkPlayServices() method as suggested in this sample:
private boolean checkPlayServices() {
int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
if (resultCode != ConnectionResult.SUCCESS) {
if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
GooglePlayServicesUtil.getErrorDialog(resultCode, this,
PLAY_SERVICES_RESOLUTION_REQUEST).show();
} else {
Log.i(TAG, "This device is not supported.");
finish();
}
return false;
}
return true;
}
If the device doesn't has Google Play Service or if it is outdated this method should alert the user and provide a button to install/update it easily. I test the app on a Samsung Galaxy S II with Android 4.1.2 with factory settings so it doesn't has an updated Google Play Services. I have confirmed that the GooglePlayServicesUtil.getErrorDialog() method is called, but the dialog doesn't appear. Instead I got the following in the logcat:
06-14 19:19:45.691 10616-10616/? I/dalvikvm﹕ Could not find method android.app.Notification$Builder.setLocalOnly, referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zza
06-14 19:19:45.691 10616-10616/? W/dalvikvm﹕ VFY: unable to resolve virtual method 250: Landroid/app/Notification$Builder;.setLocalOnly (Z)Landroid/app/Notification$Builder;
06-14 19:19:45.691 10616-10616/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x00c2
06-14 19:19:45.691 10616-10616/? I/dalvikvm﹕ DexOpt: access denied from Lcom/google/android/gms/common/GooglePlayServicesUtil; to field Landroid/app/Notification;.extras
06-14 19:19:45.691 10616-10616/? W/dalvikvm﹕ VFY: unable to resolve instance field 18
06-14 19:19:45.691 10616-10616/? D/dalvikvm﹕ VFY: replacing opcode 0x54 at 0x00e1
06-14 19:19:45.691 10616-10616/? E/dalvikvm﹕ Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zza
06-14 19:19:45.691 10616-10616/? W/dalvikvm﹕ VFY: unable to resolve check-cast 27 (Landroid/app/AppOpsManager;) in Lcom/google/android/gms/common/GooglePlayServicesUtil;
06-14 19:19:45.691 10616-10616/? D/dalvikvm﹕ VFY: replacing opcode 0x1f at 0x000e
06-14 19:19:45.696 10616-10616/? I/dalvikvm﹕ Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zzh
06-14 19:19:45.696 10616-10616/? W/dalvikvm﹕ VFY: unable to resolve virtual method 542: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
06-14 19:19:45.696 10616-10616/? D/dalvikvm﹕ VFY: replacing opcode 0x6e at 0x000b
06-14 19:19:45.696 10616-10616/? W/GooglePlayServicesUtil﹕ Google Play services out of date. Requires 7571000 but found 2012110
I'm completely stuck. Any help will be appreciated.
Your dialog is not being displayed because execution in the UI thread does not suspend when a dialog is created. This means your application will continue to run after the dialog is supposed to be displayed. If your code does something such as:
showDialog();
startDifferentActivity();
A user wouldn't be able to interact with the dialog because the different activity would start before the dialog even displayed. If you have code execution that is dependent on the user selecting the positive/negative/neutral buttons of a dialog or dismissing a dialog, implement the appropriate listeners.
I am tring to integrate flurry test ads but the method setEnableTestAds throws a compilation error-- "the methods is undefined for FlurryAdBanner"
i comment this part and try to fetch and display ads but i do not see any ads in the emulator.
I am following this link.
My code-
private RelativeLayout mBanner;
private FlurryAdBanner mFlurryAdBanner = null;
private String mAdSpaceName = "BANNER_ADSPACE";
private String adspace = "BANNER_BOTTOM";
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_base);
FlurryAgent.init(this, Constants.FLURRY_KEY);
}
#Override
protected void onStart() {
super.onStart();
FlurryAgent.onStartSession(this, Constants.FLURRY_KEY);
//Flurry Ads
mBanner = (RelativeLayout)findViewById(R.id.flurry_banner);
mFlurryAdBanner = new FlurryAdBanner(this, mBanner, mAdSpaceName);
//FlurryAgent.logEvent("Pic taken");
// fetch and display ad for this ad space as soon as it is ready.
//mFlurryAdBanner.fetchAd();
mFlurryAdBanner.fetchAndDisplayAd();
// mFlurryAdBanner.setEnableTestAds(true);
}
My console messsages---
12-23 11:54:16.034: E/FlurryAgent(2069): There is a problem with the Google Play Services library, which is required for Android Advertising ID support. The Google Play Services library should be integrated in any app shipping in the Play Store that uses analytics or advertising.
12-23 11:54:16.454: D/dalvikvm(2069): GC_FOR_ALLOC freed 252K, 10% free 2913K/3224K, paused 40ms, total 43ms
12-23 11:54:16.734: W/FlurryAgent(2069): Flurry session created for context:XXX.activity.BaseActivity#b3ff2710
12-23 11:54:16.874: I/dalvikvm(2069): Failed resolving Lcom/flurry/sdk/bp; interface 1225 'Lcom/facebook/ads/AdListener;'
12-23 11:54:16.874: W/dalvikvm(2069): Link of class 'Lcom/flurry/sdk/bp;' failed
12-23 11:54:16.884: E/dalvikvm(2069): Could not find class 'com.flurry.sdk.bp', referenced from method com.flurry.sdk.bq.a
12-23 11:54:16.884: W/dalvikvm(2069): VFY: unable to resolve new-instance 1366 (Lcom/flurry/sdk/bp;) in Lcom/flurry/sdk/bq;
12-23 11:54:16.884: D/dalvikvm(2069): VFY: replacing opcode 0x22 at 0x000a
12-23 11:54:16.884: I/dalvikvm(2069): Failed resolving Lcom/flurry/sdk/br; interface 1230 'Lcom/facebook/ads/InterstitialAdListener;'
12-23 11:54:16.884: W/dalvikvm(2069): Link of class 'Lcom/flurry/sdk/br;' failed
12-23 11:54:16.884: E/dalvikvm(2069): Could not find class 'com.flurry.sdk.br', referenced from method com.flurry.sdk.bq.a
12-23 11:54:16.884: W/dalvikvm(2069): VFY: unable to resolve new-instance 1368 (Lcom/flurry/sdk/br;) in Lcom/flurry/sdk/bq;
12-23 11:54:16.884: D/dalvikvm(2069): VFY: replacing opcode 0x22 at 0x0008
12-23 11:54:16.894: I/dalvikvm(2069): Failed resolving Lcom/flurry/sdk/bp; interface 1225 'Lcom/facebook/ads/AdListener;'
12-23 11:54:16.894: W/dalvikvm(2069): Link of class 'Lcom/flurry/sdk/bp;' failed
12-23 11:54:16.894: D/dalvikvm(2069): DexOpt: unable to opt direct call 0x28c0 at 0x0c in Lcom/flurry/sdk/bq;.a
12-23 11:54:16.944: I/dalvikvm(2069): Failed resolving Lcom/flurry/sdk/br; interface 1230 'Lcom/facebook/ads/InterstitialAdListener;'
12-23 11:54:16.994: W/dalvikvm(2069): Link of class 'Lcom/flurry/sdk/br;' failed
12-23 11:54:16.994: D/dalvikvm(2069): DexOpt: unable to opt direct call 0x28d6 at 0x0a in Lcom/flurry/sdk/bq;.a
12-23 11:54:17.024: V/WebViewChromium(2069): Binding Chromium to the main looper Looper (main, tid 1) {b3fb94a8}
12-23 11:54:17.064: I/chromium(2069): [INFO:library_loader_hooks.cc(112)] Chromium logging enabled: level = 0, default verbosity = 0
12-23 11:54:17.104: I/BrowserProcessMain(2069): Initializing chromium process, renderers=0
12-23 11:54:17.394: E/chromium(2069): [ERROR:gl_surface_egl.cc(153)] No suitable EGL configs found.
12-23 11:54:17.394: E/chromium(2069): [ERROR:gl_surface_egl.cc(620)] GLSurfaceEGL::InitializeOneOff failed.
12-23 11:54:17.394: E/chromium(2069): [ERROR:gl_surface_egl.cc(153)] No suitable EGL configs found.
12-23 11:54:17.404: E/chromium(2069): [ERROR:gl_surface_egl.cc(620)] GLSurfaceEGL::InitializeOneOff failed.
12-23 11:54:17.404: E/chromium(2069): [ERROR:gpu_info_collector.cc(86)] gfx::GLSurface::InitializeOneOff() failed
12-23 11:54:17.474: W/FlurryAgent(2069): Flurry session started for context:XXX.activity.BaseActivity#b3ff2710
12-23 11:54:17.484: W/chromium(2069): [WARNING:proxy_service.cc(888)] PAC support disabled because there is no system implementation
12-23 11:54:38.524: W/FlurryAgent(2069): **Analytics report sent.**
12-23 11:54:40.764: E/FlurryAgent(2069): Ad server responded with the following error(s):
12-23 11:54:40.764: E/FlurryAgent(2069): **Unknown Api Key**
Unfortunately, Ad Test Mode is currently having issues and only works with Gemini Video ads at this time. At this point we do not believe the issue is with your integration. The error just means that the ad is unfilled, and we expect the fill rate to improve going forward.
Not sure, but haven't improved since this mail for me.
The log is very clear: you have not provided the API key corresponding to your app. You can found it on dev.flurry.com