Mobile-UXSDK-Android icon indicating copy to clipboard operation
Mobile-UXSDK-Android copied to clipboard

Update and compile Mobile-UILibrary-Android to use newer version of Android Support Libraries (v26.1.0)

Open ZeroCool2u opened this issue 7 years ago • 6 comments

Description: The Mobile-UILibrary is currently broken for all apps that do not target v24.2.0 and causes frequent intermittent crashes. See the following error message from Studio below:

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 26.1.0, 24.2.0. Examples include com.android.support:animated-vector-drawable:26.1.0 and com.android.support:recyclerview-v7:24.2.0 less... There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion.)

Can you please update and recompile the library provided by the Maven repo to use the latest version?

  • Steps to reproduce the bug or crash issues(It would be great if you can provide this): Use a fresh install of the newest version of Android Studio and any version of the Android SDK that is newer than v24.2.0
  • Crash logs (If you can find it, it would be very helpful): See above error message.
  • DJI Android UILibrary version you are using (Like Android UILibrary 4.0.1.1.0.0, etc): Latest version available from Maven repo and we're using is 4.3.2.
  • DJI Product you are using (Like Phantom 4, Mavic Pro, etc): Mavic Pro, but really doesn't matter in this case.
  • Android system version you are using (Like Android 6.0.1, Android 5.1.1, etc) Android versions 25, 26, and 27 are all effected by this issue.
  • Android device you are using (Like Samsung Galaxy Note 5, Nexus 5, etc) Google Pixel XL 128 GB.
  • Android Studio version you are using (Like Android Studio 2.2, etc) Android Studio 3.0 (Stable).
  • Are you using UILibrary Sample Code (Yes/No)? Yes
  • If the answer of previous one is No, please specify which elements of UILibrary are you using. N/A screen shot 2017-10-30 at 4 33 57 pm

ZeroCool2u avatar Oct 30 '17 21:10 ZeroCool2u

@talobin @oliverou I'm not sure if you guys have seen this, but literally all of the Android tutorials are broken at the moment if you use the current version of Android Studio and the SDK.

ZeroCool2u avatar Nov 02 '17 16:11 ZeroCool2u

Hi @ZeroCool2u, I download the latest Android Studio 3.0 and test the latest Android UILibrary Sample Code: https://github.com/dji-sdk/Mobile-UILibrary-Android/tree/master/sample. After install the missing platforms and Build Tools 25.0.3 and sync project as shown below:

001 002

I can successfully build and run the sample project. I use Mavic Pro and Nexus 5 phone.

screen shot 2017-11-03 at 8 03 09 pm

Could you help to try again?

oliverou avatar Nov 03 '17 12:11 oliverou

@oliverou Yes, it works when I clone the repo and use the settings you provide, however if someone tries to follow the instructions step by step without cloning the repo this would not work, because the current version of Android SDK build Tools is 26.0.2, which is the minimum supported by the Android Gradle Plugin v3.0.0, which is the new default in Android Studio v3.

Either the instructions need to have additional information about the proper version of build tools to use or the tutorial need to be updated to actually reflect the use of Android Studio v3, with the current Build Tools version. Honestly, it seems like the easiest solution is to simply rebuild the UI Library with the updated version of Android Studio and Gradle plugin, but of course whether or not that happens is entirely up to you.

My point is, as of now, if someone follows the step by step tutorial, without cloning the repo, which lets face it is far more likely, they will get an inexplicable error and the project will not build.

ZeroCool2u avatar Nov 06 '17 20:11 ZeroCool2u

+1 to update the DJI sdk and UI sdk to use the latest android studio/tools.

Djacob502 avatar Nov 09 '17 16:11 Djacob502

+1 to update the DJI sdk and UK sdk to use the latest android studio/tools. It will not build currently, also the example tries to claim the privilege MOUNT_UNMOUNT_FILESYSTEM which is no longer allowed, and fails.

RobSherratt avatar Apr 02 '18 17:04 RobSherratt

Has anyone managed to build the main example with latest android studio? If so, please could you save the project in github, I think anyone can post an update ... I am stuck, can't get the build to work at all!!

RobSherratt avatar Apr 02 '18 17:04 RobSherratt