Hi!
An error occurs from the example.
dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:1.0.2' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test.ext:junit:1.1.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' implementation 'com.esri.arcgisruntime:arcgis-android:100.6.0' implementation project(path: ':arcgis-android-toolkit-100.6.0') implementation 'org.apache.directory.studio:org.apache.commons.lang:2.6' implementation 'com.google.code.gson:gson:2.8.4' implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support.constraint:constraint-layout:1.0.2' implementation 'com.android.support:design:28.0.0' implementation 'com.android.support:support-v4:28.0.0' implementation 'com.google.ar.sceneform.ux:sceneform-ux:1.12.0' // Alternatively, use ArSceneView without the UX dependency. implementation 'com.google.ar.sceneform:core:1.12.0' annotationProcessor "androidx.lifecycle:lifecycle-compiler:2.0.0" implementation "androidx.lifecycle:lifecycle-runtime:2.0.0" implementation "androidx.lifecycle:lifecycle-extensions:2.0.0" implementation "androidx.lifecycle:lifecycle-common-java8:2.0.0" }
Would you mind sharing your whole project with us?
The build.gradle file looks to be mixing androidx dependencies and legacy support dependencies, this may be causing the issue you are seeing. You've also included some dependencies that will be transitively included by the toolkit.
Let's try and get the build.gradle file dependencies in order first before we chase down the issue.
Unless you need to make changes to the toolkit, you don't need to include it as a local module like so:
implementation project(path: ':arcgis-android-toolkit-100.6.0')
What I would recommend is removing that line and adding the following:
implementation "com.esri.arcgisruntime:arcgis-android-toolkit:100.6.0"
Please also see the Toolkit Repo for instructions of how to use the components: GitHub - Esri/arcgis-runtime-toolkit-android: ArcGIS Runtime SDK for Android Toolkit
Luke
Hi Luke!
This solution did not help.
Unless you need to make changes to the toolkit, you don't need to include it as a local module like so:
implementation project(path: ':arcgis-android-toolkit-100.6.0')What I would recommend is removing that line and adding the following:
implementation "com.esri.arcgisruntime:arcgis-android-toolkit:100.6.0"
Thanks for the answer!
I have pulled down the project you have supplied and it appears to be building correctly.
Please clean and rebuild the project by executing the following in Android Studio:
I would also change your dependencies to match the following:
dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'androidx.appcompat:appcompat:1.0.2' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test.ext:junit:1.1.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' implementation "com.esri.arcgisruntime:arcgis-android-toolkit:100.6.0" implementation 'org.apache.directory.studio:org.apache.commons.lang:2.6' implementation 'com.google.code.gson:gson:2.8.4' annotationProcessor "androidx.lifecycle:lifecycle-compiler:2.0.0" implementation "androidx.lifecycle:lifecycle-runtime:2.0.0" implementation "androidx.lifecycle:lifecycle-extensions:2.0.0" implementation "androidx.lifecycle:lifecycle-common-java8:2.0.0" }
Regards,
Luke
Hi Luke!
Сlean up and rebuild the project did not help.
When you click on the button "NAV_BUTTON" crashes with the same error.
Google ArCore is installed on the phone.
Thanks for the answer!
Can you provide me with the device you are using and what version of Android it is running?
I tapped the button and received a different error related to a layout inflation when running on OnePlus 7 Pro running Android 10.
Please check that this section in activity_ar.xml is fixed:
<include layout="@layout/layout_calibration_controls" app:layout_constraintBottom_toTopOf="@+id/calibrateButton" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" android:visibility="gone"/>
Note the @layout added to the layout tag.
Thanks,
Luke
Thanks Luke!
Replaced with this markup and everything worked!
<include layout="@layout/layout_calibration_controls" app:layout_constraintBottom_toTopOf="@+id/calibrateButton" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" android:visibility="gone"/>
Great! Glad I could help.
Luke