Examples: Fix Android example build for Gradle 8. (#6229)

This commit is contained in:
duddel 2023-03-07 07:17:56 +01:00 committed by ocornut
parent b6586bb06d
commit 57d0fcd021
5 changed files with 24 additions and 11 deletions

View File

@ -504,4 +504,4 @@ jobs:
- name: Build example_android_opengl3 - name: Build example_android_opengl3
run: | run: |
cd examples/example_android_opengl3/android cd examples/example_android_opengl3/android
gradle assembleDebug gradle assembleDebug --stacktrace

View File

@ -57,6 +57,7 @@ Other changes:
non-client area (e.g. OS decorations) when app is not focused. (#6045, #6162) non-client area (e.g. OS decorations) when app is not focused. (#6045, #6162)
- Backends: SDL2, SDL3: Accept SDL_GetPerformanceCounter() not returning a monotonically - Backends: SDL2, SDL3: Accept SDL_GetPerformanceCounter() not returning a monotonically
increasing value. (#6189, #6114, #3644) [@adamkewley] increasing value. (#6189, #6114, #3644) [@adamkewley]
- Examples: Android: Fixed example build for Gradle 8. (#6229, #6227) [@duddel]
----------------------------------------------------------------------- -----------------------------------------------------------------------

View File

@ -2,13 +2,15 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
android { android {
compileSdkVersion 29 compileSdkVersion 33
buildToolsVersion "30.0.3" buildToolsVersion "33.0.2"
ndkVersion "21.4.7075529" ndkVersion "25.2.9519653"
defaultConfig { defaultConfig {
applicationId "imgui.example.android" applicationId "imgui.example.android"
minSdkVersion 23 namespace "imgui.example.android"
targetSdkVersion 29 minSdkVersion 24
targetSdkVersion 33
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
} }
@ -20,9 +22,19 @@ android {
} }
} }
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget="11"
}
externalNativeBuild { externalNativeBuild {
cmake { cmake {
path "../../CMakeLists.txt" path "../../CMakeLists.txt"
version '3.22.1'
} }
} }
} }

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="imgui.example.android">
<application <application
android:label="ImGuiExample" android:label="ImGuiExample"
@ -11,7 +10,8 @@
<activity <activity
android:name="imgui.example.android.MainActivity" android:name="imgui.example.android.MainActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:configChanges="orientation|keyboardHidden|screenSize"> android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="false">
<meta-data android:name="android.app.lib_name" <meta-data android:name="android.app.lib_name"
android:value="ImGuiExample" /> android:value="ImGuiExample" />

View File

@ -1,12 +1,12 @@
buildscript { buildscript {
ext.kotlin_version = '1.4.31' ext.kotlin_version = '1.8.0'
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:4.1.0' classpath 'com.android.tools.build:gradle:7.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
} }