AndroidX build error in iOs App!?

Jerome Mx 21 Reputation points
2024-02-15T17:46:51.5566667+00:00

for no apparent reason, with no code changes, my successfully building and running ipad application startedgiving me what looks like an android related error!? Its wasted a lot of my precious little time and blocked my ability to progress with this project. the build error says: Error CS0246: The type or namespace name 'AndroidX' could not be found why would AndroidX have anything to do with an app thats building for ipad air?? ifanyone can help me past this issue I'd be very grateful.. thx, Jerome.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,231 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Jerome Mx 21 Reputation points
    2024-02-22T16:50:43.6733333+00:00

    there was an inappropriate (presumably generated) using statement I didn't know was there..

    using AndroidX.ConstraintLayout.Core.Motion.Utils; DOH!


  2. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 29,381 Reputation points Microsoft Vendor
    2024-02-23T01:30:35.7733333+00:00

    Hello,

    As you said, you found that you added using AndroidX.ConstraintLayout.Core.Motion.Utils; Please try using conditional compilation to target different platforms.

    #if ANDROID
    using  AndroidX.ConstraintLayout.Core.Motion.Utils
    using XXX;// Android library
    
    #elif IOS
    using UIKit;
    using XXXX;// iOS 
    #endif
    

    Best Regards,

    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments