juicycleff / flutter-unity-view-widget

Embeddable unity game engine view for Flutter. Advance demo here https://github.com/juicycleff/flutter-unity-arkit-demo
BSD 3-Clause "New" or "Revised" License
2.13k stars 515 forks source link

Build failing while integrating AR Foundation(AR Core) to Flutter #101

Closed GokulDas027 closed 4 years ago

GokulDas027 commented 4 years ago

FAILURE: Build failed with an exception.

What went wrong: Could not determine the dependencies of task ':app:preDebugBuild'. Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'. Could not find :arcore_client:. Required by: project :app > project :flutter_unity_widget > project :UnityExport Could not find :unityandroidpermissions:. Required by: project :app > project :flutter_unity_widget > project :UnityExport Could not find :UnityARCore:. Required by: project :app > project :flutter_unity_widget > project :UnityExport

Added modules(all 4 files) Project Structure: Capture

Android/Settings.gradle : Capture1

subjectdenied commented 4 years ago

this is a bit more complicated to be honest, if you never worked with android and gradle before, but basically you have to do this

make sure once it is working, you save this file as a copy, as currently it is overwritten everytime you do a new export from unity using the flutter menu, the export kinda does the same, but it wants to include the libs directly (using implementation name) which never worked for me

GokulDas027 commented 4 years ago

Thanks!! It Worked!🤩

Firstly, It's really complicated.. I couldn't even keep count of the number of build.gradle files..!!

And so i thought, It was dealt with... and now it worked as I replaced it. Also ARPresto is somehow not needed now.. didn't have that project or module.

Thanks now that it worked👍

GokulDas027 commented 4 years ago

Now, this is how the build.gradle file is..

Annotation 2020-02-02 100431

GokulDas027 commented 4 years ago

Successfully created the release build but the app is crashing on startup, checking for the reason..

subjectdenied commented 4 years ago

use --no-shrink when building the app, had the same issue

also in case you upgrade the ar-foundation packages in unity, make sure you always replace the modules inside the grade submodules with the updated aar-files from unityexport/libs

scaydogdu commented 4 years ago

anyone unfamiliar with gradle can check out: https://stackoverflow.com/questions/16682847/how-to-manually-include-external-aar-package-using-new-gradle-android-build-syst

LucasTejero commented 4 years ago

I already use this plugin to made an IOS Ar app,but now im trying to create the android version i follow all of the steps in the docs but i have this error E/Unity (11649): Failed to load '/data/app/com.artplacer.artplacer-Cmg6Ih1K7jWKRmvSGLeqAw==/lib/x86/libmain.so', the application will terminate. E/flutter (11649): [ERROR:flutter/shell/platform/android/platform_view_android_jni_impl.cc(43)] java.lang.UnsatisfiedLinkError: dlopen failed: library "/data/app/com.artplacer.artplacer-Cmg6Ih1K7jWKRmvSGLeqAw==/lib/x86/libmain.so" not found

i dont know how to solve it,im new in the android world

subjectdenied commented 3 years ago

I already use this plugin to made an IOS Ar app,but now im trying to create the android version i follow all of the steps in the docs but i have this error E/Unity (11649): Failed to load '/data/app/com.artplacer.artplacer-Cmg6Ih1K7jWKRmvSGLeqAw==/lib/x86/libmain.so', the application will terminate. E/flutter (11649): [ERROR:flutter/shell/platform/android/platform_view_android_jni_impl.cc(43)] java.lang.UnsatisfiedLinkError: dlopen failed: library "/data/app/com.artplacer.artplacer-Cmg6Ih1K7jWKRmvSGLeqAw==/lib/x86/libmain.so" not found

i dont know how to solve it,im new in the android world

were you ever able to fix this? have the same issue now with latest plugin (2.x), since i started to use gradle 5.6.4 (which has to be used to even be able to compile with arcore using unity2020.2b5+)

rahulmool commented 3 years ago

If any of you have implemented flutter unity widget with arfoundation then please send me the link of project. The project they include in documentation is really old. Please help me.