Why is jni.h gone

Why is jni.h gone
0.0 0

#1

why is jni.h gone. Some files try to include it, but for some reason, or for no reason, it simply is not. Just… gone… does not exist. Honestly… why.


#2

could helloworld example works with visual studio?


#3

yea it works


#4

Could you plz import admob plugin into helloworld example and test it again.

sdkbox import admob

or

could you share your project with me? I’ll check the project.


#5

Here’s the link to the project:
https://drive.google.com/drive/folders/0B8AuTMygpmbPbWw0V0htdng4aTg?usp=sharing


#6

Also I did do that. I created a new project and have imported admob


#7

I’m downloading your project.

Also I did do that. I created a new project and have imported admob

What about the result ? still compile failed ?

did you try cocos compile -p android or cocos compile -p android --android-studio ?


#8

I’ve compiled it.

usy=1502431740160, context=DefaultDaemonContext[uid=ef1aaea2-e709-4584-bd79-8078
96cd8c16,javaHome=C:\Program Files\Java\jdk1.8.0_144,daemonRegistryDir=C:\Users\
Will\.gradle\daemon,pid=16692,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=25
6m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=windows-1252,-Duser
.country=US,-Duser.language=en,-Duser.variant]}. Dispatching request Build{id=c0
e7a34b-3e88-4ed0-b33e-ff169c08929d.1, currentDir=C:\Users\Will\Documents\Develop
ment\Shaokang\proj.android-studio}.
Received result org.gradle.launcher.daemon.protocol.BuildStarted@45312be2 from d
aemon DaemonInfo{pid=16692, address=[c38cd134-3379-41a6-b1e4-413cc57bc264 port:5
8377, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]], state=Busy, lastBusy=1502431740
160, context=DefaultDaemonContext[uid=ef1aaea2-e709-4584-bd79-807896cd8c16,javaH
ome=C:\Program Files\Java\jdk1.8.0_144,daemonRegistryDir=C:\Users\Will\.gradle\d
aemon,pid=16692,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDu
mpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=windows-1252,-Duser.country=US,-D
user.language=en,-Duser.variant]} (build should be starting).
The client will now receive all logging from the daemon (pid: 16692). The daemon
 log file: C:\Users\Will\.gradle\daemon\3.3\daemon-16692.out.log
Starting build in new daemon [memory: 954.7 MB]
Executing build with daemon context: DefaultDaemonContext[uid=ef1aaea2-e709-4584
-bd79-807896cd8c16,javaHome=C:\Program Files\Java\jdk1.8.0_144,daemonRegistryDir
=C:\Users\Will\.gradle\daemon,pid=16692,idleTimeout=10800000,daemonOpts=-XX:MaxP
ermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=windows-1
252,-Duser.country=US,-Duser.language=en,-Duser.variant]
Creating new cache for plugin-use-metadata, path C:\Users\Will\.gradle\caches\3.
3\plugin-resolution\plugin-use-metadata.bin, access org.gradle.cache.internal.De
faultCacheAccess@83d62cb
Creating new cache for client-status, path C:\Users\Will\.gradle\caches\3.3\plug
in-resolution\client-status.bin, access org.gradle.cache.internal.DefaultCacheAc
cess@83d62cb
Starting Build
Compiling settings file 'C:\Users\Will\Documents\Development\Shaokang\proj.andro
id-studio\settings.gradle' using SubsetScriptTransformer.
Compiling settings file 'C:\Users\Will\Documents\Development\Shaokang\proj.andro
id-studio\settings.gradle' using BuildScriptTransformer.
Settings evaluated using settings file 'C:\Users\Will\Documents\Development\Shao
kang\proj.android-studio\settings.gradle'.
Projects loaded. Root project using build file 'C:\Users\Will\Documents\Developm
ent\Shaokang\proj.android-studio\build.gradle'.
Included projects: [root project 'proj.android-studio', project ':Shaokang', pro
ject ':gps', project ':libcocos2dx', project ':maas_ads']
Parallel execution is an incubating feature.
Evaluating root project 'proj.android-studio' using build file 'C:\Users\Will\Do
cuments\Development\Shaokang\proj.android-studio\build.gradle'.
Creating new cache for metadata-2.23/module-metadata, path C:\Users\Will\.gradle
\caches\modules-2\metadata-2.23\module-metadata.bin, access org.gradle.cache.int
ernal.DefaultCacheAccess@5ec7b026
Creating new cache for metadata-2.23/artifact-at-repository, path C:\Users\Will\
.gradle\caches\modules-2\metadata-2.23\artifact-at-repository.bin, access org.gr
adle.cache.internal.DefaultCacheAccess@5ec7b026
Evaluating project ':Shaokang' using build file 'C:\Users\Will\Documents\Develop
ment\Shaokang\proj.android-studio\app\build.gradle'.
Using 2 worker leases.
Creating configuration compile
Creating configuration apk
Creating configuration provided
Creating configuration wearApp
Creating configuration annotationProcessor
Creating configuration jackPlugin
Creating configuration androidTestCompile
Creating configuration androidTestApk
Creating configuration androidTestProvided
Creating configuration androidTestWearApp
Creating configuration androidTestAnnotationProcessor
Creating configuration androidTestJackPlugin
Creating configuration testCompile
Creating configuration testApk
Creating configuration testProvided
Creating configuration testWearApp
Creating configuration testAnnotationProcessor
Creating configuration testJackPlugin
Creating configuration debugCompile
Creating configuration debugApk
Creating configuration debugProvided
Creating configuration debugWearApp
Creating configuration debugAnnotationProcessor
Creating configuration debugJackPlugin
Creating configuration testDebugCompile
Creating configuration testDebugApk
Creating configuration testDebugProvided
Creating configuration testDebugWearApp
Creating configuration testDebugAnnotationProcessor
Creating configuration testDebugJackPlugin
Creating configuration releaseCompile
Creating configuration releaseApk
Creating configuration releaseProvided
Creating configuration releaseWearApp
Creating configuration releaseAnnotationProcessor
Creating configuration releaseJackPlugin
Creating configuration testReleaseCompile
Creating configuration testReleaseApk
Creating configuration testReleaseProvided
Creating configuration testReleaseWearApp
Creating configuration testReleaseAnnotationProcessor
Creating configuration testReleaseJackPlugin
Parsing the SDK, no caching allowed
Parsing C:\Users\Will\AppData\Local\Android\sdk\add-ons\addon-google_apis-google
-24\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\build-tools\22.0.1\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\build-tools\25.0.0\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\cmake\3.6.4111459\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\docs\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\emulator\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\extras\android\m2repository\pack
age.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\extras\google\admob_ads_sdk\pack
age.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\extras\google\google_play_servic
es\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\extras\google\m2repository\packa
ge.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\extras\intel\Hardware_Accelerate
d_Execution_Manager\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\lldb\2.0\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\lldb\2.1\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\lldb\2.2\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\lldb\2.3\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\ndk-bundle\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\patcher\v4\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\platform-tools\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\platforms\android-13\package.xml

Parsing C:\Users\Will\AppData\Local\Android\sdk\platforms\android-22\package.xml

Parsing C:\Users\Will\AppData\Local\Android\sdk\platforms\android-25\package.xml

Parsing C:\Users\Will\AppData\Local\Android\sdk\sources\android-25\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\system-images\android-25\google_
apis\x86\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\tools\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\add-ons\addon-google_apis-google
-24\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\build-tools\22.0.1\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\build-tools\25.0.0\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\cmake\3.6.4111459\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\docs\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\emulator\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\extras\android\m2repository\pack
age.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\extras\google\admob_ads_sdk\pack
age.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\extras\google\google_play_servic
es\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\extras\google\m2repository\packa
ge.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\extras\intel\Hardware_Accelerate
d_Execution_Manager\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\lldb\2.0\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\lldb\2.1\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\lldb\2.2\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\lldb\2.3\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\ndk-bundle\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\patcher\v4\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\platform-tools\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\platforms\android-13\package.xml

Parsing C:\Users\Will\AppData\Local\Android\sdk\platforms\android-22\package.xml

Parsing C:\Users\Will\AppData\Local\Android\sdk\platforms\android-25\package.xml

Parsing C:\Users\Will\AppData\Local\Android\sdk\sources\android-25\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\system-images\android-25\google_
apis\x86\package.xml
Parsing C:\Users\Will\AppData\Local\Android\sdk\tools\package.xml
SDK initialized in 104306 ms
Evaluating project ':libcocos2dx' using build file 'C:\Users\Will\Documents\Deve
lopment\Shaokang\cocos2d\cocos\platform\android\libcocos2dx\build.gradle'.
Compiling build file 'C:\Users\Will\Documents\Development\Shaokang\cocos2d\cocos
\platform\android\libcocos2dx\build.gradle' using SubsetScriptTransformer.
Compiling build file 'C:\Users\Will\Documents\Development\Shaokang\cocos2d\cocos
\platform\android\libcocos2dx\build.gradle' using BuildScriptTransformer.
Creating configuration compile
Creating configuration publish
Creating configuration provided
Creating configuration wearApp
Creating configuration annotationProcessor
Creating configuration jackPlugin
Creating configuration androidTestCompile
Creating configuration androidTestPublish
Creating configuration androidTestProvided
Creating configuration androidTestWearApp
Creating configuration androidTestAnnotationProcessor
Creating configuration androidTestJackPlugin
Creating configuration testCompile
Creating configuration testPublish
Creating configuration testProvided
Creating configuration testWearApp
Creating configuration testAnnotationProcessor
Creating configuration testJackPlugin
Creating configuration debugCompile
Creating configuration debugPublish
Creating configuration debugProvided
Creating configuration debugWearApp
Creating configuration debugAnnotationProcessor
Creating configuration debugJackPlugin
Creating configuration testDebugCompile
Creating configuration testDebugPublish
Creating configuration testDebugProvided
Creating configuration testDebugWearApp
Creating configuration testDebugAnnotationProcessor
Creating configuration testDebugJackPlugin
Creating configuration releaseCompile
Creating configuration releasePublish
Creating configuration releaseProvided
Creating configuration releaseWearApp
Creating configuration releaseAnnotationProcessor
Creating configuration releaseJackPlugin
Creating configuration testReleaseCompile
Creating configuration testReleasePublish
Creating configuration testReleaseProvided
Creating configuration testReleaseWearApp
Creating configuration testReleaseAnnotationProcessor
Creating configuration testReleaseJackPlugin
Parsing the SDK, no caching allowed
SDK initialized in 11 ms
Evaluating project ':maas_ads' using build file 'C:\Users\Will\Documents\Develop
ment\Shaokang\cocos2d\cocos\platform\android\java\libs\maas_ads\build.gradle'.
Compiling build file 'C:\Users\Will\Documents\Development\Shaokang\cocos2d\cocos
\platform\android\java\libs\maas_ads\build.gradle' using SubsetScriptTransformer
.
Compiling build file 'C:\Users\Will\Documents\Development\Shaokang\cocos2d\cocos
\platform\android\java\libs\maas_ads\build.gradle' using BuildScriptTransformer.

Creating configuration compile
Creating configuration publish
Creating configuration provided
Creating configuration wearApp
Creating configuration annotationProcessor
Creating configuration jackPlugin
Creating configuration androidTestCompile
Creating configuration androidTestPublish
Creating configuration androidTestProvided
Creating configuration androidTestWearApp
Creating configuration androidTestAnnotationProcessor
Creating configuration androidTestJackPlugin
Creating configuration testCompile
Creating configuration testPublish
Creating configuration testProvided
Creating configuration testWearApp
Creating configuration testAnnotationProcessor
Creating configuration testJackPlugin
Creating configuration debugCompile
Creating configuration debugPublish
Creating configuration debugProvided
Creating configuration debugWearApp
Creating configuration debugAnnotationProcessor
Creating configuration debugJackPlugin
Creating configuration testDebugCompile
Creating configuration testDebugPublish
Creating configuration testDebugProvided
Creating configuration testDebugWearApp
Creating configuration testDebugAnnotationProcessor
Creating configuration testDebugJackPlugin
Creating configuration releaseCompile
Creating configuration releasePublish
Creating configuration releaseProvided
Creating configuration releaseWearApp
Creating configuration releaseAnnotationProcessor
Creating configuration releaseJackPlugin
Creating configuration testReleaseCompile
Creating configuration testReleasePublish
Creating configuration testReleaseProvided
Creating configuration testReleaseWearApp
Creating configuration testReleaseAnnotationProcessor
Creating configuration testReleaseJackPlugin
Parsing the SDK, no caching allowed

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':Shaokang'.
> Could not resolve all dependencies for configuration ':Shaokang:_debugApk'.
   > A problem occurred configuring project ':libcocos2dx'.
      > Could not resolve all dependencies for configuration ':libcocos2dx:_debu
gPublish'.
         > A problem occurred configuring project ':maas_ads'.
            > The SDK Build Tools revision (22.0.1) is too low for project ':maa
s_ads'. Minimum required is 25.0.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to
get more log output.

BUILD FAILED

Total time: 3 mins 23.606 secs
Stopped 0 worker daemon(s).
Received result Failure[value=org.gradle.initialization.ReportedException: org.g
radle.internal.exceptions.LocationAwareException: A problem occurred configuring
 project ':Shaokang'.] from daemon DaemonInfo{pid=16692, address=[c38cd134-3379-
41a6-b1e4-413cc57bc264 port:58377, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]], st
ate=Busy, lastBusy=1502431740160, context=DefaultDaemonContext[uid=ef1aaea2-e709
-4584-bd79-807896cd8c16,javaHome=C:\Program Files\Java\jdk1.8.0_144,daemonRegist
ryDir=C:\Users\Will\.gradle\daemon,pid=16692,idleTimeout=10800000,daemonOpts=-XX
:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=wind
ows-1252,-Duser.country=US,-Duser.language=en,-Duser.variant]} (build should be
done).
Error running command, return code: 1.

#9

set buildtools to 25 in the build.gradle


#10

I did, it installed 22.0.1 again, here’s my build.gradle:

import org.apache.tools.ant.taskdefs.condition.Os

apply plugin: 'com.android.application'

android {
	compileSdkVersion 25
	buildToolsVersion "25.0.0"

	defaultConfig {
		applicationId "com.great.yu"
		minSdkVersion 10
		targetSdkVersion PROP_TARGET_SDK_VERSION
		versionCode 1
		versionName "1.0"

		externalNativeBuild {
			ndkBuild {
				if (!project.hasProperty("PROP_NDK_MODE") || PROP_NDK_MODE.compareTo('none') != 0) {
					// skip the NDK Build step if PROP_NDK_MODE is none
					targets 'MyGame'
					arguments 'NDK_TOOLCHAIN_VERSION=4.9'
					arguments 'APP_PLATFORM=android-' + PROP_TARGET_SDK_VERSION

					def module_paths = [project.file("../../cocos2d").absolutePath,
										project.file("../../cocos2d/cocos").absolutePath,
										project.file("../../cocos2d/external").absolutePath]
					if (Os.isFamily(Os.FAMILY_WINDOWS)) {
						// should use '/'
						module_paths = module_paths.collect { it.replaceAll('\\\\', '/') }
						arguments 'NDK_MODULE_PATH=' + module_paths.join(";")
					} else {
						arguments 'NDK_MODULE_PATH=' + module_paths.join(':')
					}

					arguments '-j' + Runtime.runtime.availableProcessors()
					abiFilters.addAll(PROP_APP_ABI.split(':').collect { it as String })
				}
			}
		}
	}

	sourceSets.main {
		java.srcDir "src"
		res.srcDir "res"
		manifest.srcFile "AndroidManifest.xml"
		assets.srcDir "../../Resources"
	}

	externalNativeBuild {
		ndkBuild {
			if (!project.hasProperty("PROP_NDK_MODE") || PROP_NDK_MODE.compareTo('none') != 0) {
				// skip the NDK Build step if PROP_NDK_MODE is none
				path "jni/Android.mk"
			}
		}
	}

	signingConfigs {

		release {
			if (project.hasProperty("RELEASE_STORE_FILE")) {
				storeFile file(RELEASE_STORE_FILE)
				storePassword RELEASE_STORE_PASSWORD
				keyAlias RELEASE_KEY_ALIAS
				keyPassword RELEASE_KEY_PASSWORD
			}
		}
	}

	buildTypes {
		release {
			minifyEnabled false
			proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
			if (project.hasProperty("RELEASE_STORE_FILE")) {
				signingConfig signingConfigs.release
			}

			externalNativeBuild {
				ndkBuild {
					arguments 'NDK_DEBUG=0'
				}
			}
		}

		debug {
			externalNativeBuild {
				ndkBuild {
					arguments 'NDK_DEBUG=1'
				}
			}
		}
	}
}

dependencies {
	compile fileTree(dir: 'libs', include: ['*.jar'])
	compile project(':libcocos2dx')
	compile 'com.google.firebase:firebase-ads:10.0.1'
}


apply plugin: 'com.google.gms.google-services'

#11

I need to ask, I’ve downloaded the manual installation of SDKBox’s admob, now I just have a .rar file, what do I do with it?


#12
  1. need to fix the build.gradle for maas_ads module
  2. manually install AdMob, ref to http://docs.sdkbox.com/en/plugins/admob/

#13

Yes, I’ve done that. I’ve tried every method of installing Admob. Also, what do I do with the .rar file it gives me after I click manual installation?


#14

also, how do I fix build.gradle for maas_ads module


#15

Also, how did you get jni.h, did you download something? Where does it come from?