Closed liulover5 closed 9 years ago
Hi @liulover5,
it delates libgtka_test.so then failed
What does this mean? Did you get any error message you could quote here? (I tried Win7 and ndk-r10b with these sources some time ago and everything worked well then)
can u provide an example
Did you follow these instructions?
This file is only used at AOSP
My sources are supposed to be built within NDK only, sorry. Anyway, I can't give any advice, until you quote the compilation errors here. Please do this.
it delates libgtka_test.so then failed ---->> What does this mean? it is ok ,its my false ...
i build ,as your instructions, but without SDK,...
tks ...i want to build native running app only using NDK,, i need to try more.....
E:\ANDROID_NDK_PROJECT\GTKAndroid\app>..\gradlew
:app:help
Welcome to Gradle 2.2.1.
To run a build, run gradlew
i can not find app-debug.apk ?????????????? // why
i can not find app-debug.apk ?????????????? // why
Did you check in E:\ANDROID_NDK_PROJECT\GTKAndroid\app\build\outputs\apk
?
Oops, I missed this debug in the apk name, sorry.
To build app-debug.apk
you should run this command:
..\gradlew assembleDebug
I'll update the build instructions
tks very much ...
i have BUILD SUCCESSFUL and get app-debug.apk for ver 5.1 and 4.4.2
and running ok on 4.4.2 , show sayhello on screen
i will report u a bug when i build for api 19 (4.4.2 ) , this file will meet an error E:\ANDROID_NDK_PROJECT\GTKAndroid\app\src\main\res\values-v21\styles.xml
maybe android 4.4.2 do not surpport this style
///////////////////////////////////////////////////////////////////////////////////////// please look log ///////////////////////////////////////////////////////////////////////////////////////// E:\ANDROID_NDK_PROJECT\GTKAndroid\app>..\gradlew assembleDebug :app:preBuild :app:compileDebugNdk UP-TO-DATE :app:preDebugBuild :app:checkDebugManifest :app:prepareDebugDependencies :app:compileDebugAidl UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE :app:generateDebugBuildConfig UP-TO-DATE :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets UP-TO-DATE :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources UP-TO-DATE :app:mergeDebugResources :app:processDebugManifest UP-TO-DATE :app:processDebugResources E:\ANDROID_NDK_PROJECT\GTKAndroid\app\build\intermediates\res\debug\values-v21\v alues.xml:5: error: Error retrieving parent for item: No resource found that mat ches the given name 'android:Theme.Material.Light'. :app:processDebugResources FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:processDebugResources'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command: D:\android-sdk-windows\build-tools\19.1\aapt.exe package -f --no-crunch -I D:\android-sdk-windows\platforms\android-19\android.jar -M E:\ANDROID_NDK_PRO JECT\GTKAndroid\app\build\intermediates\manifests\full\debug\AndroidManifest.xml -S E:\ANDROID_NDK_PROJECT\GTKAndroid\app\build\intermediates\res\debug -A E:\AN DROID_NDK_PROJECT\GTKAndroid\app\build\intermediates\assets\debug -m -J E:\ANDRO ID_NDK_PROJECT\GTKAndroid\app\build\generated\source\r\debug -F E:\ANDROID_NDKP ROJECT\GTKAndroid\app\build\intermediates\res\resources-debug.ap --debug-mode - -custom-package org.p2lang.gtkandroid -0 apk Error Code: 1 Output: E:\ANDROID_NDK_PROJECT\GTKAndroid\app\build\intermediates\res\debug\valu es-v21\values.xml:5: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light'.
BUILD FAILED
Total time: 6.343 secs
E:\ANDROID_NDK_PROJECT\GTKAndroid\app>
Thanks for the feedback!
Hmm, this res\values-v21\styles.xml
is not supposed to be used when building for API v19. There is res\values\styles.xml
instead.
How were you building this 4.4.2 version? Did you modify build.gradle
somehow? minSdkVersion
is set to 15
, so the "5.1 APK" should work well on all 4.0.3+ Androids too. No need to build separate binaries for them.
i know res\values-v21\styles.xml is not is not supposed to be used when building for API v19 , but i build API V19 ,it can find this file and build error ( error on the previous quote )....
actually ,when build for V19 should not detect this file and happen this error
tips: i think you can lead this project out of JVM (do not use apk to call gtk C func by jni),
you can build native binary app , using C/S architecture ,for eg: surfaceflinger is server , gtk is client (software draw UI),
I have test client app ( skia/opengl ES draw UI) connect server (surfaceflinger) draw view,
gtk software draw UI same as software skia / hard opengl ES draw UI ,
i modefy build.gradle for 4.4.2 version(API v19) :
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
apply plugin: 'com.android.application'
android { compileSdkVersion 19 buildToolsVersion "19.1"
defaultConfig {
applicationId "org.p2lang.gtkandroid"
minSdkVersion 15
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
}
debug {
jniDebuggable true
}
}
sourceSets.main {
jniLibs.srcDir 'libs'
manifest.srcFile 'AndroidManifest.xml'
// adding gtk.css and other ndk-build non-*.so artifacts
assets.srcDirs = [assets.srcDirs, "libs/assets"]
}
}
dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) }
i modefy build.gradle for 4.4.2 version(API v19)
Ah, I see. Well, I don't think this is a major issue. This file shouldn't be modified to build the app working under 4.4.2.
Thanks for your feedback @liulover5
i can build share lib libgtka_test.so, when i build native c app(only use c called gtk api), when it links share lib libgtka_test.so ,
it delates libgtka_test.so then link failed , can u provide an example ? , tks a lot
notes: i use win7 with android-ndk-r10b i pray you can understand what i say ,poor en...
/////////////////////////////////////////////////Android.mk////////////////////////////////////////////////////////////////////////// /////////////main.c get from your app/jni, i add a main func ,call func android_main ///////////////////////////