I am trying to implement expo push notification for a chat app so by following the Documentation I reached a part where I need to run the following command: expo push:android:upload --api-key your-token-here
. So I went and got the token from firebase and after running the command I get an error saying Manifest (app.json) not initialized
. I guess the problem comes from the fact that I am using a dynamic config (app.config.js). How could I fix it?
app.config.js
import "dotenv/config";
export default {
expo: {
name: "XXX",
slug: "XXX",
version: "1.0.0",
scheme: "com.XXXXXXXXX.XXXX",
orientation: "portrait",
icon: "./assets/icon.png",
userInterfaceStyle: "light",
splash: {
image: "./assets/splash.png",
resizeMode: "contain",
backgroundColor: "#ffffff",
},
updates: {
fallbackToCacheTimeout: 0,
},
assetBundlePatterns: ["**/*"],
ios: {
supportsTablet: true,
},
android: {
package: "com.XXXXXXXXX.XXXX",
googleServicesFile: "./google-services.json",
adaptiveIcon: {
foregroundImage: "./assets/adaptive-icon.png",
backgroundColor: "#FFFFFF",
},
},
web: {
favicon: "./assets/favicon.png",
},
extra: {
apiKey: process.env.API_KEY,
authDomain: process.env.AUTH_DOMAIN,
projectId: process.env.PROJECT_ID,
storageBucket: process.env.STORAGE_BUCKET,
messagingSenderId: process.env.MESSAGING_SENDER_ID,
appId: process.env.APP_ID,
measurementId: process.env.MEASUREMENT_ID,
oneSignalAppId: process.env.ONESIGNAL_APP_ID,
},
plugins: [
[
"expo-image-picker",
{
photosPermission:
"The app accesses your photos to let you share them with your friends.",
},
],
],
},
};
I wonder if you used the dynamic config before this change? It's hard to say for sure, but looking quickly through the config you posted, I believe you are not expected to have the expo
key in the dynamic config.
Take a look at config docs , the static configs do have the structure with expo
:
// app.json content
{
"expo": {
"name": "My app",
"slug": "my-app"
}
}
But when you look at the dynamic one, everything's flattened to the top level:
// app.config.js content
module.exports = {
"name": "My app",
"slug": "my-app"
};
If it doesn't help, I'd suggest running expo config
to see the introspected resulting config that Expo sees.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.