I am getting the below error everytime I am building my APK; Gradle build shows it has been done successfully but while installing the APK at my phone, it crashes everytime
10-04 22:52:53.848 9297-9297/com.usfca.studentrecordsverify E/Trace: error opening trace file: No such file or directory (2)
10-04 22:52:53.908 9297-9297/com.usfca.studentrecordsverify E/dalvikvm: Could not find class 'android.util.ArrayMap', referenced from method com.android.tools.fd.runtime.MonkeyPatcher.monkeyPatchExistingResources
10-04 22:52:53.908 9297-9297/com.usfca.studentrecordsverify W/dalvikvm: VFY: unable to resolve check-cast 1786 (Landroid/util/ArrayMap;) in Lcom/android/tools/fd/runtime/MonkeyPatcher;
10-04 22:52:53.908 9297-9297/com.usfca.studentrecordsverify E/dalvikvm: Could not find class 'android.util.ArrayMap', referenced from method com.android.tools.fd.runtime.MonkeyPatcher.pruneResourceCache
10-04 22:52:53.908 9297-9297/com.usfca.studentrecordsverify W/dalvikvm: VFY: unable to resolve const-class 1786 (Landroid/util/ArrayMap;) in Lcom/android/tools/fd/runtime/MonkeyPatcher;
10-04 22:52:53.928 9297-9297/com.usfca.studentrecordsverify W/dalvikvm: VFY: unable to resolve virtual method 437: Landroid/content/Context;.getSystemService (Ljava/lang/Class;)Ljava/lang/Object;
10-04 22:52:53.928 9297-9297/com.usfca.studentrecordsverify W/dalvikvm: VFY: unable to resolve virtual method 231: Landroid/app/Activity;.stopLockTask ()V
10-04 22:52:53.928 9297-9297/com.usfca.studentrecordsverify E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.usfca.studentrecordsverify.MainActivity.access$super
10-04 22:52:53.928 9297-9297/com.usfca.studentrecordsverify W/dalvikvm: VFY: unable to resolve check-cast 226 (Landroid/os/PersistableBundle;) in Lcom/usfca/studentrecordsverify/MainActivity;
10-04 22:52:53.928 9297-9297/com.usfca.studentrecordsverify W/dalvikvm: VFY: unable to resolve virtual method 419: Landroid/content/Context;.getColorStateList (I)Landroid/content/res/ColorStateList;
10-04 22:52:53.928 9297-9297/com.usfca.studentrecordsverify W/dalvikvm: VFY: unable to resolve virtual method 154: Landroid/app/Activity;.onVisibleBehindCanceled ()V
10-04 22:52:53.928 9297-9297/com.usfca.studentrecordsverify W/dalvikvm: VFY: unable to resolve virtual method 158: Landroid/app/Activity;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;
10-04 22:52:53.928 9297-9297/com.usfca.studentrecordsverify E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.usfca.studentrecordsverify.MainActivity.access$super
Here is the build.gradle
android.util.ArrayMap was introduced with API-Level 19 (ArrayMap). If you run the code on a Android 4.2.2 device, it it will not find this class on your device and your app will crash.
You can use a java.util.Map instead. It is not as performant as the ArrayMap, but it is available on every Android platform.
change your minSdkVersion to 19
defaultConfig {
applicationId "com.usfca.studentrecordsverification"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
Because ArrayMap was introduced with API-Level 19!
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 get following exception log if I try to open my app on API 16 (on API 27 it is working):
V/FA: onActivityCreated
I/dalvikvm: Could not find method android.app.AlarmManager.setExactAndAllowWhileIdle, referenced from method com.text.app.utilities.COLNotification.addPreAlarm
VFY: unable to resolve virtual method 130: Landroid/app/AlarmManager;.setExactAndAllowWhileIdle (IJLandroid/app/PendingIntent;)V
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0021
I/dalvikvm: Could not find method android.app.AlarmManager.setExact, referenced from method com.text.app.utilities.COLNotification.addPreAlarm
W/dalvikvm: VFY: unable to resolve virtual method 129: Landroid/app/AlarmManager;.setExact (IJLandroid/app/PendingIntent;)V
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0084
W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/app/NotificationChannel;)
I/dalvikvm: Could not find method android.app.NotificationChannel.getSound, referenced from method com.text.app.utilities.COLNotification.buildNotification
W/dalvikvm: VFY: unable to resolve virtual method 264: Landroid/app/NotificationChannel;.getSound ()Landroid/net/Uri;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0131
W/dalvikvm: VFY: unable to resolve exception class 435 (Landroid/os/FileUriExposedException;)
W/dalvikvm: VFY: unable to find exception handler at addr 0x25e
W/dalvikvm: VFY: rejected Lcom/text/app/utilities/COLNotification;.buildNotification (Lcom/text/app/models/appModel;)V
W/dalvikvm: VFY: rejecting opcode 0x0d at 0x025e
W/dalvikvm: VFY: rejected Lcom/text/app/utilities/COLNotification;.buildNotification (Lcom/text/app/models/appModel;)V
W/dalvikvm: Verifier rejected class Lcom/text/app/utilities/COLNotification;
All warnings are correct because the methods like "NotificationChannel" are not existing in API 16.
And the code I use for example the "NotificationChannel" is not executed because I check for the Build.VERSION.SDK.INT!
What exactly is the problem? Can anybody help?
I used the "FileUriException" in a catch statement and this caused the the problem.
Instead of:
catch(FileUriException e) {
}
I do now:
catch(Exception e) {
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && e instanceof FileUriExposedException) {
}
}
I have a problem with my test Google Map application.
It perfectly run only on one phone Xiaomi Redme 3 (5.1.1).
But when I run it in debug mode on another phone Samsung S3 mini (4.1.2) from the same computer, it not works, only blank windows with an inscription Google.
Also it not works on Asus Zenphone 5 (4.2.2).
Below my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="elcom.maps">
<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but you must specify either coarse or fine
location permissions for the 'MyLocation' functionality.
-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<!--
The API key for Google Maps-based APIs is defined as a string resource.
(See the file "res/values/google_maps_api.xml").
Note that the API key is linked to the encryption key used to sign the APK.
You need a different API key for each encryption key, including the release key that is used to
sign the APK for publishing.
You can define the keys for the debug and release targets in src/debug/ and src/release/.
-->
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIza..1DM"/>
<activity
android:name=".MapsActivity"
android:label="#string/title_activity_maps">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
Also below android monitor log:
08-30 17:29:50.608 27197-27197/elcom.maps E/dalvikvm: Could not find class 'android.os.UserManager', referenced from method com.google.android.gms.common.zze.zzas
08-30 17:29:50.608 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve check-cast 246 (Landroid/os/UserManager;) in Lcom/google/android/gms/common/zze;
08-30 17:29:50.618 27197-27197/elcom.maps I/dalvikvm: Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method com.google.android.gms.common.zze.zzs
08-30 17:29:50.618 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 482: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
08-30 17:29:50.638 27197-27197/elcom.maps E/dalvikvm: Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.internal.zzacw.zzg
08-30 17:29:50.638 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve check-cast 27 (Landroid/app/AppOpsManager;) in Lcom/google/android/gms/internal/zzacw;
08-30 17:29:50.698 27197-27197/elcom.maps I/zzai: Making Creator dynamically
08-30 17:29:52.140 27197-27197/elcom.maps I/dalvikvm: Could not find method android.content.ContextWrapper.createCredentialProtectedStorageContext, referenced from method hfi.createCredentialProtectedStorageContext
08-30 17:29:52.140 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 935: Landroid/content/ContextWrapper;.createCredentialProtectedStorageContext ()Landroid/content/Context;
08-30 17:29:52.140 27197-27197/elcom.maps I/dalvikvm: Could not find method android.content.ContextWrapper.createDeviceProtectedStorageContext, referenced from method hfi.createDeviceProtectedStorageContext
08-30 17:29:52.140 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 936: Landroid/content/ContextWrapper;.createDeviceProtectedStorageContext ()Landroid/content/Context;
08-30 17:29:52.140 27197-27197/elcom.maps I/dalvikvm: Could not find method android.content.ContextWrapper.createCredentialProtectedStorageContext, referenced from method com.google.android.chimera.ModuleContext.createCredentialProtectedStorageContext
08-30 17:29:52.150 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 935: Landroid/content/ContextWrapper;.createCredentialProtectedStorageContext ()Landroid/content/Context;
08-30 17:29:52.150 27197-27197/elcom.maps I/dalvikvm: Could not find method android.content.ContextWrapper.createDeviceProtectedStorageContext, referenced from method com.google.android.chimera.ModuleContext.createDeviceProtectedStorageContext
08-30 17:29:52.150 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 936: Landroid/content/ContextWrapper;.createDeviceProtectedStorageContext ()Landroid/content/Context;
08-30 17:29:52.150 27197-27197/elcom.maps I/dalvikvm: Could not find method com.google.android.chimera.ContextThemeWrapper.createDisplayContext, referenced from method com.google.android.chimera.ModuleContext.createDisplayContext
08-30 17:29:52.150 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 6176: Lcom/google/android/chimera/ContextThemeWrapper;.createDisplayContext (Landroid/view/Display;)Landroid/content/Context;
08-30 17:29:52.160 27197-27197/elcom.maps I/dalvikvm: Could not find method android.content.Context.isCredentialProtectedStorage, referenced from method buc.a
08-30 17:29:52.160 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 916: Landroid/content/Context;.isCredentialProtectedStorage ()Z
08-30 17:29:52.160 27197-27197/elcom.maps E/dalvikvm: Could not find class 'android.os.UserManager', referenced from method buc.a
08-30 17:29:52.160 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve check-cast 355 (Landroid/os/UserManager;) in Lbuc;
08-30 17:29:52.160 27197-27197/elcom.maps I/dalvikvm: Could not find method android.os.UserManager.isUserUnlocked, referenced from method buc.a
08-30 17:29:52.160 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 1507: Landroid/os/UserManager;.isUserUnlocked ()Z
08-30 17:29:52.160 27197-27197/elcom.maps I/dalvikvm: Could not find method android.content.Context.isDeviceProtectedStorage, referenced from method buc.b
08-30 17:29:52.160 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 917: Landroid/content/Context;.isDeviceProtectedStorage ()Z
08-30 17:29:52.170 27197-27197/elcom.maps I/dalvikvm: Could not find method android.content.Context.isDeviceProtectedStorage, referenced from method buc.c
08-30 17:29:52.170 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 917: Landroid/content/Context;.isDeviceProtectedStorage ()Z
08-30 17:29:52.780 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve static field 350 (SUPPORTED_64_BIT_ABIS) in Landroid/os/Build;
08-30 17:29:52.780 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve static field 349 (SUPPORTED_32_BIT_ABIS) in Landroid/os/Build;
08-30 17:29:52.780 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve static field 351 (SUPPORTED_ABIS) in Landroid/os/Build;
08-30 17:29:52.780 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve static field 350 (SUPPORTED_64_BIT_ABIS) in Landroid/os/Build;
08-30 17:29:52.780 27197-27197/elcom.maps I/dalvikvm: DexOpt: unable to optimize static field ref 0x015e at 0x17 in Lbwc;.a
08-30 17:29:52.780 27197-27197/elcom.maps I/dalvikvm: DexOpt: unable to optimize static field ref 0x015d at 0x26 in Lbwc;.a
08-30 17:29:52.780 27197-27197/elcom.maps I/dalvikvm: DexOpt: unable to optimize static field ref 0x015e at 0x0d in Lbwc;.b
08-30 17:29:53.721 27197-27197/elcom.maps I/Google Maps Android API: Google Play services client version: 10084000
08-30 17:29:53.741 27197-27197/elcom.maps I/Google Maps Android API: Google Play services package version: 11302034
08-30 17:29:53.871 27197-27197/elcom.maps I/dalvikvm: Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method ji.a
08-30 17:29:53.871 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 2148: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
08-30 17:29:53.871 27197-27197/elcom.maps E/dalvikvm: Could not find class 'android.os.UserManager', referenced from method ji.a
08-30 17:29:53.871 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve check-cast 452 (Landroid/os/UserManager;) in Lji;
08-30 17:29:53.881 27197-27197/elcom.maps I/dalvikvm: Could not find method android.content.pm.PackageManager.isInstantApp, referenced from method com.google.maps.api.android.lib6.drd.av.a
08-30 17:29:53.881 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 2153: Landroid/content/pm/PackageManager;.isInstantApp (Ljava/lang/String;)Z
08-30 17:29:54.592 27197-27197/elcom.maps I/dalvikvm: Could not find method android.widget.RelativeLayout$LayoutParams.setMarginStart, referenced from method com.google.maps.api.android.lib6.impl.o.a
08-30 17:29:54.592 27197-27197/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 2878: Landroid/widget/RelativeLayout$LayoutParams;.setMarginStart (I)V
08-30 17:29:55.353 27197-27197/elcom.maps W/age: copyMemory is missing from platform - proto runtime falling back to safer methods.
08-30 17:29:56.434 27197-27197/elcom.maps I/libblt_hw: Library opened (handle = 0, fd = 88)
08-30 17:29:57.355 27197-27543/elcom.maps W/DynamiteModule: Local module descriptor class for com.google.android.gms.googlecertificates not found.
08-30 17:29:58.286 27197-27543/elcom.maps I/DynamiteModule: Considering local module com.google.android.gms.googlecertificates:0 and remote module com.google.android.gms.googlecertificates:4
08-30 17:29:58.286 27197-27543/elcom.maps I/DynamiteModule: Selected remote version of com.google.android.gms.googlecertificates, version >= 4
08-30 17:29:58.306 27197-27543/elcom.maps I/dalvikvm: Could not find method android.content.ContextWrapper.createCredentialProtectedStorageContext, referenced from method ax.createCredentialProtectedStorageContext
08-30 17:29:58.326 27197-27543/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 63: Landroid/content/ContextWrapper;.createCredentialProtectedStorageContext ()Landroid/content/Context;
08-30 17:29:58.326 27197-27543/elcom.maps I/dalvikvm: Could not find method android.content.ContextWrapper.createDeviceProtectedStorageContext, referenced from method ax.createDeviceProtectedStorageContext
08-30 17:29:58.336 27197-27543/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 64: Landroid/content/ContextWrapper;.createDeviceProtectedStorageContext ()Landroid/content/Context;
08-30 17:29:58.336 27197-27543/elcom.maps I/dalvikvm: Could not find method e.createCredentialProtectedStorageContext, referenced from method f.createCredentialProtectedStorageContext
08-30 17:29:58.336 27197-27543/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 365: Le;.createCredentialProtectedStorageContext ()Landroid/content/Context;
08-30 17:29:58.336 27197-27543/elcom.maps I/dalvikvm: Could not find method e.createDeviceProtectedStorageContext, referenced from method f.createDeviceProtectedStorageContext
08-30 17:29:58.336 27197-27543/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 366: Le;.createDeviceProtectedStorageContext ()Landroid/content/Context;
08-30 17:29:58.336 27197-27543/elcom.maps I/dalvikvm: Could not find method e.createDisplayContext, referenced from method f.createDisplayContext
08-30 17:29:58.336 27197-27543/elcom.maps W/dalvikvm: VFY: unable to resolve virtual method 367: Le;.createDisplayContext (Landroid/view/Display;)Landroid/content/Context;
08-30 17:29:58.376 27197-27543/elcom.maps W/dalvikvm: VFY: unable to resolve static field 76 (SUPPORTED_64_BIT_ABIS) in Landroid/os/Build;
08-30 17:29:58.376 27197-27543/elcom.maps W/dalvikvm: VFY: unable to resolve static field 75 (SUPPORTED_32_BIT_ABIS) in Landroid/os/Build;
08-30 17:29:58.376 27197-27543/elcom.maps W/dalvikvm: VFY: unable to resolve static field 76 (SUPPORTED_64_BIT_ABIS) in Landroid/os/Build;
08-30 17:29:58.376 27197-27543/elcom.maps I/dalvikvm: DexOpt: unable to optimize static field ref 0x004c at 0x17 in Laa;.a
08-30 17:29:58.376 27197-27543/elcom.maps I/dalvikvm: DexOpt: unable to optimize static field ref 0x004b at 0x26 in Laa;.a
08-30 17:29:58.396 27197-27543/elcom.maps I/dalvikvm: DexOpt: unable to optimize static field ref 0x004c at 0x0d in Laa;.b
08-30 17:34:06.705 27197-27197/elcom.maps W/InputMethodManager: Ignoring onBind: cur seq=-1, given seq=128
How to solve this problem?
I read many similar topics but no results.
Standard Google Map application works fine on problem device.
I tried to reinstall application, clear cache, but result the same.
Update:
When I change SHA1 for debug key to wrong value in APIS console, on Xiaomi marker appears on grey blank screen, but on Samsung only grey screen without marker.
if it's release version , be sure to add the key here too :
It is a very strange situation, after the weekend it all worked on all devices without changing the code! Maybe there is a delay in days to enable maps on second and other devices?
I have some app that needs to be installed on the system directory. I've seen several ways which use adb commands to do so. I think this must be done using the adb shell on the pc and a usb cable. But is there any way for the app to copy itself from Data to system directory without needing a pc?
As I know we can run commands within android app using Runtime. So, I tried this code within onCreate, but it doesn't copy the .apk file. This is the code:
boolean isSystemApp = (getApplicationInfo().flags
& (ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP)) != 0;
if (!isSystemApp) {
Toast.makeText(getApplicationContext (), "not system app", Toast.LENGTH_LONG).show();
try {
String [] commandsOldVersions = {"adb shell\n", "su\n", "mount -o rw,remount /system\n",
"adb push eyedetection.apk /sdcard/\n", "adb shell\n","su cd /sdcard\n"
, "mv eyedetection.apk /system/app\n","su chmod 644/system/app/eyedetection.apk\n" };
String [] commandsNewVersions = {"adb shell\n", "su\n", "mount -o rw,remount /system\n",
"adb push eyedetection.apk /sdcard/\n", "adb shell\n","su cd /sdcard\n"
, "mv eyedetection.apk /system/priv-app\n", "su chmod 644/system/priv-app/eyedetection.apk\n" };
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
// for 4.3 and higher versions, execute the following line (because they've changed their system files hierarchies):
Process process = Runtime.getRuntime().exec(commandsNewVersions);
BufferedReader br= new BufferedReader(new InputStreamReader(process.getInputStream()));
Log.i("cmd", br.readLine());
}//end if
else {
//for older version, execute this line instead
Process process= Runtime.getRuntime().exec(commandsOldVersions);
BufferedReader br= new BufferedReader(new InputStreamReader(process.getInputStream()));
Log.i("cmd", br.readLine());
}//end else.
Runtime.getRuntime().exec("adb reboot");
}//end try.
catch (IOException e) {
Log.i("eyedetection", "error in executing adb commands");
}//end catch.
}//end if the app is not system app.
else {
Toast.makeText(getApplicationContext (), "It's system app", Toast.LENGTH_LONG).show();
}
The app doesn't crash, but I get these lines in the logcat:
03-24 22:28:37.661 22576-22576/com.project.android.eyedetection W/dalvikvm: VFY: unable to resolve virtual method 143: Landroid/app/Notification$Builder;.setPriority (I)Landroid/app/Notification$Builder;
03-24 22:28:37.661 22576-22576/com.project.android.eyedetection D/dalvikvm: VFY: replacing opcode 0x6e at 0x0042
03-24 22:28:37.661 22576-22576/com.project.android.eyedetection I/dalvikvm: Could not find method android.app.Notification$Builder.setLocalOnly, referenced from method com.google.android.gms.common.os.b
03-24 22:28:37.661 22576-22576/com.project.android.eyedetection W/dalvikvm: VFY: unable to resolve virtual method 142: Landroid/app/Notification$Builder;.setLocalOnly (Z)Landroid/app/Notification$Builder;
03-24 22:28:37.661 22576-22576/com.project.android.eyedetection D/dalvikvm: VFY: replacing opcode 0x6e at 0x00ce
03-24 22:28:37.661 22576-22576/com.project.android.eyedetection E/dalvikvm: Could not find class 'android.app.Notification$BigTextStyle', referenced from method com.google.android.gms.common.os.b
03-24 22:28:37.661 22576-22576/com.project.android.eyedetection W/dalvikvm: VFY: unable to resolve new-instance 42 (Landroid/app/Notification$BigTextStyle;) in Lcom/google/android/gms/common/os;
03-24 22:28:37.661 22576-22576/com.project.android.eyedetection D/dalvikvm: VFY: replacing opcode 0x22 at 0x00d7
03-24 22:28:37.661 22576-22576/com.project.android.eyedetection D/dalvikvm: DexOpt: couldn't find field Landroid/app/Notification;.extras
03-24 22:28:37.661 22576-22576/com.project.android.eyedetection W/dalvikvm: VFY: unable to resolve instance field 10
03-24 22:28:37.661 22576-22576/com.project.android.eyedetection D/dalvikvm: VFY: replacing opcode 0x54 at 0x00ed
03-24 22:28:37.661 22576-22576/com.project.android.eyedetection D/dalvikvm: DexOpt: unable to opt direct call 0x0084 at 0x4c in Lcom/google/android/gms/common/os;.b
03-24 22:28:37.669 22576-22576/com.project.android.eyedetection D/dalvikvm: DexOpt: unable to opt direct call 0x0084 at 0xd9 in Lcom/google/android/gms/common/os;.b
03-24 22:28:37.669 22576-22576/com.project.android.eyedetection E/dalvikvm: Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.ou.a
03-24 22:28:37.669 22576-22576/com.project.android.eyedetection W/dalvikvm: VFY: unable to resolve check-cast 30 (Landroid/app/AppOpsManager;) in Lcom/google/android/gms/common/ou;
03-24 22:28:37.669 22576-22576/com.project.android.eyedetection D/dalvikvm: VFY: replacing opcode 0x1f at 0x0010
03-24 22:28:37.669 22576-22576/com.project.android.eyedetection I/dalvikvm: Could not find method android.content.pm.PackageManager.getPackageInstaller, referenced from method com.google.android.gms.common.ou.a
03-24 22:28:37.669 22576-22576/com.project.android.eyedetection W/dalvikvm: VFY: unable to resolve virtual method 430: Landroid/content/pm/PackageManager;.getPackageInstaller ()Landroid/content/pm/PackageInstaller;
03-24 22:28:37.669 22576-22576/com.project.android.eyedetection D/dalvikvm: VFY: replacing opcode 0x6e at 0x000d
03-24 22:28:37.677 22576-22576/com.project.android.eyedetection E/dalvikvm: Could not find class 'android.os.UserManager', referenced from method com.google.android.gms.common.ou.p
03-24 22:28:37.677 22576-22576/com.project.android.eyedetection W/dalvikvm: VFY: unable to resolve check-cast 235 (Landroid/os/UserManager;) in Lcom/google/android/gms/common/ou;
03-24 22:28:37.677 22576-22576/com.project.android.eyedetection D/dalvikvm: VFY: replacing opcode 0x1f at 0x000e
03-24 22:28:37.677 22576-22576/com.project.android.eyedetection D/dalvikvm: DexOpt: couldn't find static field Landroid/os/Build;.SUPPORTED_64_BIT_ABIS
03-24 22:28:37.677 22576-22576/com.project.android.eyedetection W/dalvikvm: VFY: unable to resolve static field 119 (SUPPORTED_64_BIT_ABIS) in Landroid/os/Build;
03-24 22:28:37.677 22576-22576/com.project.android.eyedetection D/dalvikvm: VFY: replacing opcode 0x62 at 0x000d
03-24 22:28:37.685 22576-22576/com.project.android.eyedetection D/dalvikvm: DexOpt: couldn't find static field Landroid/os/Build;.SUPPORTED_ABIS
03-24 22:28:37.685 22576-22576/com.project.android.eyedetection W/dalvikvm: VFY: unable to resolve static field 120 (SUPPORTED_ABIS) in Landroid/os/Build;
03-24 22:28:37.685 22576-22576/com.project.android.eyedetection D/dalvikvm: VFY: replacing opcode 0x62 at 0x0008
03-24 22:28:37.685 22576-22576/com.project.android.eyedetection D/dalvikvm: DexOpt: couldn't find static field Landroid/os/Build;.SUPPORTED_32_BIT_ABIS
03-24 22:28:37.685 22576-22576/com.project.android.eyedetection W/dalvikvm: VFY: unable to resolve static field 118 (SUPPORTED_32_BIT_ABIS) in Landroid/os/Build;
03-24 22:28:37.685 22576-22576/com.project.android.eyedetection D/dalvikvm: VFY: replacing opcode 0x62 at 0x0008
03-24 22:28:37.685 22576-22576/com.project.android.eyedetection D/dalvikvm: DexOpt: couldn't find static field Landroid/os/Build;.SUPPORTED_64_BIT_ABIS
03-24 22:28:37.685 22576-22576/com.project.android.eyedetection W/dalvikvm: VFY: unable to resolve static field 119 (SUPPORTED_64_BIT_ABIS) in Landroid/os/Build;
Also these lines:
03-24 22:29:54.388 23305-23305/com.project.android.eyedetection 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.
03-24 22:29:54.388 23305-23305/com.project.android.eyedetection E/GMPM: Scheduler not set. Not logging error/warn.
03-24 22:29:54.403 23305-23335/com.project.android.eyedetection E/GMPM: Uploading is not possible. App measurement disabled
I couldn't figure out the problem from the logcat. Why the code doesn't work? Is it possible to let the app copy itself to another folder on a rooted device, or must we use usb cable?
The 'adb xxx' command can only be used in a PC shell, not in Android/Linux shell.
That is, you should use
Runtime.getRuntime().exec("reboot")
instead of
Runtime.getRuntime().exec("adb reboot").
I have one user running my app getting the following error, which I can't reproduce on my phone or I haven't see on any other phone.
Can any one suggest why this isn't working just for this user, they say that the Googlemaps app works fine.
Note I have Google API and maps in my manifest too.
E/dalvikvm( 1978): Could not find class 'com.google.android.maps.GeoPoint', referenced from method id.wilsononline.gcadroid.gcadroid$loadNearby.<init>
W/dalvikvm( 1978): VFY: unable to resolve new-instance 522 (Lcom/google/android/maps/GeoPoint;) in Lid/wilsononline/gcadroid/gcadroid$loadNearby;
D/dalvikvm( 1978): VFY: replacing opcode 0x22 at 0x006b
D/dalvikvm( 1978): DexOpt: unable to opt direct call 0x0de1 at 0x7d in Lid/wilsononline/gcadroid/gcadroid$loadNearby;.<init>
W/dalvikvm( 1978): VFY: unable to find class referenced in signature (Lcom/google/android/maps/GeoPoint;)
W/dalvikvm( 1978): VFY: unable to find class referenced in signature (Lcom/google/android/maps/GeoPoint;)
W/dalvikvm( 1978): VFY: unable to find class referenced in signature (Lcom/google/android/maps/GeoPoint;)
I/dalvikvm( 1978): Could not find method com.google.android.maps.GeoPoint.getLatitudeE6, referenced from method id.wilsononline.gcadroid.gaLoadNearbyCaches.startLoadCaches
W/dalvikvm( 1978): VFY: unable to resolve virtual method 3554: Lcom/google/android/maps/GeoPoint;.getLatitudeE6 ()I
D/dalvikvm( 1978): VFY: replacing opcode 0x6e at 0x0004