Search code examples
androidandroid-studioapple-m1

I have MAC M1 pro chipset and when Im running test in android studio Im getting error which is attached below.Im able to build and app is running fine


so I have MAC M1 pro chipset and when Im running test in android studio I'm getting error which is attached below , I'm able to build and app is running fine.

com.almworks.sqlite4java.SQLiteException: [-91] cannot load library: java.lang.UnsatisfiedLinkError:  dlopen(/private/var/folders/66/7nxvb30d67ddp3llcg4wqrw80000gq/T/1663693890027-0/libsqlite4java.dylib, 0x0001): tried: 

(fat file, but missing compatible architecture (have (i386,x86_64), need (arm64e)))
java.lang.RuntimeException: com.almworks.sqlite4java.SQLiteException: [-91] cannot load library: java.lang.UnsatisfiedLinkError: /private/var/folders/66/7nxvb30d67ddp3llcg4wqrw80000gq/T/1663693890027-0/libsqlite4java.dylib: dlopen(/private/var/folders/66/7nxvb30d67ddp3llcg4wqrw80000gq/T/1663693890027-0/libsqlite4java.dylib, 0x0001): tried: '/private/var/folders/66/7nxvb30d67ddp3llcg4wqrw80000gq/T/1663693890027-0/libsqlite4java.dylib' 

(fat file, but missing compatible architecture (have (i386,x86_64), need (arm64e)))
at org.robolectric.shadows.util.SQLiteLibraryLoader.loadFromDirectory(SQLiteLibraryLoader.java:90)
    at org.robolectric.shadows.util.SQLiteLibraryLoader.doLoad(SQLiteLibraryLoader.java:57)

Solution

  • According to this Apple Silicon support issue

    Maybe you could upgrade robolectric to 4.7.0+.

    in build.gradle

    testImplementation "org.robolectric:robolectric:4.8.1"