` new TextureLoader().load(require('../../assets/some.png'))`,the code is working right,but not working in apk

Please provide the following:

  1. SDK Version:48.0.9
  2. Platforms(Android/iOS/web/all):Android
  3. Add the appropriate “Tag” based on what Expo library you have a question on.
    Hi
    I had used expo-gl and expo-three with my project .It works well in a development environment,but Images cannot be loaded in the preview environment .
    This is the code :
class Map extends THREE.Mesh {
  constructor() {
    super(
      new THREE.PlaneGeometry(1000, 2560),
      new THREE.MeshBasicMaterial({
        map: new TextureLoader().load(require('../../assets/wuhanMap.png')),
        side: THREE.DoubleSide,
      })
    );
  }
}

I have two guesses:

  1. image is not in apk file,so some error occurred in the eas.json file
{
  "cli": {
    "version": ">= 3.8.1"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal",
      "ios": {
        "resourceClass": "m-medium"
      },
      "android": {
        "buildType": "apk"
      }
    },
    "preview": {
    
      "distribution": "internal",
      "ios": {
        "resourceClass": "m-medium"
      },
      "android": {
        "buildType": "apk"
      }
    },
    "production": {
      "ios": {
        "resourceClass": "m-medium"
      },
      "android": {
        "buildType": "apk"
      }
    }
  },
  "submit": {
    "production": {}
  }
}
  1. My use of expo-three was incorrect

I’m not sure if my guess is correct, I hope someone can help me,thank you very much!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.