「Monaca/実機/Android」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→プロジェクト名) |
|||
| 行7: | 行7: | ||
helloworldアプリが実機で実行できた。 | helloworldアプリが実機で実行できた。 | ||
| + | |||
| + | ==maven追加設定方法== | ||
| + | plugin.xml | ||
| + | <platform name="android"> | ||
| + | <framework src="build-extras.gradle" custom="true" type="gradleReference"/> | ||
| + | </platform> | ||
| + | |||
| + | build-extras.gradle | ||
| + | <pre> | ||
| + | ext.postBuildExtras = { | ||
| + | allprojects { | ||
| + | repositories { | ||
| + | maven { | ||
| + | url "https://maven.google.com" | ||
| + | } | ||
| + | jcenter() | ||
| + | } | ||
| + | } | ||
| + | android { | ||
| + | compileOptions { | ||
| + | sourceCompatibility JavaVersion.VERSION_1_8 | ||
| + | targetCompatibility JavaVersion.VERSION_1_8 | ||
| + | } | ||
| + | } | ||
| + | configurations.all { | ||
| + | resolutionStrategy { | ||
| + | force 'com.android.support:support-v4:26.+' | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | </pre> | ||
| + | 参考:https://qiita.com/keeey/items/3a85d0673485d3e8d669 | ||
2020年6月15日 (月) 17:07時点における版
Android実機実行
- クラウドIDEのビルド/androidアプリビルド/デバッグビルドから"ビルド開始する"ボタンをクリックする。
- ビルドが終わったら、ビルド/ビルド結果一覧からダウンロードする。
- QRコードからアプリをインストールする。(これはandroidのmonacaデバッガー)
- インストールされたアプリで、monacaログインする。
- プロジェクトを選択して起動する。
helloworldアプリが実機で実行できた。
maven追加設定方法
plugin.xml
<platform name="android">
<framework src="build-extras.gradle" custom="true" type="gradleReference"/>
</platform>
build-extras.gradle
ext.postBuildExtras = {
allprojects {
repositories {
maven {
url "https://maven.google.com"
}
jcenter()
}
}
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
configurations.all {
resolutionStrategy {
force 'com.android.support:support-v4:26.+'
}
}
}
