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?
AppOpsManagerclass. 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 wrongtargetSdkVersion, try to set it as 23. - hexonxons