1
votes

When I try to start the scene in my android app the application crashes with a Fatal Exception.

Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.nomo3d.seezmy3d/com.unity3d.player.UnityPlayerActivity}: android.content.res.Resources$NotFoundException: String resource ID #0x0

Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x0 at android.content.res.Resources.getText(Resources.java:1184) at android.content.res.Resources.getString(Resources.java:1230) at com.unity3d.player.UnityPlayer.GetGlViewContentDescription (Unknown Source) at com.unity3d.player.UnityPlayer.(Unknown Source) at com.unity3d.player.UnityPlayerActivity.onCreate (UnityPlayerActivity.java:25) at android.app.Activity.performCreate(Activity.java:6977) at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1126)

I have followed several of the tutorials for exporting unity scenes to Android like https://medium.com/@angelhiadefiesta/integrate-a-unity-module-to-a-native-android-app-87644fe899e0

Here is the activity that leads into the generated UnityPlayerActivity

class ModelActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activitiy_model)

        val intent = Intent(this, UnityPlayerActivity::class.java)
        startActivity(intent)

        linkMeasurements.setOnClickListener {
            val intent = Intent(this, MeasurementActivity::class.java)
            startActivity(intent)
        }
    }
}

If I could just get the scene to show in my app I could probably troubleshoot my way into how to turn the 3d model around with drag movements etc.

1
Come on, its very very clear from the error that issue is in UnityPlayerActivity class, not ModelActivity Rohit5k2
Yes and the UnityPlayerActivity is an auto generated file from the Unity Editors export function, should I post that here?Ruukinen

1 Answers

2
votes

In my own stupidity I thought the package name of the Unity Library had to be the same as the package name of my app but changing it to its own package name solved the issue. I assume the error was the app trying to resolve the package name and failing to do so since it pointed to itself/was null for the unity 3d library.

I'm going to assume this is how to resolve my specific issue unless someone else figures out something else I did wrong without which the library would work without having different package names.