在新项目中使用相同的代码可以正常工作,但在我现有的项目中会导致崩溃,请帮助我。 谢谢
清单文件
set identity_insert RefTable on;
insert into RefTable (id, name)
select id, name
from sourceDb.sourceSchema.RefTable s
where not exists (
select 1
from RefTable t
where t.Id = s.Id
);
set identity_insert RefTable off;
我的MainActivity代码
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="@string/testAppID"/>
</activity>
错误:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//testAppID = sample ID provided by admob
MobileAds.initialize(this, "@strings/testAppID");
mAdView = findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
mAdView.loadAd(adRequest);
}
答案 0 :(得分:0)
元数据标签必须位于应用程序标签内。尝试将其移出活动代码。有关更多信息,请参见doc
<application>
<meta-data
android:name="com.google.android.gms.ads.APPLICATION_ID"
android:value="@string/testAppID"/>
</application>