使用Maven和Intellij制作Java EE WebApp的过程是什么?
这就是我做的:
但是当我创建一个servlet时,IntelliJ在servlet上显示一个符号:

此符号是"位于源根目录之外的Java类.有关详细信息,请参阅配置内容根"一节.
如果我启动项目,我会收到错误消息.
如果我将"resources"目录标记为"Sources Root",则该项目可以正常工作.
但是,如果我重新加载Maven(右键单击/ maven/reimport),资源目录将丢失"源根"结构.
我觉得我的程序有问题.
我无法在我的设备上的测试应用中显示我的广告单元。
我正在使用 firebase_admob 0.9.1+1 插件
这是我使用的代码:
import 'package:firebase_admob/firebase_admob.dart';
Future initAppAds() async {
//Récupère du coup le bon ID selon si je suis sous IOS ou Android
print(getAppId());
await FirebaseAdMob.instance.initialize(appId: 'ca-app-pub-xxxxxxxxMyAppIdxxxxxxxxxxx');
}
Future launchAds() async {
print("launchAds");
print(getInterstitialId());
MobileAdTargetingInfo targetingInfo = MobileAdTargetingInfo(
nonPersonalizedAds: true,
);
InterstitialAd myInterstitial = InterstitialAd(
adUnitId: 'ca-app-pub-xxxxxxxxxxxxx/xxxxMyAdBloc',
targetingInfo: targetingInfo, //Info de l'utilisateur
listener: (MobileAdEvent event) {
print("InterstitialAd event is $event");
},
);
await myInterstitial.load();
await myInterstitial.show(
anchorType: AnchorType.bottom,
anchorOffset: 0.0,
horizontalCenterOffset: 0.0
);
}
Run Code Online (Sandbox Code Playgroud)
这是我得到的日志:
2866-2866/com.fabien.movizz I/Ads: …Run Code Online (Sandbox Code Playgroud)