Hi,
I've tried deploy an android application that was built using API 100.0, but on my Zenfone 2 it always crashes. I got it to work on a Pixel and Moto G4 (I believe that both have ARM architeture).
Here my whole code:
XML
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="br.com.inflor.myapplication.MainActivity">
<com.esri.arcgisruntime.mapping.view.MapView
android:id="@+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</com.esri.arcgisruntime.mapping.view.MapView>
</android.support.constraint.ConstraintLayout>
Controller
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.esri.arcgisruntime.mapping.ArcGISMap;
import com.esri.arcgisruntime.mapping.Basemap;
import com.esri.arcgisruntime.mapping.view.MapView;
public class MainActivity extends AppCompatActivity {
private MapView mMapView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mMapView = (MapView) findViewById(R.id.mapView);
ArcGISMap map = new ArcGISMap(Basemap.Type.TOPOGRAPHIC, 34.056295, -117.195800, 16);
mMapView.setMap(map);
}
@Override
protected void onPause(){
mMapView.pause();
super.onPause();
}
@Override
protected void onResume(){
super.onResume();
mMapView.resume();
}
}
Hello Tércyo Storck,
Can you post the error that you get when the application crashes?
Additionally, are you using any other libraries in your project? Could you post the dependencies from your gradle file? It should look something like this:
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:25.2.0' compile 'com.android.support.constraint:constraint-layout:1.0.2' compile 'com.android.support:design:25.2.0' testCompile 'junit:junit:4.12' }
Thanks,
Alexander
Also Tércyo Storck , could you post exactly what model phone you're having problems with? Looks like there's a few variants of a Zenfone 2, some are x86 chips and others are x64.
Model Number: ASUS_Z00AD
It's x64
Thanks Tércyo Storck.
If this is specifically a problem on 64-bit devices (same project runs fine on Armv7-A devices), then the advice in this stackoverflow post may be useful: How to use 32-bit native libraries on 64-bit Android device - Stack Overflow .
Our 100.0 release doesn't include 64-bit native libraries, but 64-bit devices run 32-bit libraries OK. However, if the OS loads another dependency that does have 64-bit libraries, prior to loading our SDK, then the OS will be looking for 64-bit libraries for all other dependencies, which means loading our 32-bit native library (libruntimecore_java.so) will fail at runtime. Hence Alexander Nohe asking about dependencies, above. A solution to this general problem is to filter out 64-bit native libraries from the APK, so the OS is then expecting all libraries to be 32-bit. We're considering including 64-bit specific libraries in future releases.
Let us know if you try this solution and it doesn't help.