New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Couldn't find "libmonodroid.so" #512

Closed
christianliebel opened this Issue Sep 21, 2017 · 8 comments

Comments

Projects
None yet
4 participants
@christianliebel

christianliebel commented Sep 21, 2017

I tried the Android getting started guide in combination with an already existing Android Studio project.

I’m not trying to show an existing activity from my .NET code, but re-using logic instead. After performing the steps from above, I’m getting the following error message:

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/…/base.apk"],nativeLibraryDirectories=[/data/app/…/lib/arm64, /system/lib64, /vendor/lib64]]] couldn't find "libmonodroid.so"
                      at java.lang.Runtime.loadLibrary0(Runtime.java:984)
                      at java.lang.System.loadLibrary(System.java:1530)
                      at mono.embeddinator.AndroidImpl.initialize(AndroidImpl.java:25)
                      at mono.embeddinator.Runtime.initialize(Runtime.java:126)
                      at mono.embeddinator.Runtime.loadLibrary(Runtime.java:152)
                      at xyz.Native_XYZ/.<clinit>(Native_XYZ.java:17)
                      at java.lang.Class.classForName(Native Method)
                      at java.lang.Class.forName(Class.java:400)
                      at java.lang.Class.forName(Class.java:326)
                      at mono.embeddinator.AndroidRuntimeProvider.attachInfo(AndroidRuntimeProvider.java:22)
                      at android.app.ActivityThread.installProvider(ActivityThread.java:5853)
                      at android.app.ActivityThread.installContentProviders(ActivityThread.java:5445)
                      at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5384)
                      at android.app.ActivityThread.-wrap2(ActivityThread.java)
                      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
                      at android.os.Handler.dispatchMessage(Handler.java:102)
                      at android.os.Looper.loop(Looper.java:154)
                      at android.app.ActivityThread.main(ActivityThread.java:6119)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

I was able to reproduce this is a completely new Android Studio project, so it shouldn’t be related to the project setup. Am I missing something?

@Zomb

This comment has been minimized.

Show comment
Hide comment
@Zomb

Zomb Sep 21, 2017

We have been using Android Studio 3.0 and e4k without the Jack toolchain successfully so far. What error do you get when you don't use the Jack toolchain?

Zomb commented Sep 21, 2017

We have been using Android Studio 3.0 and e4k without the Jack toolchain successfully so far. What error do you get when you don't use the Jack toolchain?

@christianliebel

This comment has been minimized.

Show comment
Hide comment
@christianliebel

christianliebel Sep 21, 2017

I’m on Android Studio 3.0 Beta 6. If I remove jackOptions.enabled true, Gradle says:

Error:Jack is required to support java 8 language features. Either enable Jack or remove sourceCompatibility JavaVersion.VERSION_1_8.

christianliebel commented Sep 21, 2017

I’m on Android Studio 3.0 Beta 6. If I remove jackOptions.enabled true, Gradle says:

Error:Jack is required to support java 8 language features. Either enable Jack or remove sourceCompatibility JavaVersion.VERSION_1_8.

@Zomb

This comment has been minimized.

Show comment
Hide comment
@Zomb

Zomb Sep 21, 2017

You can remove sourceCompatibility JavaVersion.VERSION_1_8. I don't have it in my build.gradle for 3.0

Zomb commented Sep 21, 2017

You can remove sourceCompatibility JavaVersion.VERSION_1_8. I don't have it in my build.gradle for 3.0

@christianliebel

This comment has been minimized.

Show comment
Hide comment
@christianliebel

christianliebel Sep 21, 2017

When I do that, the library created with Embeddinator isn’t recognized anymore (error: package xyz does not exist). But this could also be related to my project setup; the actual problem is that libmonodroid.so can’t be found during runtime.

christianliebel commented Sep 21, 2017

When I do that, the library created with Embeddinator isn’t recognized anymore (error: package xyz does not exist). But this could also be related to my project setup; the actual problem is that libmonodroid.so can’t be found during runtime.

@Zomb

This comment has been minimized.

Show comment
Hide comment
@Zomb

Zomb Sep 21, 2017

And you have noCompress in your gradle?

aaptOptions {
noCompress 'dll'
}

Zomb commented Sep 21, 2017

And you have noCompress in your gradle?

aaptOptions {
noCompress 'dll'
}

@jonathanpeppers

This comment has been minimized.

Show comment
Hide comment
@jonathanpeppers

jonathanpeppers Sep 21, 2017

Contributor

@chliebel it does sound like there is something going wrong here, maybe a couple things would help us figure it out.

  1. You are using the NuGet version? or compiling from source?
  2. We need to probably inspect the contents of your generated AAR file.

One thing I commonly do is run this command:

zipinfo yourPackage.aar

It should list every file.

Next, uncompress the AAR (it's just a zip file) and post the contents of its AndroidManifest.xml

Lastly, I was wondering if you could get a "Hello World" project working, or if it is only a specific project with an issue?

Contributor

jonathanpeppers commented Sep 21, 2017

@chliebel it does sound like there is something going wrong here, maybe a couple things would help us figure it out.

  1. You are using the NuGet version? or compiling from source?
  2. We need to probably inspect the contents of your generated AAR file.

One thing I commonly do is run this command:

zipinfo yourPackage.aar

It should list every file.

Next, uncompress the AAR (it's just a zip file) and post the contents of its AndroidManifest.xml

Lastly, I was wondering if you could get a "Hello World" project working, or if it is only a specific project with an issue?

@tritao

This comment has been minimized.

Show comment
Hide comment
@tritao

tritao Oct 30, 2017

Contributor

Any update, can you check with latest master if this is still an issue?

Contributor

tritao commented Oct 30, 2017

Any update, can you check with latest master if this is still an issue?

@tritao tritao added the bug label Oct 30, 2017

@christianliebel

This comment has been minimized.

Show comment
Hide comment
@christianliebel

christianliebel Nov 4, 2017

@tritao @jonathanpeppers Thanks for your responses.

@jonathanpeppers It’s a specific (existing) .NET Core project I’d like to port.

@tritao I can’t reproduce the error message noted above when I use the current master branch or the latest NuGet package. However, I’m facing another problem now: The app completely crashes without any error message. But I guess that’s up to further research.

christianliebel commented Nov 4, 2017

@tritao @jonathanpeppers Thanks for your responses.

@jonathanpeppers It’s a specific (existing) .NET Core project I’d like to port.

@tritao I can’t reproduce the error message noted above when I use the current master branch or the latest NuGet package. However, I’m facing another problem now: The app completely crashes without any error message. But I guess that’s up to further research.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment