Implemented by example .

Immediately after the opening of the activity, with a fragment of Google maps, it immediately closes. In the logs throws this Warning:

16034-16034 D / dalvikvm: open_cached_dex_file: /data/data/k./mat.google.android.gms/app_chimera/chimera-module-root/module-ca8b2a9144773fc3650c54ed299f2d4558171b12/Mapscdul.appl.accd/5/5/apple/kule.cfc3650c54ed299f2d4558171b12/M.pcn.afe/module-ca8b2a9144773fc3650c54ed299f2d455811b12/Matl./apple/crvvvvvvvvvvvm google.android.gms @ app_chimera @ chimera-module-root @ module-ca8b2a9144773fc3650c54ed299f2d4558171b12 @ MapsModule.apk @ classes.dex 16034-16034 D / ChimeraFileApk: Classloading successful, but it can not be optimized. It will be either run in fallback (interpreted mode) or the odex has been found and isDexOptNeeded is misreporting a failure. 16034-16034 I / Google Maps Android API: Google Play services client version: 8298000 16034-16034 I / Google Maps Android API: Google Play services package version: 8489036 16034-16034 E / dalvikvm: Could not find class' android.app. AppOpsManager ', referenced from method com.google.android.gms.common.mw.a 19859-20049 A / libc: @@@ ABORTING: LIBC: ARGUMENT IS INVALID HEAP ADDRESS IN dlfree addr = 0x5fdc2940 19859-20049 A / libc: Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code = 1), thread 20049 (Thread-770) 19859-20025 D / NativeCrypto: ssl = 0x62d27948 sslRead buf = 0x42263bd0 len = 1, timeo = 2500

Googled, added Multidex , according to the answer , but it did not help.

Here is the manifest:

<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /> <uses-permission android:name="mypakcagename.permission.MAPS_RECEIVE" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="mypakcagename.permission.C2D_MESSAGE" /> <permission android:name="mypakcagename.permission.C2D_MESSAGE" android:protectionLevel="signature" /> <permission android:name="mypakcagename.permission.MAPS_RECEIVE" android:protectionLevel="signature" /> <uses-feature android:glEsVersion="0x00020000" android:required="true" /> <application android:name=".MyApplication" android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".activities.AuthenticationActivity" android:label="@string/app_name" android:theme="@style/AppTheme.Auth" android:screenOrientation="portrait" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <receiver android:name="com.google.android.gms.gcm.GcmReceiver" android:exported="true" android:permission="com.google.android.c2dm.permission.SEND" > <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> <category android:name="com.example.gcm" /> </intent-filter> </receiver> <service android:name=".receivers.MyGcmListenerService" android:exported="false" > <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" /> </intent-filter> </service> <service android:name=".receivers.MyInstanceIDListenerService" android:exported="false"> <intent-filter> <action android:name="com.google.android.gms.iid.InstanceID"/> </intent-filter> </service> <meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="@string/maps_api_key" /> </application> 

public class MapPane extends Activity implements OnMapReadyCallback {

 @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.map_activity); MapFragment mapFragment = (MapFragment) getFragmentManager() .findFragmentById(R.id.map); mapFragment.getMapAsync(this); } @Override public void onMapReady(GoogleMap map) { } 

Please tell me what could be the problem?

  • Can you show the manifesto? - hexonxons
  • @hexonxons, updated. - Alexander
  • This error means that dalwick cannot find the AppOpsManager class. This class appeared with API 19, respectively, when launched on android <4.4 it will not. But in the code of the library itself it is. Perhaps the wrong targetSdkVersion , try to set it as 23. - hexonxons
  • @hexonxons the fact is that I have 23. But I run it on the device from 4.2. So what it turns out that the cards will not work on my device? - Alexander
  • In theory, they should. And it is possible still to fall? - hexonxons

2 answers 2

The problem is not in E/dalvikvm: Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.mw.a , you probably don’t need to pay attention to these messages.

The fall occurs for the following reason:

 A/libc: @@@ ABORTING: LIBC: ARGUMENT IS INVALID HEAP ADDRESS IN dlfree addr=0x5fdc2940 A/libc: Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 20049 (Thread-770) 

Google says that this may be due to the incorrect implementation of the multithreading application - one of the options is there , but to find out what exactly - you need to look at the code itself.

  • The problem is that the code is quite simple. It does not work on one device, but it works on another ... Added code. I’m not doing anything powerful there, just showing the map. - Alexander
  • @Alexander, Try using play-services-gcm version 8.4.0 and update all the ones used to the latest version. There may be a problem in the device itself, or in the emulator, if it is used. Here is one of the options. , a possible problem in the system image API17 , from the 12th year, but may be relevant. Check also that the time on the device is up-to-date. - hexonxons

You have more than 65k methods in your project. In gratl, erase the line that ports google play services and import only what you really need. For example compile 'com.google.android.gms:play-services-gcm:8.4.0'

  • one
    Unfortunately not. Here's how I connected the services: compile 'com.google.android.gms: play-services-gcm: 8.3.0'. If there were more than 56k methods in the project, would I really kill the application? - Alexander
  • Yes, then it wouldn't compile at all - georgehardcore